The order between the device signal and the service signal has been changed 73/244273/1 accepted/tizen/unified/20200921.095121 submit/tizen/20200917.115639 submit/tizen/20200918.062939
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 16 Sep 2020 13:39:40 +0000 (22:39 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 16 Sep 2020 13:39:40 +0000 (22:39 +0900)
Net-config is implemented assuming that the DeviceChanged signal comes before the service PropertyChanged signal.
Therefore, the event order has been adjusted accordingly.

Change-Id: I134ec7152a0e40bbfe317c704a91ca81fc01dc1c
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/service.c

index da60efc..66f6d5a 100755 (executable)
@@ -8727,6 +8727,14 @@ static int service_indicate_state(struct connman_service *service)
                searchdomain_remove_all(service);
 
        service->state = new_state;
+#if defined TIZEN_EXT
+       if (!is_connected(old_state) && is_connected(new_state))
+               connman_device_send_connected_signal(
+                               connman_network_get_device(service->network), true);
+       else if (is_connected(old_state) && !is_connected(new_state))
+               connman_device_send_connected_signal(
+                               connman_network_get_device(service->network), false);
+#endif
        state_changed(service);
 
        if (!is_connected(old_state) && is_connected(new_state))
@@ -8831,10 +8839,6 @@ static int service_indicate_state(struct connman_service *service)
 #if defined TIZEN_EXT
                if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
                        set_priority_connected_service();
-
-               if (!is_connected(old_state))
-                       connman_device_send_connected_signal(
-                                       connman_network_get_device(service->network), true);
 #endif
 
                break;
@@ -8926,10 +8930,6 @@ static int service_indicate_state(struct connman_service *service)
                (old_state == CONNMAN_SERVICE_STATE_READY &&
                        new_state != CONNMAN_SERVICE_STATE_ONLINE)) {
                __connman_notifier_disconnect(service->type);
-#if defined TIZEN_EXT
-               connman_device_send_connected_signal(
-                               connman_network_get_device(service->network), false);
-#endif
        }
 
        if (new_state == CONNMAN_SERVICE_STATE_ONLINE) {