[PATCH 2/2] service: Remove 'Services' property from Manager D-Bus API

Jukka Rissanen jukka.rissanen at linux.intel.com
Tue Feb 7 02:29:22 PST 2012


Hi Patrik,

comment below

On 02/07/2012 11:09 AM, patrik.flykt at linux.intel.com wrote:
> From: Patrik Flykt<patrik.flykt at linux.intel.com>
>
> Remove support functions and 'Services' property from Manager
> D-Bus API.
> ---
>   src/connman.h |    1 -
>   src/manager.c |    3 --
>   src/service.c |   70 ---------------------------------------------------------
>   3 files changed, 0 insertions(+), 74 deletions(-)
>
> diff --git a/src/connman.h b/src/connman.h
> index dcde0f3..6664ef6 100644
> --- a/src/connman.h
> +++ b/src/connman.h
> @@ -510,7 +510,6 @@ int __connman_provider_init(void);
>   int __connman_service_init(void);
>   void __connman_service_cleanup(void);
>
> -void __connman_service_list(DBusMessageIter *iter, void *user_data);
>   void __connman_service_list_struct(DBusMessageIter *iter);
>
>   struct connman_service *__connman_service_lookup_from_network(struct connman_network *network);
> diff --git a/src/manager.c b/src/manager.c
> index 7cf1eec..b59e2ca 100644
> --- a/src/manager.c
> +++ b/src/manager.c
> @@ -50,9 +50,6 @@ static DBusMessage *get_properties(DBusConnection *conn,
>
>   	connman_dbus_dict_open(&array,&dict);
>
> -	connman_dbus_dict_append_array(&dict, "Services",
> -			DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL);
> -
>   	str = __connman_notifier_get_state();
>   	connman_dbus_dict_append_basic(&dict, "State",
>   						DBUS_TYPE_STRING,&str);
> diff --git a/src/service.c b/src/service.c
> index d9bb8bc..f23d4f3 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -112,26 +112,6 @@ struct connman_service {
>   	int online_check_count;
>   };
>
> -static void append_path(gpointer value, gpointer user_data)
> -{
> -	struct connman_service *service = value;
> -	DBusMessageIter *iter = user_data;
> -
> -	if (service->path == NULL)
> -		return;
> -
> -	dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
> -							&service->path);
> -}
> -
> -void __connman_service_list(DBusMessageIter *iter, void *user_data)
> -{
> -	if (service_list == NULL)
> -		return;
> -
> -	g_sequence_foreach(service_list, append_path, iter);
> -}
> -
>   struct find_data {
>   	const char *path;
>   	struct connman_service *service;
> @@ -631,43 +611,6 @@ done:
>   	return err;
>   }
>
> -static guint changed_timeout = 0;
> -
> -static gboolean notify_services_changed(gpointer user_data)
> -{
> -	changed_timeout = 0;
> -
> -	connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
> -				CONNMAN_MANAGER_INTERFACE, "Services",
> -				DBUS_TYPE_OBJECT_PATH, __connman_service_list,
> -				NULL);
> -
> -	return FALSE;
> -}
> -
> -static void services_changed(gboolean delayed)
> -{
> -	DBG("");
> -
> -	if (changed_timeout>  0) {
> -		g_source_remove(changed_timeout);
> -		changed_timeout = 0;
> -	}
> -
> -	if (__connman_connection_update_gateway() == TRUE) {
> -		notify_services_changed(NULL);
> -		return;
> -	}

We need to call update_gateway() somewhere when services are changed, 
otherwise the gateways might not be updated properly.


> -
> -	if (delayed == FALSE) {
> -		notify_services_changed(NULL);
> -		return;
> -	}
> -
> -	changed_timeout = g_timeout_add_seconds(1, notify_services_changed,
> -								 NULL);
> -}
> -


Cheers,
Jukka



More information about the connman mailing list