Beispiel #1
0
static int ril_disable(struct ofono_modem *modem)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ril_data *rd = ofono_modem_get_data(modem);
	const char *path = ofono_modem_get_path(modem);
	struct parcel rilp;
	int cmd_id;
	char buf[4];

	DBG("%p", modem);

	if (g_dbus_unregister_interface(conn, path,
					THERMAL_MANAGEMENT_INTERFACE))
		ofono_modem_remove_interface(modem,
						THERMAL_MANAGEMENT_INTERFACE);

	/* RIL_OEM_HOOK_STRING_SET_MODEM_OFF = 0x000000CF */
	cmd_id = 0x000000CF;
	sprintf(buf, "%d", cmd_id);
	parcel_init(&rilp);
	parcel_w_int32(&rilp, 1);
	parcel_w_string(&rilp, buf);

	g_ril_append_print_buf(rd->ril, "{cmd_id=0x%02X}", cmd_id);

	g_ril_send(rd->ril, RIL_REQUEST_OEM_HOOK_STRINGS, &rilp,
					ril_send_power_off_cb, modem, NULL);

	return -EINPROGRESS;
}
Beispiel #2
0
static void audio_settings_unregister(struct ofono_atom *atom)
{
	struct ofono_audio_settings *as = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(as->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(as->atom);

	ofono_modem_remove_interface(modem, OFONO_AUDIO_SETTINGS_INTERFACE);
	g_dbus_unregister_interface(conn, path, OFONO_AUDIO_SETTINGS_INTERFACE);
}
Beispiel #3
0
static void call_volume_unregister(struct ofono_atom *atom)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	ofono_modem_remove_interface(modem, OFONO_CALL_VOLUME_INTERFACE);
	g_dbus_unregister_interface(conn, path,
					OFONO_CALL_VOLUME_INTERFACE);
}
Beispiel #4
0
static void call_meter_unregister(struct ofono_atom *atom)
{
	struct ofono_call_meter *cm = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(cm->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(cm->atom);

	ofono_modem_remove_interface(modem, OFONO_CALL_METER_INTERFACE);
	g_dbus_unregister_interface(conn, path, OFONO_CALL_METER_INTERFACE);
}
Beispiel #5
0
static void location_reporting_unregister(struct ofono_atom *atom)
{
	struct ofono_location_reporting *lr = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(lr->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(lr->atom);

	ofono_modem_remove_interface(modem, OFONO_LOCATION_REPORTING_INTERFACE);
	g_dbus_unregister_interface(conn, path,
					OFONO_LOCATION_REPORTING_INTERFACE);
}
Beispiel #6
0
static void cdma_netreg_unregister(struct ofono_atom *atom)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	g_dbus_unregister_interface(conn, path,
				OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE);

	ofono_modem_remove_interface(modem,
				OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE);
}
Beispiel #7
0
static void sms_unregister(struct ofono_atom *atom)
{
	struct ofono_sms *sms = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	g_dbus_unregister_interface(conn, path,
					OFONO_MESSAGE_MANAGER_INTERFACE);
	ofono_modem_remove_interface(modem, OFONO_MESSAGE_MANAGER_INTERFACE);

	if (sms->mw_watch) {
		__ofono_modem_remove_atom_watch(modem, sms->mw_watch);
		sms->mw_watch = 0;
		sms->mw = NULL;
	}

	if (sms->status_watch) {
		__ofono_netreg_remove_status_watch(sms->netreg,
							sms->status_watch);
		sms->status_watch = 0;
	}

	if (sms->netreg_watch) {
		__ofono_modem_remove_atom_watch(modem, sms->netreg_watch);
		sms->netreg_watch = 0;
	}

	sms->netreg = NULL;

	if (sms->messages) {
		GHashTableIter iter;
		struct message *m;
		gpointer key, value;

		g_hash_table_iter_init(&iter, sms->messages);

		while (g_hash_table_iter_next(&iter, &key, &value)) {
			m = value;
			message_dbus_unregister(m);
		}

		g_hash_table_destroy(sms->messages);
		sms->messages = NULL;
	}

	__ofono_watchlist_free(sms->text_handlers);
	sms->text_handlers = NULL;

	__ofono_watchlist_free(sms->datagram_handlers);
	sms->datagram_handlers = NULL;
}
Beispiel #8
0
static void gnss_unregister(struct ofono_atom *atom)
{
	struct ofono_gnss *gnss = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	if (gnss->posr_agent)
		gnss_agent_free(gnss->posr_agent);

	ofono_modem_remove_interface(modem, OFONO_GNSS_INTERFACE);
	g_dbus_unregister_interface(conn, path, OFONO_GNSS_INTERFACE);
}
Beispiel #9
0
static void oem_raw_dbus_unregister(struct ofono_atom *atom)
{
	DBG("");
	struct ofono_oem_raw *oemraw = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(oemraw->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(oemraw->atom);

	ofono_modem_remove_interface(modem, OFONO_OEM_RAW_INTERFACE);

	if (!g_dbus_unregister_interface(conn, path, OFONO_OEM_RAW_INTERFACE))
		ofono_error("Failed to unregister interface %s",
				OFONO_OEM_RAW_INTERFACE);
}
Beispiel #10
0
static void push_notification_cleanup(gpointer user)
{
	struct push_notification *pn = user;

	DBG("%p", pn);

	/* The push watch was already cleaned up */
	pn->push_watch[0] = 0;
	pn->push_watch[1] = 0;
	pn->sms = NULL;

	sms_agent_free(pn->agent);

	ofono_modem_remove_interface(pn->modem, PUSH_NOTIFICATION_INTERFACE);
}
Beispiel #11
0
static void handsfree_unregister(struct ofono_atom *atom)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);
	struct ofono_handsfree *hf = __ofono_atom_get_data(atom);

	if (hf->pending) {
		DBusMessage *reply = __ofono_error_failed(hf->pending);
		__ofono_dbus_pending_reply(&hf->pending, reply);
	}

	ofono_modem_remove_interface(modem, OFONO_HANDSFREE_INTERFACE);
	g_dbus_unregister_interface(conn, path,
					OFONO_HANDSFREE_INTERFACE);
}
Beispiel #12
0
static void ril_remove(struct ofono_modem *modem)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ril_data *rd = ofono_modem_get_data(modem);
	const char *path = ofono_modem_get_path(modem);

	if (g_dbus_unregister_interface(conn, path,
					THERMAL_MANAGEMENT_INTERFACE))
		ofono_modem_remove_interface(modem,
						THERMAL_MANAGEMENT_INTERFACE);

	ofono_modem_set_data(modem, NULL);

	g_ril_unref(rd->ril);
	g_free(rd);
}
Beispiel #13
0
static void ussd_unregister(struct ofono_atom *atom)
{
	struct ofono_ussd *ussd = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	g_slist_free_full(ussd->ss_control_list, ssc_entry_destroy);
	ussd->ss_control_list = NULL;

	g_slist_free_full(ussd->ss_passwd_list, ssc_entry_destroy);
	ussd->ss_passwd_list = NULL;

	ofono_modem_remove_interface(modem,
					OFONO_SUPPLEMENTARY_SERVICES_INTERFACE);
	g_dbus_unregister_interface(conn, path,
					OFONO_SUPPLEMENTARY_SERVICES_INTERFACE);
}
Beispiel #14
0
static void stk_unregister(struct ofono_atom *atom)
{
	struct ofono_stk *stk = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	if (stk->session_agent)
		stk_agent_free(stk->session_agent);

	if (stk->default_agent)
		stk_agent_free(stk->default_agent);

	if (stk->pending_cmd) {
		stk_command_free(stk->pending_cmd);
		stk->pending_cmd = NULL;
	}

	if (stk->idle_mode_text) {
		g_free(stk->idle_mode_text);
		stk->idle_mode_text = NULL;
	}

	if (stk->timers_source) {
		g_source_remove(stk->timers_source);
		stk->timers_source = 0;
	}

	if (stk->main_menu) {
		stk_menu_free(stk->main_menu);
		stk->main_menu = NULL;
	}

	g_queue_foreach(stk->envelope_q, (GFunc) g_free, NULL);
	g_queue_free(stk->envelope_q);

	ofono_modem_remove_interface(modem, OFONO_STK_INTERFACE);
	g_dbus_unregister_interface(conn, path, OFONO_STK_INTERFACE);
}