Loading android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +3 −0 Original line number Diff line number Diff line Loading @@ -489,6 +489,9 @@ final class BondStateMachine extends StateMachine { infoLog("Invalid bond state " + newState); return; } mRemoteDevices.onBondStateChange(device, newState); if (devProp != null) { oldState = devProp.getBondState(); } Loading android/app/src/com/android/bluetooth/btservice/JniCallbacks.java +0 −5 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ 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 @@ -68,9 +66,6 @@ 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 +9 −10 Original line number Diff line number Diff line Loading @@ -1140,7 +1140,7 @@ public class RemoteDevices { mAdapterService.sendBroadcast( intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle()); } else if (device.getBondState() == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); removeAddressMapping(Utils.getAddressStringFromByte(address)); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { mAdapterService.notifyAclDisconnected(device, transportLinkType); Loading Loading @@ -1223,21 +1223,20 @@ public class RemoteDevices { } } private void removeAddressMapping(byte[] address) { String key = Utils.getAddressStringFromByte(address); private void removeAddressMapping(String address) { synchronized (mDevices) { mDevices.remove(key); mDeviceQueue.remove(key); // Remove from LRU cache mDevices.remove(address); mDeviceQueue.remove(address); // Remove from LRU cache // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); mDualDevicesMap.values().remove(address); mDualDevicesMap.remove(address); } } void onBondStateChange(byte[] address, int newState) { if (newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); void onBondStateChange(BluetoothDevice device, int newState) { if (Flags.removeAddressMapOnUnbond() && newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(device.getAddress()); } } Loading flags/framework.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -55,13 +55,6 @@ flag { bug: "321120941" } flag { name: "remove_bond_with_address_map" namespace: "bluetooth" description: "Removes the address map when the bond is removed" bug: "326603271" } flag { name: "remove_address_map_on_unbond" namespace: "bluetooth" Loading Loading
android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +3 −0 Original line number Diff line number Diff line Loading @@ -489,6 +489,9 @@ final class BondStateMachine extends StateMachine { infoLog("Invalid bond state " + newState); return; } mRemoteDevices.onBondStateChange(device, newState); if (devProp != null) { oldState = devProp.getBondState(); } Loading
android/app/src/com/android/bluetooth/btservice/JniCallbacks.java +0 −5 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ 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 @@ -68,9 +66,6 @@ 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 +9 −10 Original line number Diff line number Diff line Loading @@ -1140,7 +1140,7 @@ public class RemoteDevices { mAdapterService.sendBroadcast( intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle()); } else if (device.getBondState() == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); removeAddressMapping(Utils.getAddressStringFromByte(address)); } if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) { mAdapterService.notifyAclDisconnected(device, transportLinkType); Loading Loading @@ -1223,21 +1223,20 @@ public class RemoteDevices { } } private void removeAddressMapping(byte[] address) { String key = Utils.getAddressStringFromByte(address); private void removeAddressMapping(String address) { synchronized (mDevices) { mDevices.remove(key); mDeviceQueue.remove(key); // Remove from LRU cache mDevices.remove(address); mDeviceQueue.remove(address); // Remove from LRU cache // Remove from dual mode device mappings mDualDevicesMap.values().remove(key); mDualDevicesMap.remove(key); mDualDevicesMap.values().remove(address); mDualDevicesMap.remove(address); } } void onBondStateChange(byte[] address, int newState) { if (newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(address); void onBondStateChange(BluetoothDevice device, int newState) { if (Flags.removeAddressMapOnUnbond() && newState == BluetoothDevice.BOND_NONE) { removeAddressMapping(device.getAddress()); } } Loading
flags/framework.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -55,13 +55,6 @@ flag { bug: "321120941" } flag { name: "remove_bond_with_address_map" namespace: "bluetooth" description: "Removes the address map when the bond is removed" bug: "326603271" } flag { name: "remove_address_map_on_unbond" namespace: "bluetooth" Loading