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

Commit f4209007 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Synchronize the address mapping and LRU cache of the bonded devices" into main

parents 986c88fc 4d8ce598
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Predicate;
@@ -1151,6 +1153,11 @@ public class RemoteDevices {
            } else if (device.getBondState() == BluetoothDevice.BOND_NONE) {
                String key = Utils.getAddressStringFromByte(address);
                mDevices.remove(key);
                mDeviceQueue.remove(key); // Remove from LRU cache

                // Remove from dual mode device mappings
                mDualDevicesMap.values().remove(key);
                mDualDevicesMap.remove(key);
            }
            if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) {
                mAdapterService.notifyAclDisconnected(device, transportLinkType);