Fix incorrect handling in multi-interface environment 71/265371/2
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 15 Oct 2021 11:59:35 +0000 (20:59 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 15 Oct 2021 12:00:51 +0000 (21:00 +0900)
1. Modified to save enabled device information
   in settings after device_list is updated.
2. Modified to save enabled device information
   in settings only for wifi technology.

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

index 377ef47..5350282 100755 (executable)
@@ -740,7 +740,6 @@ int connman_device_set_powered(struct connman_device *device,
 
 #if defined TIZEN_EXT
        device_send_changed(device->interface, type, "Powered", powered);
-       technology_save_device(device);
 #endif
 
        if (!device->powered) {
index 4255051..6a539dc 100644 (file)
@@ -2215,6 +2215,10 @@ void technology_save_device(struct connman_device *device)
        enum connman_service_type type;
 
        type = __connman_device_get_service_type(device);
+
+       if (type != CONNMAN_SERVICE_TYPE_WIFI)
+               return;
+
        technology = technology_get(type);
        if (!technology)
                return;
@@ -3220,7 +3224,7 @@ int __connman_technology_add_device(struct connman_device *device)
 #if defined TIZEN_EXT
                bool found = true;
                int err = 0;
-               if (technology->enabled_devices) {
+               if (technology->enabled_devices && type == CONNMAN_SERVICE_TYPE_WIFI) {
                        int i = 0;
                        found = false;
                        const char *ifname = connman_device_get_string(device, "Interface");
@@ -3257,6 +3261,8 @@ done:
                                                                device);
 
 #if defined TIZEN_EXT
+       technology_save_device(device);
+
        const char *ifname = connman_device_get_string(device, "Interface");
        __connman_technology_notify_device_detected(technology, ifname, true);
 
@@ -3287,6 +3293,8 @@ int __connman_technology_remove_device(struct connman_device *device)
                                                                device);
 
 #if defined TIZEN_EXT
+       technology_save_device(device);
+
        const char *ifname = connman_device_get_string(device, "Interface");
        __connman_technology_notify_device_detected(technology, ifname, false);
 #endif