From 5fceb46294254b416f0d67e276a75c8626e764a7 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 7 Mar 2023 16:47:33 -0800 Subject: [PATCH] device: Fix not always storing device info When updating the device address check if the device is marked as temporary before attempting to call store_device_info otherwise it will have no effect and instead btd_device_set_temporary must be called. --- src/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index d8198e0..72b6686 100644 --- a/src/device.c +++ b/src/device.c @@ -6776,7 +6776,10 @@ void device_update_addr(struct btd_device *device, const bdaddr_t *bdaddr, bacpy(&device->bdaddr, bdaddr); device->bdaddr_type = bdaddr_type; - store_device_info(device); + if (device->temporary) + btd_device_set_temporary(device, false); + else + store_device_info(device); g_dbus_emit_property_changed(dbus_conn, device->path, DEVICE_INTERFACE, "Address"); -- 2.7.4