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

Commit b388022d authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Null-check device properties when removing the address mapping

Test: mmm packages/modules/Bluetooth
Test: Manual | CtsVerifier app > Bluetooth Test > Insecure Client and Insecure
Flag: com.android.bluetooth.flags.temporary_pairing_device_properties
Bug: 341196265
Bug: 342202557
Change-Id: I0547a4de40e328b9f549c280994cfeecc17e9cd4
parent ca75733c
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1247,6 +1247,7 @@ public class RemoteDevices {
        String address = device.getAddress();
        if (Flags.temporaryPairingDeviceProperties() && oldState != BluetoothDevice.BOND_BONDED) {
            DeviceProperties deviceProperties = mDevices.get(address);
            if (deviceProperties != null) {
                int leConnectionHandle =
                        deviceProperties.getConnectionHandle(BluetoothDevice.TRANSPORT_LE);
                int bredrConnectionHandle =
@@ -1257,6 +1258,7 @@ public class RemoteDevices {
                    return;
                }
            }
        }

        if (Flags.removeAddressMapOnUnbond() && newState == BluetoothDevice.BOND_NONE) {
            removeAddressMapping(address);