diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/changelog urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/changelog --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/changelog 2014-11-13 14:33:50.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/changelog 2015-03-24 13:09:43.000000000 +0000 @@ -1,4 +1,19 @@ -urfkill (0.6.0~20141020.151220.1dc6cf4~rtm-0ubuntu1) 14.09; urgency=medium +urfkill (0.6.0~20150318.103828.5539c0d.1~rtm-0ubuntu1) 14.09; urgency=medium + + * New upstream snapshot, bugfix only: + - Guard against double call to set ofono's online property. + - UrfConfig: make the strict flight mode a configuration parameter. + - UrfConfig: Enforce strict flight mode when set. (LP: #1427439) + + -- Mathieu Trudel-Lapierre Thu, 19 Mar 2015 20:50:13 -0400 + +urfkill (0.6.0~20141020.151220.1dc6cf4-0ubuntu2) vivid; urgency=medium + + * Add systemd unit. + + -- Martin Pitt Wed, 14 Jan 2015 13:00:33 +0100 + +urfkill (0.6.0~20141020.151220.1dc6cf4-0ubuntu1) vivid; urgency=medium * New release snapshot: - UrfOfonoManager: check NULL proxy (LP: #1381818) diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/control urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/control --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/control 2014-11-11 18:36:22.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/control 2015-03-24 13:09:43.000000000 +0000 @@ -9,6 +9,7 @@ debhelper (>= 9), dh-autoreconf (>=2), dh-exec (>=0.3), + dh-systemd, gir1.2-gtk-2.0, gir1.2-gtk-3.0, gobject-introspection (>= 0.6.7), diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/rules urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/rules --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/rules 2014-11-11 18:36:22.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/rules 2015-03-24 13:09:43.000000000 +0000 @@ -9,6 +9,9 @@ debian/urfkill.upstart: debian/urfkill.upstart.in sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $? > debian/`basename $? .in` +debian/urfkill.service: debian/urfkill.service.in + sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $? > debian/`basename $? .in` + debian/urfkill.init: debian/urfkill.init.in sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $? > debian/`basename $? .in` @@ -17,10 +20,10 @@ intltoolize -f -c override_dh_auto_clean: - rm -f debian/urfkill.upstart + rm -f debian/urfkill.upstart debian/urfkill.service dh_auto_clean -override_dh_auto_configure: debian/urfkill.upstart +override_dh_auto_configure: debian/urfkill.upstart debian/urfkill.service dh_auto_configure -- --libexecdir=\$${libdir}/urfkill \ --with-session-tracking=systemd @@ -33,4 +36,4 @@ rm -rf ./debian/urfkill/usr/share/dbus-1/system-services/ %: - dh $@ --with autotools_dev,autoreconf + dh $@ --with autotools_dev,autoreconf,systemd diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/urfkill.service.in urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/urfkill.service.in --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/debian/urfkill.service.in 1970-01-01 00:00:00.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/debian/urfkill.service.in 2015-03-24 13:09:43.000000000 +0000 @@ -0,0 +1,10 @@ +[Unit] +Description=killswitch manager +Documentation=man:urfkill(7) man:urfkilld(8) + +[Service] +ExecStart=/usr/lib/@DEB_HOST_MULTIARCH@/urfkill/urfkilld +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-arbitrator.c urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-arbitrator.c --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-arbitrator.c 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-arbitrator.c 2015-03-18 14:38:28.000000000 +0000 @@ -435,9 +435,12 @@ g_return_val_if_fail (URF_IS_ARBITRATOR (arbitrator), FALSE); g_return_val_if_fail (URF_IS_DEVICE (device), FALSE); + index = urf_device_get_index (device); + if (urf_arbitrator_find_device (arbitrator, index) != NULL) + return FALSE; + priv = arbitrator->priv; type = urf_device_get_device_type (device); - index = urf_device_get_index (device); soft = urf_device_is_software_blocked (device); priv->devices = g_list_append (priv->devices, device); @@ -472,21 +475,31 @@ gboolean urf_arbitrator_remove_device (UrfArbitrator *arbitrator, UrfDevice *device) { - gint type; + gint type, index; + gchar *object_path; g_return_val_if_fail (URF_IS_ARBITRATOR (arbitrator), FALSE); g_return_val_if_fail (URF_IS_DEVICE (device), FALSE); + index = urf_device_get_index (device); + if (urf_arbitrator_find_device (arbitrator, index) == NULL) + return FALSE; + type = urf_device_get_device_type (device); g_return_val_if_fail (type >= 0, FALSE); arbitrator->priv->devices = g_list_remove (arbitrator->priv->devices, device); + /* killswitch_del_device unrefs the device, so we make a copy of the path */ + object_path = g_strdup (urf_device_get_object_path (device)); + urf_killswitch_del_device (arbitrator->priv->killswitch[type], device); g_signal_emit (G_OBJECT (arbitrator), signals[DEVICE_REMOVED], 0, - urf_device_get_object_path (device)); + object_path); + + g_free (object_path); return TRUE; } diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-config.c urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-config.c --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-config.c 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-config.c 2015-03-18 14:38:28.000000000 +0000 @@ -41,6 +41,7 @@ OPT_MASTER_KEY, OPT_FORCE_SYNC, OPT_PERSIST, + OPT_STRICT_FLIGHT_MODE, OPT_UNKNOWN, }; @@ -73,6 +74,7 @@ gboolean master_key; gboolean force_sync; gboolean persist; + gboolean strict_flight_mode; } Options; typedef struct { @@ -107,6 +109,8 @@ return OPT_FORCE_SYNC; else if (g_strcmp0 (option, "persist") == 0) return OPT_PERSIST; + else if (g_strcmp0 (option, "strict_flight_mode") == 0) + return OPT_STRICT_FLIGHT_MODE; return OPT_UNKNOWN; } @@ -323,6 +327,12 @@ else if (g_ascii_strcasecmp (str, "FALSE") == 0) info->options.persist = FALSE; break; + case OPT_STRICT_FLIGHT_MODE: + if (g_ascii_strcasecmp (str, "TRUE") == 0) + info->options.strict_flight_mode = TRUE; + else if (g_ascii_strcasecmp (str, "FALSE") == 0) + info->options.strict_flight_mode = FALSE; + break; default: break; } @@ -434,6 +444,7 @@ info->options.master_key = options->master_key; info->options.force_sync = options->force_sync; info->options.persist = options->persist; + info->options.strict_flight_mode = options->strict_flight_mode; parser = XML_ParserCreate (NULL); XML_SetUserData (parser, (void *)info); @@ -457,6 +468,7 @@ options->master_key = info->options.master_key; options->force_sync = info->options.force_sync; options->persist = info->options.persist; + options->strict_flight_mode = info->options.strict_flight_mode; g_free (info); return TRUE; @@ -513,6 +525,13 @@ g_error_free (error); error = NULL; + ret = g_key_file_get_boolean (profile, "Profile", "strict_flight_mode", &error); + if (!error) + priv->options.strict_flight_mode = ret; + else + g_error_free (error); + error = NULL; + g_key_file_free (profile); return TRUE; @@ -558,6 +577,10 @@ g_key_file_set_value (profile, "Profile", "persist", value?"true":"false"); + value = priv->options.strict_flight_mode; + g_key_file_set_value (profile, "Profile", "strict_flight_mode", + value?"true":"false"); + content = g_key_file_to_data (profile, NULL, NULL); g_key_file_free (profile); @@ -617,6 +640,7 @@ options->master_key = priv->options.master_key; options->force_sync = priv->options.force_sync; options->persist = priv->options.persist; + options->strict_flight_mode = priv->options.strict_flight_mode; profile_dir = g_dir_open (URFKILL_PROFILE_DIR, 0, NULL); while ((file = g_dir_read_name (profile_dir))) { @@ -649,6 +673,7 @@ priv->options.master_key = options->master_key; priv->options.force_sync = options->force_sync; priv->options.persist = options->persist; + priv->options.strict_flight_mode = options->strict_flight_mode; save_configured_profile (config); @@ -709,6 +734,13 @@ g_error_free (error); error = NULL; + ret = g_key_file_get_boolean (key_file, "general", "strict_flight_mode", &error); + if (!error) + priv->options.strict_flight_mode = ret; + else + g_error_free (error); + error = NULL; + g_key_file_free (key_file); } @@ -758,6 +790,15 @@ } /** + * urf_config_get_strict_flight_mode: + **/ +gboolean +urf_config_get_strict_flight_mode (UrfConfig *config) +{ + return config->priv->options.strict_flight_mode; +} + +/** * urf_persist_get_persist_state: **/ gboolean @@ -767,20 +808,26 @@ UrfConfigPrivate *priv = URF_CONFIG_GET_PRIVATE (config); gboolean state = FALSE; GError *error = NULL; + gint end_type; - g_return_val_if_fail (type >= 0, FALSE); + if (type == RFKILL_TYPE_WWAN && urf_config_get_strict_flight_mode (config)) + end_type = RFKILL_TYPE_ALL; + else + end_type = type; - state = g_key_file_get_boolean (priv->persistence_file, type_to_string (type), "soft", &error); + g_return_val_if_fail (end_type >= 0, FALSE); + + state = g_key_file_get_boolean (priv->persistence_file, type_to_string (end_type), "soft", &error); if (error) { /* Debug only; there can be devices disappearing when some killswitches * are triggered. */ - g_debug ("Could not get state for device %s: %s", type_to_string (type), error->message); + g_debug ("Could not get state for device %s: %s", type_to_string (end_type), error->message); g_error_free (error); } - g_debug ("saved state for device %s: %s", type_to_string (type), state ? "blocked" : "unblocked"); + g_debug ("saved state for device %s: %s", type_to_string (end_type), state ? "blocked" : "unblocked"); return state; } @@ -794,6 +841,10 @@ GError *error = NULL; g_return_val_if_fail (type >= 0, FALSE); + + if (type == RFKILL_TYPE_WWAN && urf_config_get_strict_flight_mode (config)) + return state; + state = g_key_file_get_boolean (priv->persistence_file, type_to_string (type), "prev-soft", &error); if (error) { @@ -847,6 +898,10 @@ g_return_if_fail (type >= 0); + /* For WWAN/strict FM, state saved when FM is successfully set */ + if (type == RFKILL_TYPE_WWAN && urf_config_get_strict_flight_mode (config)) + return; + g_debug ("setting state for device %s: %s", type_to_string (type), state > 0 ? "blocked" : "unblocked"); g_key_file_set_boolean (priv->persistence_file, type_to_string (type), "soft", state > 0); @@ -862,6 +917,9 @@ UrfConfigPrivate *priv = URF_CONFIG_GET_PRIVATE (config); g_return_if_fail (type >= 0); + + if (type == RFKILL_TYPE_WWAN && urf_config_get_strict_flight_mode (config)) + return; g_debug ("setting state for device %s: %s", type_to_string (type), block ? "blocked" : "unblocked"); @@ -899,6 +957,7 @@ priv->options.master_key = FALSE; priv->options.force_sync = FALSE; priv->options.persist = TRUE; + priv->options.strict_flight_mode = TRUE; config->priv = priv; urf_config_get_persistence_file (config); diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-config.h urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-config.h --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-config.h 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-config.h 2015-03-18 14:38:28.000000000 +0000 @@ -62,6 +62,7 @@ gboolean urf_config_get_master_key (UrfConfig *config); gboolean urf_config_get_force_sync (UrfConfig *config); gboolean urf_config_get_persist (UrfConfig *config); +gboolean urf_config_get_strict_flight_mode (UrfConfig *config); gboolean urf_config_get_persist_state (UrfConfig *config, const gint type); diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-device-ofono.c urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-device-ofono.c --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-device-ofono.c 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-device-ofono.c 2015-03-18 14:38:28.000000000 +0000 @@ -53,6 +53,13 @@ PROP_LAST }; +enum { + SIGNAL_POWERED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + #define URF_DEVICE_OFONO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ URF_TYPE_DEVICE_OFONO, UrfDeviceOfonoPrivate)) @@ -65,8 +72,8 @@ gboolean soft; GDBusProxy *proxy; - GCancellable *cancellable; GTask *pending_block_task; + gboolean pending_set_online_cb; }; G_DEFINE_TYPE_WITH_PRIVATE (UrfDeviceOfono, urf_device_ofono, URF_TYPE_DEVICE) @@ -185,12 +192,18 @@ GAsyncResult *res, gpointer user_data) { - UrfDeviceOfono *modem = URF_DEVICE_OFONO (user_data); - UrfDeviceOfonoPrivate *priv = URF_DEVICE_OFONO_GET_PRIVATE (modem); + UrfDeviceOfono *modem; + UrfDeviceOfonoPrivate *priv; GVariant *result; GError *error = NULL; gint code = 0; + g_return_if_fail (URF_IS_DEVICE_OFONO (user_data)); + + modem = URF_DEVICE_OFONO (user_data); + priv = URF_DEVICE_OFONO_GET_PRIVATE (modem); + + priv->pending_set_online_cb = FALSE; result = g_dbus_proxy_call_finish (priv->proxy, res, &error); if (error == NULL) { @@ -221,6 +234,8 @@ priv->pending_block_task = NULL; } } + + g_object_unref (modem); } /** @@ -232,6 +247,17 @@ UrfDeviceOfono *modem = URF_DEVICE_OFONO (device); UrfDeviceOfonoPrivate *priv = URF_DEVICE_OFONO_GET_PRIVATE (modem); + if (priv->pending_set_online_cb) { + g_message ("%s: pending callback, not setting WWAN", __func__); + if (task) + g_task_return_new_error (task, URF_DAEMON_ERROR, + URF_DAEMON_ERROR_IN_PROGRESS, + "%s: waiting for ofono response %s", + __func__, + urf_device_get_object_path (URF_DEVICE (modem))); + return; + } + if (priv->proxy != NULL) { g_message ("%s: Setting WWAN to %s", __func__, @@ -239,7 +265,11 @@ priv->soft = blocked; priv->pending_block_task = task; + priv->pending_set_online_cb = TRUE; + /* We increment the ref count of the object to make sure the + * object exists when callback is invoked. + */ g_dbus_proxy_call (priv->proxy, "SetProperty", g_variant_new ("(sv)", @@ -247,9 +277,9 @@ g_variant_new_boolean (!blocked)), G_DBUS_CALL_FLAGS_NONE, -1, - priv->cancellable, + NULL, (GAsyncReadyCallback) set_online_cb, - modem); + g_object_ref (device)); } else { g_warning ("%s: proxy not ready yet", __func__); } @@ -272,6 +302,35 @@ } static void +update_powered (UrfDeviceOfono *modem, gboolean powered_new) +{ + UrfDeviceOfonoPrivate *priv = URF_DEVICE_OFONO_GET_PRIVATE (modem); + GVariant *var_powered; + gboolean powered; + + var_powered = g_hash_table_lookup (priv->properties, "Powered"); + if (var_powered == NULL) { + if (powered_new) { + g_message ("%s: creating %s", __func__, + priv->modem_path); + g_signal_emit (G_OBJECT (modem), + signals[SIGNAL_POWERED], 0, powered_new); + } + return; + } + + powered = g_variant_get_boolean (var_powered); + + if (powered == powered_new) + return; + + g_message ("%s: %s powered=%d", __func__, priv->modem_path, powered_new); + + g_signal_emit (G_OBJECT (modem), signals[SIGNAL_POWERED], 0, + powered_new); +} + +static void modem_signal_cb (GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, @@ -292,6 +351,12 @@ g_variant_get_child (parameters, 0, "s", &prop_name); g_variant_get_child (parameters, 1, "v", &prop_value); + if (g_strcmp0 ("Powered", prop_name) == 0) { + gboolean powered = g_variant_get_boolean (prop_value); + + update_powered (modem, powered); + } + if (prop_value) g_hash_table_replace (priv->properties, g_strdup (prop_name), @@ -301,17 +366,6 @@ g_signal_emit_by_name(G_OBJECT (modem), "state-changed", 0); } - if (g_strcmp0 ("Powered", prop_name) == 0) { - gboolean powered = FALSE; - - powered = g_variant_get_boolean (prop_value); - - if (powered) { - g_message("%s: calling set_soft block: %u", __func__, priv->soft); - set_soft (URF_DEVICE (modem), priv->soft, NULL); - } - } - g_free (prop_name); g_variant_unref (prop_value); } @@ -339,9 +393,10 @@ g_variant_iter_init (&iter, properties); while (g_variant_iter_next (&iter, "{sv}", &key, &variant)) { - if (g_strcmp0 ("Powered", key) == 0 && - g_variant_get_boolean (variant) == TRUE) { - set_soft (URF_DEVICE (modem), priv->soft, NULL); + if (g_strcmp0 ("Powered", key) == 0 ) { + gboolean powered = g_variant_get_boolean (variant); + + update_powered (modem, powered); } g_hash_table_insert (priv->properties, g_strdup (key), @@ -358,6 +413,8 @@ g_warning ("Error getting properties: %s", error ? error->message : "(unknown error)"); } + + g_object_unref (modem); } /** @@ -429,6 +486,13 @@ priv->modem_path = NULL; } + if (priv->name) { + g_free (priv->name); + priv->name = NULL; + } + + g_hash_table_unref (priv->properties); + G_OBJECT_CLASS(urf_device_ofono_parent_class)->dispose(object); } @@ -440,10 +504,10 @@ { UrfDeviceOfonoPrivate *priv = URF_DEVICE_OFONO_GET_PRIVATE (device); - priv->cancellable = g_cancellable_new (); priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); priv->soft = FALSE; + priv->pending_set_online_cb = FALSE; } /** @@ -477,6 +541,15 @@ g_object_class_install_property (object_class, PROP_SOFT, pspec); + + signals[SIGNAL_POWERED] = + g_signal_new ("ofono-device-powered", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (UrfDeviceOfonoClass, device_powered), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); } static GVariant * @@ -545,20 +618,23 @@ "org.ofono", object_path, "org.ofono.Modem", - priv->cancellable, + NULL, &error); if (error == NULL) { - g_cancellable_reset (priv->cancellable); g_signal_connect (priv->proxy, "g-signal", G_CALLBACK (modem_signal_cb), device); + + /* We increment the ref count of the object to make sure the + * object exists when callback is invoked. + */ g_dbus_proxy_call (priv->proxy, "GetProperties", NULL, G_DBUS_CALL_FLAGS_NONE, -1, - priv->cancellable, + NULL, (GAsyncReadyCallback) get_properties_cb, - device); + g_object_ref (device)); } else { g_warning ("Could not get oFono Modem proxy: %s", error ? error->message : "(unknown error)"); @@ -566,4 +642,3 @@ return URF_DEVICE (device); } - diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-device-ofono.h urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-device-ofono.h --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-device-ofono.h 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-device-ofono.h 2015-03-18 14:38:28.000000000 +0000 @@ -47,6 +47,9 @@ typedef struct { UrfDeviceClass parent; + + void (*device_powered) (UrfDeviceOfono *device, + gboolean powered); } UrfDeviceOfonoClass; diff -Nru urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-ofono-manager.c urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-ofono-manager.c --- urfkill-0.6.0~20141020.151220.1dc6cf4~rtm/src/urf-ofono-manager.c 2014-10-20 19:12:20.000000000 +0000 +++ urfkill-0.6.0~20150318.103828.5539c0d.1~rtm/src/urf-ofono-manager.c 2015-03-18 14:38:28.000000000 +0000 @@ -98,6 +98,17 @@ } static void +device_powered_cb (UrfDevice *device, gboolean powered, gpointer user_data) +{ + UrfOfonoManager *ofono = user_data; + + if (powered) + urf_arbitrator_add_device (ofono->arbitrator, device); + else + urf_arbitrator_remove_device (ofono->arbitrator, device); +} + +static void urf_ofono_manager_add_modem (UrfOfonoManager *ofono, const char *object_path) { @@ -114,12 +125,13 @@ device = urf_device_ofono_new (modem_idx, object_path); modem_idx++; + g_signal_connect (device, "ofono-device-powered", + G_CALLBACK (device_powered_cb), ofono); + /* Keep our own list to avoid the overhead of iterating through all * devices when we need to remove a modem */ ofono->devices = g_slist_append (ofono->devices, device); - - urf_arbitrator_add_device (ofono->arbitrator, device); } static void @@ -143,10 +155,10 @@ g_debug ("Remove all modems"); while (ofono->devices) { - UrfDevice *dev = ofono->devices->data; + UrfDeviceOfono *dev = ofono->devices->data; ofono->devices = g_slist_delete_link (ofono->devices, ofono->devices); - urf_arbitrator_remove_device (ofono->arbitrator, dev); + urf_arbitrator_remove_device (ofono->arbitrator, URF_DEVICE (dev)); g_object_unref (dev); } } @@ -158,7 +170,8 @@ { UrfOfonoManager *ofono = user_data; GVariant *value, *modems; - GVariantIter iter, dict_iter; + GVariantIter iter; + GVariantIter *dict_iter; gchar *modem_path; GError *error = NULL; @@ -194,18 +207,20 @@ gpointer user_data) { UrfOfonoManager *ofono = user_data; - const char *object_path; + gchar *object_path; if (g_strcmp0 (signal_name, "ModemAdded") == 0) { g_variant_get (parameters, "(oa{sv})", &object_path, NULL); g_debug ("ModemAdded signal %s", object_path); urf_ofono_manager_add_modem (ofono, object_path); + g_free (object_path); } else if (g_strcmp0 (signal_name, "ModemRemoved") == 0) { g_variant_get (parameters, "(o)", &object_path); g_debug ("ModemRemoved signal %s", object_path); urf_ofono_manager_remove_modem (ofono, object_path); + g_free (object_path); } }