Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -236,6 +236,10 @@ public class RemoteDevices { } } DeviceProperties getDeviceProperties(BluetoothDevice device) { DeviceProperties getDeviceProperties(BluetoothDevice device) { if (device == null) { return null; } synchronized (mDevices) { synchronized (mDevices) { String address = mDualDevicesMap.get(device.getAddress()); String address = mDualDevicesMap.get(device.getAddress()); // If the device is not in the dual map, use its original address // If the device is not in the dual map, use its original address Loading android/app/tests/unit/src/com/android/bluetooth/btservice/RemoteDevicesTest.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -742,6 +742,12 @@ public class RemoteDevicesTest { Assert.assertFalse(deviceProp.isCoordinatedSetMember()); Assert.assertFalse(deviceProp.isCoordinatedSetMember()); } } @Test public void testIsDeviceNull() { Assert.assertNull(mRemoteDevices.getDeviceProperties(null)); } private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, ArgumentCaptor<Intent> intentArgument) { ArgumentCaptor<Intent> intentArgument) { verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); Loading Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -236,6 +236,10 @@ public class RemoteDevices { } } DeviceProperties getDeviceProperties(BluetoothDevice device) { DeviceProperties getDeviceProperties(BluetoothDevice device) { if (device == null) { return null; } synchronized (mDevices) { synchronized (mDevices) { String address = mDualDevicesMap.get(device.getAddress()); String address = mDualDevicesMap.get(device.getAddress()); // If the device is not in the dual map, use its original address // If the device is not in the dual map, use its original address Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/RemoteDevicesTest.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -742,6 +742,12 @@ public class RemoteDevicesTest { Assert.assertFalse(deviceProp.isCoordinatedSetMember()); Assert.assertFalse(deviceProp.isCoordinatedSetMember()); } } @Test public void testIsDeviceNull() { Assert.assertNull(mRemoteDevices.getDeviceProperties(null)); } private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, ArgumentCaptor<Intent> intentArgument) { ArgumentCaptor<Intent> intentArgument) { verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); Loading