__connman_network_disconnect(service->network);
__connman_ipconfig_disable(service->ipconfig);
+ __connman_stats_service_unregister(service);
if (service->pending != NULL) {
DBusMessage *reply;
stats_stop(service);
__connman_storage_save_service(service);
- __connman_stats_service_unregister(service);
service->path = NULL;
__connman_service_disconnect(service);
}
- if (state == CONNMAN_SERVICE_STATE_CONFIGURATION)
+ if (state == CONNMAN_SERVICE_STATE_CONFIGURATION) {
+ if (__connman_stats_service_register(service) == 0) {
+ __connman_stats_get(service, FALSE,
+ &service->stats.data);
+ __connman_stats_get(service, TRUE,
+ &service->stats_roaming.data);
+ }
+
__connman_ipconfig_enable(service->ipconfig);
+ }
service->state = state;
state_changed(service);
break;
}
+ if (__connman_stats_service_register(service) == 0) {
+ __connman_stats_get(service, FALSE,
+ &service->stats.data);
+ __connman_stats_get(service, TRUE,
+ &service->stats_roaming.data);
+ }
+
__connman_ipconfig_enable(service->ipconfig);
err = __connman_network_connect(service->network);
if (err < 0) {
if (err != -EINPROGRESS) {
__connman_ipconfig_disable(service->ipconfig);
+ __connman_stats_service_unregister(service);
return err;
}
__connman_ipconfig_clear_address(ipv6config);
__connman_ipconfig_disable(service->ipconfig);
+ __connman_stats_service_unregister(service);
if (err < 0) {
if (err != -EINPROGRESS)
__connman_storage_load_service(service);
- __connman_stats_service_register(service);
- __connman_stats_get(service, FALSE, &service->stats.data);
- __connman_stats_get(service, TRUE, &service->stats_roaming.data);
-
g_dbus_register_interface(connection, service->path,
CONNMAN_SERVICE_INTERFACE,
service_methods, service_signals,