Fix incorrect handling in multi-interface environment
[platform/upstream/connman.git] / src / technology.c
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