Loading android/app/src/com/android/bluetooth/btservice/JniCallbacks.java +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.bluetooth.btservice; import android.bluetooth.OobData; import android.bluetooth.UidTraffic; import com.android.bluetooth.flags.Flags; class JniCallbacks { private RemoteDevices mRemoteDevices; Loading Loading @@ -66,6 +68,9 @@ class JniCallbacks { void bondStateChangeCallback(int status, byte[] address, int newState, int hciReason) { mBondStateMachine.bondStateChangeCallback(status, address, newState, hciReason); if (Flags.removeBondWithAddressMap()) { mRemoteDevices.onBondStateChange(address, newState); } } void addressConsolidateCallback(byte[] mainAddress, byte[] secondaryAddress) { Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +19 −9 Original line number Diff line number Diff line Loading @@ -1155,15 +1155,7 @@ public class RemoteDevices { Utils.sendBroadcast(mAdapterService, intent, BLUETOOTH_CONNECT, 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 // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); } removeAddressMapping(address); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { mAdapterService.notifyAclDisconnected(device, transportLinkType); Loading Loading @@ -1246,6 +1238,24 @@ public class RemoteDevices { } } private void removeAddressMapping(byte[] address) { String key = Utils.getAddressStringFromByte(address); synchronized (mDevices) { mDevices.remove(key); mDeviceQueue.remove(key); // Remove from LRU cache // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); } } void onBondStateChange(byte[] address, int newState) { if (newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); } } void keyMissingCallback(byte[] address) { BluetoothDevice bluetoothDevice = getDevice(address); if (bluetoothDevice == null) { Loading Loading
android/app/src/com/android/bluetooth/btservice/JniCallbacks.java +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.bluetooth.btservice; import android.bluetooth.OobData; import android.bluetooth.UidTraffic; import com.android.bluetooth.flags.Flags; class JniCallbacks { private RemoteDevices mRemoteDevices; Loading Loading @@ -66,6 +68,9 @@ class JniCallbacks { void bondStateChangeCallback(int status, byte[] address, int newState, int hciReason) { mBondStateMachine.bondStateChangeCallback(status, address, newState, hciReason); if (Flags.removeBondWithAddressMap()) { mRemoteDevices.onBondStateChange(address, newState); } } void addressConsolidateCallback(byte[] mainAddress, byte[] secondaryAddress) { Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +19 −9 Original line number Diff line number Diff line Loading @@ -1155,15 +1155,7 @@ public class RemoteDevices { Utils.sendBroadcast(mAdapterService, intent, BLUETOOTH_CONNECT, 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 // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); } removeAddressMapping(address); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { mAdapterService.notifyAclDisconnected(device, transportLinkType); Loading Loading @@ -1246,6 +1238,24 @@ public class RemoteDevices { } } private void removeAddressMapping(byte[] address) { String key = Utils.getAddressStringFromByte(address); synchronized (mDevices) { mDevices.remove(key); mDeviceQueue.remove(key); // Remove from LRU cache // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); } } void onBondStateChange(byte[] address, int newState) { if (newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); } } void keyMissingCallback(byte[] address) { BluetoothDevice bluetoothDevice = getDevice(address); if (bluetoothDevice == null) { Loading