void __connman_notifier_service_add(struct connman_service *service,
const char *name);
void __connman_notifier_service_remove(struct connman_service *service);
-void __connman_notifier_online(enum connman_service_type type);
+void __connman_notifier_enter_online(enum connman_service_type type);
+void __connman_notifier_leave_online(enum connman_service_type type);
void __connman_notifier_connect(enum connman_service_type type);
-void __connman_notifier_disconnect(enum connman_service_type type,
- enum connman_service_state old_state);
+void __connman_notifier_disconnect(enum connman_service_type type);
void __connman_notifier_offlinemode(connman_bool_t enabled);
void __connman_notifier_default_changed(struct connman_service *service);
void __connman_notifier_proxy_changed(struct connman_service *service);
technology_connected(type, TRUE);
}
-void __connman_notifier_online(enum connman_service_type type)
+void __connman_notifier_enter_online(enum connman_service_type type)
{
DBG("type %d", type);
state_changed();
}
-void __connman_notifier_disconnect(enum connman_service_type type,
- enum connman_service_state old_state)
+void __connman_notifier_leave_online(enum connman_service_type type)
+{
+ DBG("type %d", type);
+
+ if (__sync_fetch_and_sub(&online[type], 1) == 1)
+ state_changed();
+}
+
+void __connman_notifier_disconnect(enum connman_service_type type)
{
DBG("type %d", type);
break;
}
- if (old_state == CONNMAN_SERVICE_STATE_ONLINE)
- __sync_fetch_and_sub(&online[type], 1);
-
if (__sync_fetch_and_sub(&connected[type], 1) != 1)
return;
__connman_service_auto_connect();
}
+ if (old_state == CONNMAN_SERVICE_STATE_ONLINE)
+ __connman_notifier_leave_online(service->type);
+
service->state = new_state;
state_changed(service);
dns_changed(service);
domain_changed(service);
- __connman_notifier_disconnect(service->type, old_state);
+ __connman_notifier_disconnect(service->type);
/*
* Previous services which are connected and which states
__connman_connection_update_gateway();
if (new_state == CONNMAN_SERVICE_STATE_ONLINE) {
- __connman_notifier_online(service->type);
+ __connman_notifier_enter_online(service->type);
default_changed();
}