summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorYouwan Wang <wangyouwan@uniontech.com>2022-06-23 14:29:53 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-06-23 16:25:54 -0700
commit65f7faf5a3d0dcd63c14467a3a2bda317287e330 (patch)
treecab31a49adbe319ef7c978f8aab96837c71dc894 /src/device.c
parente3c92f1f786f0b55440bd908b55894d0c792cf0e (diff)
downloadbluez-65f7faf5a3d0dcd63c14467a3a2bda317287e330.tar.gz
device: Fix not removing connected device
[bluetooth]# connect 40:EF:4C:0C:11:F0 Attempting to connect to 40:EF:4C:0C:11:F0 [CHG] Device 40:EF:4C:0C:11:F0 Connected: yes Connection successful [CHG] Device 40:EF:4C:0C:11:F0 ServicesResolved: yes [UFO]# remove 40:EF:4C:0C:11:F0 [CHG] Device 40:EF:4C:0C:11:F0 ServicesResolved: no Device has been removed [CHG] Device 40:EF:4C:0C:11:F0 Connected: no [bluetooth]# info 40:EF:4C:0C:11:F0 Device 40:EF:4C:0C:11:F0 (public) Name: UFO Alias: UFO Class: 0x00240418 Icon: audio-headphones Paired: yes Trusted: no Blocked: no Connected: no LegacyPairing: no UUID: Headset UUID: Audio Sink UUID: A/V Remote Control Target UUID: A/V Remote Control UUID: Handsfree UUID: Phonebook Access Server
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c
index 7b451e458..c5484ca7b 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3073,7 +3073,8 @@ static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
dev, NULL);
}
-void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
+void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type,
+ bool *remove)
{
struct bearer_state *state = get_state(device, bdaddr_type);
DBusMessage *reply;
@@ -3159,7 +3160,7 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
DEVICE_INTERFACE, "Connected");
if (remove_device)
- set_temporary_timer(device, 0);
+ *remove = remove_device;
}
guint device_add_disconnect_watch(struct btd_device *device,