When signalling the new device flags, we need to include the pending ones. Otherwise, the eventual non-zero `pending_flags` will be wiped out in `btd_device_flags_changed()`, and we'll lose the pending changed flags. Fixes https://github.com/bluez/bluez/issues/1076 --- src/adapter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 5d4117a49..cbc0f678f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -5727,6 +5727,7 @@ static void device_flags_changed_callback(uint16_t index, uint16_t length, struct btd_adapter *adapter = user_data; struct btd_device *dev; char addr[18]; + uint32_t changed_flags = 0; if (length < sizeof(*ev)) { btd_error(adapter->dev_id, @@ -5744,7 +5745,9 @@ static void device_flags_changed_callback(uint16_t index, uint16_t length, return; } - btd_device_flags_changed(dev, ev->supported_flags, ev->current_flags); + changed_flags = ev->current_flags | btd_device_get_pending_flags(dev); + + btd_device_flags_changed(dev, ev->supported_flags, changed_flags); } -- 2.48.1