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

Commit 4b3f3059 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

Merge "Check against null device" into main am: 5c0457c9 am: 5155fea3

parents 79415175 5155fea3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -236,6 +236,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());