diff options
author | Nishant Chaprana <n.chaprana@samsung.com> | 2020-11-02 16:35:11 +0530 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-11-16 12:40:13 +0900 |
commit | 227f5cb0e8b80dac7f536fc974d95d3ab0170665 (patch) | |
tree | c852cd7142475de7c92df3ab27d79e34d77a328d | |
parent | 128d681187e15d81ac0f68abc9acce8db579aa46 (diff) | |
download | connman-227f5cb0e8b80dac7f536fc974d95d3ab0170665.tar.gz connman-227f5cb0e8b80dac7f536fc974d95d3ab0170665.tar.bz2 connman-227f5cb0e8b80dac7f536fc974d95d3ab0170665.zip |
Emit StateChangedProperties post emitting service state's PropertyChanged
wifi-manager and libnet-client can use this signal instead of
[PropertyChanged(state) signal + GetProperties call] combination
for updating service information.
Change-Id: I0203cb7df202ff3767a2c4d25e8ca685e4eb8ba8
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
-rw-r--r-- | packaging/connman.spec | 2 | ||||
-rwxr-xr-x | src/service.c | 38 |
2 files changed, 36 insertions, 4 deletions
diff --git a/packaging/connman.spec b/packaging/connman.spec index 56cf4063..072e8bf1 100644 --- a/packaging/connman.spec +++ b/packaging/connman.spec @@ -5,7 +5,7 @@ Name: connman Version: 1.37 -Release: 48 +Release: 49 License: GPL-2.0+ Summary: Connection Manager Url: http://connman.net diff --git a/src/service.c b/src/service.c index 25bd2334..dd4f1919 100755 --- a/src/service.c +++ b/src/service.c @@ -2969,6 +2969,31 @@ static void default_changed(void) __connman_notifier_default_changed(service); } +#if defined TIZEN_EXT +static void append_struct(gpointer value, gpointer user_data); + +static void emit_state_changed_with_properties(struct connman_service *service) +{ + DBusMessage *signal; + DBusMessageIter iter; + + if (!service) + return; + + signal = dbus_message_new_signal(service->path, CONNMAN_SERVICE_INTERFACE, + "StateChangedProperties"); + if (!signal) + return; + + dbus_message_iter_init_append(signal, &iter); + append_struct(service, &iter); + + g_dbus_send_message(connection, signal); + + return; +} +#endif + static void state_changed(struct connman_service *service) { const char *str; @@ -2982,14 +3007,17 @@ static void state_changed(struct connman_service *service) #if !defined TIZEN_EXT if (!allow_property_changed(service)) return; - -#endif -#if defined TIZEN_EXT +#else DBG(" %s, %s", str, service->path); #endif + connman_dbus_property_changed_basic(service->path, CONNMAN_SERVICE_INTERFACE, "State", DBUS_TYPE_STRING, &str); + +#if defined TIZEN_EXT + emit_state_changed_with_properties(service); +#endif } #if defined TIZEN_EXT @@ -7350,6 +7378,10 @@ static const GDBusMethodTable service_methods[] = { static const GDBusSignalTable service_signals[] = { { GDBUS_SIGNAL("PropertyChanged", GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, +#if defined TIZEN_EXT + { GDBUS_SIGNAL("StateChangedProperties", + GDBUS_ARGS({ "properties", "a{sv}" })) }, +#endif { }, }; |