Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class A2dpServiceTest { TestUtils.setAdapterService(mAdapterService); doReturn(MAX_CONNECTED_AUDIO_DEVICES).when(mAdapterService).getMaxConnectedAudioDevices(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); doReturn(false).when(mAdapterService).isQuietModeEnabled(); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading Loading @@ -126,7 +126,6 @@ public class A2dpServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); stopService(); mTargetContext.unregisterReceiver(mA2dpIntentReceiver); mConnectionStateChangedQueue.clear(); Loading android/app/tests/unit/src/com/android/bluetooth/a2dpsink/A2dpSinkServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class A2dpSinkServiceTest { MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); setMaxConnectedAudioDevices(1); TestUtils.startService(mServiceRule, A2dpSinkService.class); mService = A2dpSinkService.getA2dpSinkService(); Loading @@ -77,7 +77,6 @@ public class A2dpSinkServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp_sink)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, A2dpSinkService.class); mService = A2dpSinkService.getA2dpSinkService(); Assert.assertNull(mService); Loading android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class AvrcpControllerServiceTest { .getBoolean(R.bool.profile_supported_avrcp_controller)); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.startService(mServiceRule, AvrcpControllerService.class); mService = AvrcpControllerService.getAvrcpControllerService(); Assert.assertNotNull(mService); Loading @@ -73,7 +73,6 @@ public class AvrcpControllerServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_avrcp_controller)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, AvrcpControllerService.class); mService = AvrcpControllerService.getAvrcpControllerService(); Assert.assertNull(mService); Loading android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class HearingAidServiceTest { TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); mAdapter = BluetoothAdapter.getDefaultAdapter(); Loading Loading @@ -129,7 +129,6 @@ public class HearingAidServiceTest { R.bool.config_hearing_aid_profile_supported)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); stopService(); mTargetContext.unregisterReceiver(mHearingAidIntentReceiver); mDeviceQueueMap.clear(); Loading android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class HeadsetServiceAndStateMachineTest { doReturn(new ParcelUuid[]{BluetoothUuid.HFP}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); // We cannot mock HeadsetObjectsFactory.getInstance() with Mockito. // Hence we need to use reflection to call a private method to // initialize properly the HeadsetObjectsFactory.sInstance field. Loading Loading @@ -241,7 +241,6 @@ public class HeadsetServiceAndStateMachineTest { return; } mTargetContext.unregisterReceiver(mHeadsetIntentReceiver); doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, HeadsetService.class); HeadsetService.sStartVrTimeoutMs = mOriginalVrTimeoutMs; Intents.release(); Loading Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class A2dpServiceTest { TestUtils.setAdapterService(mAdapterService); doReturn(MAX_CONNECTED_AUDIO_DEVICES).when(mAdapterService).getMaxConnectedAudioDevices(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); doReturn(false).when(mAdapterService).isQuietModeEnabled(); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); Loading Loading @@ -126,7 +126,6 @@ public class A2dpServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); stopService(); mTargetContext.unregisterReceiver(mA2dpIntentReceiver); mConnectionStateChangedQueue.clear(); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dpsink/A2dpSinkServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class A2dpSinkServiceTest { MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); setMaxConnectedAudioDevices(1); TestUtils.startService(mServiceRule, A2dpSinkService.class); mService = A2dpSinkService.getA2dpSinkService(); Loading @@ -77,7 +77,6 @@ public class A2dpSinkServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_a2dp_sink)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, A2dpSinkService.class); mService = A2dpSinkService.getA2dpSinkService(); Assert.assertNull(mService); Loading
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class AvrcpControllerServiceTest { .getBoolean(R.bool.profile_supported_avrcp_controller)); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.startService(mServiceRule, AvrcpControllerService.class); mService = AvrcpControllerService.getAvrcpControllerService(); Assert.assertNotNull(mService); Loading @@ -73,7 +73,6 @@ public class AvrcpControllerServiceTest { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_avrcp_controller)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, AvrcpControllerService.class); mService = AvrcpControllerService.getAvrcpControllerService(); Assert.assertNull(mService); Loading
android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class HearingAidServiceTest { TestUtils.setAdapterService(mAdapterService); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); mAdapter = BluetoothAdapter.getDefaultAdapter(); Loading Loading @@ -129,7 +129,6 @@ public class HearingAidServiceTest { R.bool.config_hearing_aid_profile_supported)) { return; } doReturn(false).when(mAdapterService).isStartedProfile(anyString()); stopService(); mTargetContext.unregisterReceiver(mHearingAidIntentReceiver); mDeviceQueueMap.clear(); Loading
android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class HeadsetServiceAndStateMachineTest { doReturn(new ParcelUuid[]{BluetoothUuid.HFP}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); doReturn(mDatabaseManager).when(mAdapterService).getDatabase(); doReturn(true).when(mAdapterService).isStartedProfile(anyString()); doReturn(true, false).when(mAdapterService).isStartedProfile(anyString()); // We cannot mock HeadsetObjectsFactory.getInstance() with Mockito. // Hence we need to use reflection to call a private method to // initialize properly the HeadsetObjectsFactory.sInstance field. Loading Loading @@ -241,7 +241,6 @@ public class HeadsetServiceAndStateMachineTest { return; } mTargetContext.unregisterReceiver(mHeadsetIntentReceiver); doReturn(false).when(mAdapterService).isStartedProfile(anyString()); TestUtils.stopService(mServiceRule, HeadsetService.class); HeadsetService.sStartVrTimeoutMs = mOriginalVrTimeoutMs; Intents.release(); Loading