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 flags/btif_dm.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,10 @@ flag { description: "Don't reset the pairing state if service discovery concludes for a different device" bug: "321996502" } flag { name: "force_bredr_for_sdp_retry" namespace: "bluetooth" description: "Force BR/EDR transport for retrying SDP service discovery" bug: "326656580" } flags/framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -49,3 +49,10 @@ flag { description: "Change visibility of BluetoothDevice#getAddressType API to public" bug: "321120941" } flag { name: "remove_bond_with_address_map" namespace: "bluetooth" description: "Removes the address map when the bond is removed" bug: "326603271" } system/audio_hal_interface/fuzzer/Android.bp +13 −8 Original line number Diff line number Diff line Loading @@ -30,16 +30,11 @@ cc_defaults { "libbluetooth_headers", ], defaults: [ "latest_android_hardware_bluetooth_audio_ndk_shared", "latest_android_hardware_audio_common_ndk_static", "latest_android_hardware_bluetooth_audio_ndk_static", "latest_android_media_audio_common_types_ndk_static", ], shared_libs: [ "android.hardware.bluetooth.a2dp@1.0", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.system.suspend-V1-ndk", "android.system.suspend.control-V1-ndk", "libPlatformProperties", "libaaudio", "libbinder_ndk", Loading @@ -51,6 +46,16 @@ cc_defaults { "server_configurable_flags", ], static_libs: [ "android.hardware.audio.common@5.0", "android.hardware.bluetooth.a2dp@1.0", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", "android.system.suspend-V1-ndk", "android.system.suspend.control-V1-ndk", "libFraunhoferAAC", "libaudio-a2dp-hw-utils", "libbase", 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
flags/btif_dm.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,10 @@ flag { description: "Don't reset the pairing state if service discovery concludes for a different device" bug: "321996502" } flag { name: "force_bredr_for_sdp_retry" namespace: "bluetooth" description: "Force BR/EDR transport for retrying SDP service discovery" bug: "326656580" }
flags/framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -49,3 +49,10 @@ flag { description: "Change visibility of BluetoothDevice#getAddressType API to public" bug: "321120941" } flag { name: "remove_bond_with_address_map" namespace: "bluetooth" description: "Removes the address map when the bond is removed" bug: "326603271" }
system/audio_hal_interface/fuzzer/Android.bp +13 −8 Original line number Diff line number Diff line Loading @@ -30,16 +30,11 @@ cc_defaults { "libbluetooth_headers", ], defaults: [ "latest_android_hardware_bluetooth_audio_ndk_shared", "latest_android_hardware_audio_common_ndk_static", "latest_android_hardware_bluetooth_audio_ndk_static", "latest_android_media_audio_common_types_ndk_static", ], shared_libs: [ "android.hardware.bluetooth.a2dp@1.0", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.system.suspend-V1-ndk", "android.system.suspend.control-V1-ndk", "libPlatformProperties", "libaaudio", "libbinder_ndk", Loading @@ -51,6 +46,16 @@ cc_defaults { "server_configurable_flags", ], static_libs: [ "android.hardware.audio.common@5.0", "android.hardware.bluetooth.a2dp@1.0", "android.hardware.bluetooth.audio@2.0", "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", "android.system.suspend-V1-ndk", "android.system.suspend.control-V1-ndk", "libFraunhoferAAC", "libaudio-a2dp-hw-utils", "libbase", Loading