Fix the error info is sent when removing paired devices 13/34113/1
authorwu zheng <wu.zheng@intel.com>
Wed, 21 Jan 2015 09:11:02 +0000 (17:11 +0800)
committerwu zheng <wu.zheng@intel.com>
Wed, 21 Jan 2015 09:11:02 +0000 (17:11 +0800)
Paired devices should not be added to list when searching.
When removing paired devices, if paired devices are in list,
the disappeared info is sent not remove device info.

Change-Id: I0f5b3c020b795723cce6e3a8bb3d20e29579203c
Signed-off-by: Wu Zheng <wu.zheng@intel.com>
bt-service/bt-service-event-receiver.c

index f0ae7a7..42aca3d 100644 (file)
@@ -1606,7 +1606,10 @@ static DBusHandlerResult __bt_manager_event_filter(DBusConnection *conn,
                                DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
                                &dev_info->uuids, dev_info->uuid_count,
                                DBUS_TYPE_INVALID);
-                       g_list = g_list_append(g_list, dev_info);
+                       if (!dev_info->paired)
+                               g_list = g_list_append(g_list, dev_info);
+                       else
+                               _bt_free_device_info(dev_info);
                } else if (bt_event == BT_MEDIA_TRANSFER_EVENT) {
                        __bt_parse_audio_properties(msg);
                }