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

Commit 0a333620 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

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

Merge "Synchronize the address mapping and LRU cache of the bonded devices" into main am: f4209007 am: 218686fa

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2768571



Change-Id: I17a60dbfb23a4e8245f9d1940be4dcfea6e50bbb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 553d3bbf 218686fa
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);