Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03821046 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Synchronize the removal of the addresses

Test: m com.android.btservices
Bug: 297328586
Flag: EXEMPT No logical change, access to these objects guarded similarly in all other places
Change-Id: Ifb89d5175d54d15410659af056d1cc389de6dbf0
parent 4d8ce598
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1134,6 +1134,7 @@ public class RemoteDevices {
                        Utils.getTempAllowlistBroadcastOptions());
            } else if (device.getBondState() == BluetoothDevice.BOND_NONE) {
                String key = Utils.getAddressStringFromByte(address);
                synchronized (mDevices) {
                    mDevices.remove(key);
                    mDeviceQueue.remove(key); // Remove from LRU cache

@@ -1141,6 +1142,7 @@ public class RemoteDevices {
                    mDualDevicesMap.values().remove(key);
                    mDualDevicesMap.remove(key);
                }
            }
            if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) {
                intent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED);
                intent.putExtra(BluetoothDevice.EXTRA_TRANSPORT, transportLinkType);