Add missing signal for offline mode changes
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 19 Jul 2009 19:52:49 +0000 (21:52 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 19 Jul 2009 19:52:49 +0000 (21:52 +0200)
src/notifier.c

index 3ae9a0c..4f44ea4 100644 (file)
@@ -363,6 +363,31 @@ void __connman_notifier_disconnect(enum connman_service_type type)
                technology_connected(type, FALSE);
 }
 
+static void offline_mode_changed(dbus_bool_t enabled)
+{
+       DBusMessage *signal;
+       DBusMessageIter entry, value;
+       const char *key = "OfflineMode";
+
+       DBG("enabled %d", enabled);
+
+       signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
+                               CONNMAN_MANAGER_INTERFACE, "PropertyChanged");
+       if (signal == NULL)
+               return;
+
+       dbus_message_iter_init_append(signal, &entry);
+
+       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
+                                       DBUS_TYPE_BOOLEAN_AS_STRING, &value);
+       dbus_message_iter_append_basic(&value, DBUS_TYPE_BOOLEAN, &enabled);
+       dbus_message_iter_close_container(&entry, &value);
+
+       g_dbus_send_message(connection, signal);
+}
+
 void __connman_notifier_offline_mode(connman_bool_t enabled)
 {
        GSList *list;
@@ -371,6 +396,8 @@ void __connman_notifier_offline_mode(connman_bool_t enabled)
 
        __connman_profile_changed(FALSE);
 
+       offline_mode_changed(enabled);
+
        for (list = notifier_list; list; list = list->next) {
                struct connman_notifier *notifier = list->data;