summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2011-10-12 13:56:38 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-20 18:52:31 +0200
commit96dc543b4e23be2969db1295518c24317af572d1 (patch)
tree9449a65a20e869994a72ad37f28521f6faa445f9 /src
parent3276fc5f3743940177cfa112a7a90a61ac9547fe (diff)
downloadconnman-96dc543b4e23be2969db1295518c24317af572d1.tar.gz
connman-96dc543b4e23be2969db1295518c24317af572d1.tar.bz2
connman-96dc543b4e23be2969db1295518c24317af572d1.zip
notifier: Don't unnecessarily report "online" state on disconnect
When a service disconnects, don't send an extra 'online' net.connman.Manager.StateChanged signal if another service is still connected. Fixes BMC#23421
Diffstat (limited to 'src')
-rw-r--r--src/notifier.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/notifier.c b/src/notifier.c
index 722f9970..332bafb1 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -176,7 +176,7 @@ const char *__connman_notifier_get_state(void)
return "offline";
}
-static void state_changed(void)
+static void state_changed(connman_bool_t connected)
{
unsigned int count = __connman_notifier_count_connected();
char *state = "offline";
@@ -185,8 +185,12 @@ static void state_changed(void)
if (count > 1)
return;
- if (count > 0)
+ if (count == 1) {
+ if (connected == FALSE)
+ return;
+
state = "online";
+ }
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_MANAGER_INTERFACE, "State",
@@ -212,7 +216,7 @@ static void technology_connected(enum connman_service_type type,
CONNMAN_MANAGER_INTERFACE, "ConnectedTechnologies",
DBUS_TYPE_STRING, __connman_notifier_list_connected, NULL);
- state_changed();
+ state_changed(connected);
}
void __connman_notifier_register(enum connman_service_type type)