If there are already flags that are pending to be applied, we should keep them to avoid overwriting them. At that point we only want to add the Device Privacy Mode on top of the existing flags. --- src/adapter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 5d4117a49..d4e42eed8 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -5630,8 +5630,11 @@ static void add_device_complete(uint8_t status, uint16_t length, if (btd_opts.device_privacy) { uint32_t flags = btd_device_get_current_flags(dev); - /* Set Device Privacy Mode has not set the flag yet. */ + /* Set Device Privacy Mode if it has not set the flag yet. */ if (!(flags & DEVICE_FLAG_DEVICE_PRIVACY)) { + /* Include the pending flags, or they may get overwritten. */ + flags |= btd_device_get_pending_flags(dev); + adapter_set_device_flags(adapter, dev, flags | DEVICE_FLAG_DEVICE_PRIVACY, set_device_privacy_complete, -- 2.49.0