Send power off before DeviceDetected signal 77/303677/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 3 Jan 2024 09:25:09 +0000 (18:25 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 3 Jan 2024 09:25:09 +0000 (18:25 +0900)
When the wifi module is removed,
the removed device detected signal is sent before the power off signal,
so there are cases where the power off signal is ignored
on the receiving side.

To solve this issue,
it has been modified to send the power off signal first.

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

index 127dea9..c789839 100755 (executable)
@@ -95,6 +95,8 @@ const char *connman_techonology_get_path(enum connman_service_type type);
 void __connman_technology_notify_scan_done(const char *ifname, int val);
 void __connman_technology_append_interfaces(DBusMessageIter *array,
                                enum connman_service_type type, const char *ifname);
+void __connman_technology_notify_device_detected_by_device(
+               struct connman_device *device, const char *ifname, bool val);
 void __connman_technology_notify_roaming_state(const char *ifname,
                const char *state, const char *cur_bssid, const char *dst_bssid);
 #endif
index 1e3924b..9189f68 100755 (executable)
@@ -388,6 +388,10 @@ static void remove_device(struct connman_device *device)
        if (device->driver->remove)
                device->driver->remove(device);
 
+#if defined TIZEN_EXT
+       __connman_technology_notify_device_detected_by_device(device, "", false);
+#endif
+
        device->driver = NULL;
 }
 
index 4cc540b..d21d790 100644 (file)
@@ -1715,6 +1715,19 @@ static void __connman_technology_notify_device_detected(
        DBG("Successfuly sent DeviceDetected signal");
 }
 
+void __connman_technology_notify_device_detected_by_device(
+               struct connman_device *device, const char *ifname, bool val)
+{
+       struct connman_technology *technology;
+       enum connman_service_type type;
+
+       type = __connman_device_get_service_type(device);
+
+       technology = technology_find(type);
+       if (technology)
+               __connman_technology_notify_device_detected(technology, ifname, val);
+}
+
 void __connman_technology_notify_roaming_state(const char *ifname,
                const char *state, const char *cur_bssid, const char *dst_bssid)
 {
@@ -3002,7 +3015,9 @@ static void technology_put(struct connman_technology *technology)
                        g_slist_delete_link(technology->driver_list,
                                        technology->driver_list);
        }
-
+#ifdef TIZEN_EXT
+       __connman_technology_notify_device_detected(technology, "", false);
+#endif
        technology_list = g_slist_remove(technology_list, technology);
 
        technology_dbus_unregister(technology);
@@ -3422,9 +3437,6 @@ int __connman_technology_remove_device(struct connman_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
 
        if (technology->tethering)