Fix service loading and add provision callbacks
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 22 Dec 2009 08:29:05 +0000 (00:29 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 22 Dec 2009 08:29:05 +0000 (00:29 -0800)
src/config.c
src/connman.h
src/service.c

index f22d5178833155fa4f3d78299dc70285ecb6d940..cf8e42aa1c6b3a4cefcc8db0920d9e45a0a07073 100644 (file)
@@ -166,3 +166,10 @@ void __connman_config_cleanup(void)
        g_hash_table_destroy(config_hash);
        config_hash = NULL;
 }
+
+int __connman_config_provision_service(struct connman_service *service)
+{
+       DBG("service %p", service);
+
+       return 0;
+}
index c4020b1ef521db44f401cc1965096b7fc3aca315..6a36331c989d5aaeb519b1f785493c92a4a96ac7 100644 (file)
@@ -331,6 +331,8 @@ connman_bool_t __connman_network_get_connecting(struct connman_network *network)
 int __connman_config_init();
 void __connman_config_cleanup(void);
 
+int __connman_config_provision_service(struct connman_service *service);
+
 #include <connman/profile.h>
 
 int __connman_profile_init();
index 34c4e4796773fed9578aedad19c630d273a864f2..3092f673cf041493b71a5af19fa5035828b7f590 100644 (file)
@@ -1867,8 +1867,6 @@ static struct connman_service *__connman_service_get(const char *identifier)
 
        service->profile = g_strdup(__connman_profile_active_ident());
 
-       __connman_storage_load_service(service);
-
        iter = g_sequence_insert_sorted(service_list, service,
                                                service_compare, NULL);
 
@@ -1891,13 +1889,15 @@ static int service_register(struct connman_service *service)
 
        DBG("path %s", service->path);
 
+       __connman_config_provision_service(service);
+
+       __connman_storage_load_service(service);
+
        g_dbus_register_interface(connection, service->path,
                                        CONNMAN_SERVICE_INTERFACE,
                                        service_methods, service_signals,
                                                        NULL, service, NULL);
 
-       __connman_storage_load_service(service);
-
        iter = g_hash_table_lookup(service_hash, service->identifier);
        if (iter != NULL)
                g_sequence_sort_changed(iter, service_compare, NULL);
@@ -1966,8 +1966,6 @@ static void setup_ipconfig(struct connman_service *service, int index)
        connman_ipconfig_set_method(service->ipconfig,
                                        CONNMAN_IPCONFIG_METHOD_DHCP);
 
-       __connman_storage_load_service(service);
-
        connman_ipconfig_set_data(service->ipconfig, service);
 
        connman_ipconfig_set_ops(service->ipconfig, &service_ops);
@@ -2245,8 +2243,6 @@ struct connman_service *__connman_service_create_from_network(struct connman_net
 
        service_register(service);
 
-       __connman_profile_changed(TRUE);
-
        if (service->favorite == TRUE)
                __connman_service_auto_connect();