Loading tests/unit/src/com/android/bluetooth/StateMachineTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ public class StateMachineTest { } } class ChildState extends State { static class ChildState extends State { @Override public boolean processMessage(Message message) { return NOT_HANDLED; Loading Loading @@ -1013,7 +1013,7 @@ public class StateMachineTest { } } class ChildState2 extends State { static class ChildState2 extends State { @Override public boolean processMessage(Message message) { return NOT_HANDLED; Loading Loading @@ -1586,7 +1586,7 @@ public class StateMachineTest { * without a delay the arrival time difference should always >= to SM7_DELAY_TIME. */ long arrivalTimeDiff = sm7.mArrivalTimeMsg3 - sm7.mArrivalTimeMsg2; long expectedDelay = sm7.SM7_DELAY_TIME - SM7_DELAY_FUDGE; long expectedDelay = (long) sm7.SM7_DELAY_TIME - SM7_DELAY_FUDGE; if (sm7.isDbg()) tlog("testStateMachine7: expect " + arrivalTimeDiff + " >= " + expectedDelay); Assert.assertTrue(arrivalTimeDiff >= expectedDelay); Loading tests/unit/src/com/android/bluetooth/audio_util/MediaPlayerListTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,6 @@ public class MediaPlayerListTest { when(mMockContext.registerReceiver(any(), any())).thenReturn(null); when(mMockContext.getApplicationContext()).thenReturn(mMockContext); when(mMockContext.getPackageManager()).thenReturn(mockPackageManager); List<ResolveInfo> playerList = new ArrayList<ResolveInfo>(); when(mockPackageManager.queryIntentServices(any(), anyInt())).thenReturn(null); Method method = BrowsablePlayerConnector.class.getDeclaredMethod("setInstanceForTesting", Loading tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -371,7 +371,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading Loading @@ -400,7 +400,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(displayName, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading @@ -427,7 +427,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading tests/unit/src/com/android/bluetooth/btservice/bluetoothKeystore/BluetoothKeystoreServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.LinkedList; import java.util.ArrayList; import java.util.List; import java.util.Map; Loading Loading @@ -113,7 +113,7 @@ public final class BluetoothKeystoreServiceTest { "LE_KEY_LID =" ); private List<String> mConfigData = new LinkedList<>(); private List<String> mConfigData = new ArrayList<>(); private Map<String, String> mNameDecryptKeyResult = new HashMap<>(); Loading tests/unit/src/com/android/bluetooth/hid/HidDeviceTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class HidDeviceTest { try { mConnectionStateChangedQueue.put(intent); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } } Loading @@ -177,9 +177,8 @@ public class HidDeviceTest { Assert.assertNotNull(intent); return intent; } catch (InterruptedException e) { Assert.fail("Cannot obtain an Intent from the queue"); throw new AssertionError("Cannot obtain an Intent from the queue", e); } return null; } private void verifyConnectionStateIntent(int timeoutMs, BluetoothDevice device, int newState, Loading @@ -200,7 +199,7 @@ public class HidDeviceTest { int lastCallbackType = lastCallback; Assert.assertEquals(callbackType, lastCallbackType); } catch (InterruptedException e) { Assert.fail("Cannot obtain a callback from the queue"); throw new AssertionError("Cannot obtain a callback from the queue", e); } } Loading @@ -213,7 +212,7 @@ public class HidDeviceTest { mCallbackQueue.put(CALLBACK_APP_UNREGISTERED); } } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -225,7 +224,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_GET_REPORT); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -233,7 +232,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_SET_REPORT); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -241,7 +240,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_SET_PROTOCOL); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -249,7 +248,8 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_INTR_DATA); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -257,7 +257,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_VIRTUAL_UNPLUG); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } } Loading Loading
tests/unit/src/com/android/bluetooth/StateMachineTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ public class StateMachineTest { } } class ChildState extends State { static class ChildState extends State { @Override public boolean processMessage(Message message) { return NOT_HANDLED; Loading Loading @@ -1013,7 +1013,7 @@ public class StateMachineTest { } } class ChildState2 extends State { static class ChildState2 extends State { @Override public boolean processMessage(Message message) { return NOT_HANDLED; Loading Loading @@ -1586,7 +1586,7 @@ public class StateMachineTest { * without a delay the arrival time difference should always >= to SM7_DELAY_TIME. */ long arrivalTimeDiff = sm7.mArrivalTimeMsg3 - sm7.mArrivalTimeMsg2; long expectedDelay = sm7.SM7_DELAY_TIME - SM7_DELAY_FUDGE; long expectedDelay = (long) sm7.SM7_DELAY_TIME - SM7_DELAY_FUDGE; if (sm7.isDbg()) tlog("testStateMachine7: expect " + arrivalTimeDiff + " >= " + expectedDelay); Assert.assertTrue(arrivalTimeDiff >= expectedDelay); Loading
tests/unit/src/com/android/bluetooth/audio_util/MediaPlayerListTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,6 @@ public class MediaPlayerListTest { when(mMockContext.registerReceiver(any(), any())).thenReturn(null); when(mMockContext.getApplicationContext()).thenReturn(mMockContext); when(mMockContext.getPackageManager()).thenReturn(mockPackageManager); List<ResolveInfo> playerList = new ArrayList<ResolveInfo>(); when(mockPackageManager.queryIntentServices(any(), anyInt())).thenReturn(null); Method method = BrowsablePlayerConnector.class.getDeclaredMethod("setInstanceForTesting", Loading
tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -371,7 +371,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading Loading @@ -400,7 +400,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(displayName, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading @@ -427,7 +427,7 @@ public final class AvrcpItemTest { Assert.assertEquals(UUID, desc.getMediaId()); Assert.assertEquals(null, desc.getMediaUri()); Assert.assertEquals(title, desc.getTitle().toString()); Assert.assertEquals(null, desc.getSubtitle()); Assert.assertEquals(desc.getSubtitle(), null); Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } Loading
tests/unit/src/com/android/bluetooth/btservice/bluetoothKeystore/BluetoothKeystoreServiceTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.LinkedList; import java.util.ArrayList; import java.util.List; import java.util.Map; Loading Loading @@ -113,7 +113,7 @@ public final class BluetoothKeystoreServiceTest { "LE_KEY_LID =" ); private List<String> mConfigData = new LinkedList<>(); private List<String> mConfigData = new ArrayList<>(); private Map<String, String> mNameDecryptKeyResult = new HashMap<>(); Loading
tests/unit/src/com/android/bluetooth/hid/HidDeviceTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class HidDeviceTest { try { mConnectionStateChangedQueue.put(intent); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } } Loading @@ -177,9 +177,8 @@ public class HidDeviceTest { Assert.assertNotNull(intent); return intent; } catch (InterruptedException e) { Assert.fail("Cannot obtain an Intent from the queue"); throw new AssertionError("Cannot obtain an Intent from the queue", e); } return null; } private void verifyConnectionStateIntent(int timeoutMs, BluetoothDevice device, int newState, Loading @@ -200,7 +199,7 @@ public class HidDeviceTest { int lastCallbackType = lastCallback; Assert.assertEquals(callbackType, lastCallbackType); } catch (InterruptedException e) { Assert.fail("Cannot obtain a callback from the queue"); throw new AssertionError("Cannot obtain a callback from the queue", e); } } Loading @@ -213,7 +212,7 @@ public class HidDeviceTest { mCallbackQueue.put(CALLBACK_APP_UNREGISTERED); } } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -225,7 +224,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_GET_REPORT); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -233,7 +232,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_SET_REPORT); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -241,7 +240,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_SET_PROTOCOL); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -249,7 +248,8 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_INTR_DATA); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } Loading @@ -257,7 +257,7 @@ public class HidDeviceTest { try { mCallbackQueue.put(CALLBACK_ON_VIRTUAL_UNPLUG); } catch (InterruptedException e) { Assert.fail("Cannot add Intent to the queue"); throw new AssertionError("Cannot add Intent to the queue", e); } } } Loading