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

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

Check against null device

Change-Id: I282571549aeb6d4e01a10bde595ac57f6e6ad7e1
Test: atest RemoteDevicesTest
Flag: EXEMPT null check
Bug: 301023254
parent e88e2384
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -222,6 +222,10 @@ public class RemoteDevices {
    }

    DeviceProperties getDeviceProperties(BluetoothDevice device) {
        if (device == null) {
            return null;
        }

        synchronized (mDevices) {
            String address = mDualDevicesMap.get(device.getAddress());
            // If the device is not in the dual map, use its original address
+6 −0
Original line number Diff line number Diff line
@@ -742,6 +742,12 @@ public class RemoteDevicesTest {
        Assert.assertFalse(deviceProp.isCoordinatedSetMember());
    }

    @Test
    public void testIsDeviceNull() {
        Assert.assertNull(mRemoteDevices.getDeviceProperties(null));
    }


    private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel,
            ArgumentCaptor<Intent> intentArgument) {
        verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue());