From 688ac80683ad821a126c2f612815475bc6896fb5 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Fri, 15 Oct 2021 20:59:35 +0900 Subject: [PATCH] Fix incorrect handling in multi-interface environment 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 --- src/device.c | 1 - src/technology.c | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 377ef47..5350282 100755 --- a/src/device.c +++ b/src/device.c @@ -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) { diff --git a/src/technology.c b/src/technology.c index 4255051..6a539dc 100644 --- a/src/technology.c +++ b/src/technology.c @@ -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 -- 2.7.4