Add even more test annotations
Bug: 26853070
Change-Id: I8c6a6cdf2164afe88cc1cca1b5ea402c304994b3
diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
index b1c4e03..fec9f01 100644
--- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java
+++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
@@ -455,6 +455,7 @@
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(outgoing.mCallId);
}
+ @LargeTest
public void testAudioManagerOperations() throws Exception {
AudioManager audioManager = (AudioManager) mComponentContextFixture.getTestDouble()
.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothManagerTest.java b/tests/src/com/android/server/telecom/tests/BluetoothManagerTest.java
index 09ef9e1..d9a9e14 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothManagerTest.java
@@ -23,6 +23,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Parcel;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.BluetoothAdapterProxy;
import com.android.server.telecom.BluetoothHeadsetProxy;
@@ -72,24 +73,28 @@
mBluetoothManager.setBluetoothHeadsetForTesting(mHeadsetProxy);
}
+ @SmallTest
public void testIsBluetoothAvailableWithNoDevices() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.<BluetoothDevice>emptyList());
assertFalse(mBluetoothManager.isBluetoothAvailable());
}
+ @SmallTest
public void testIsBluetoothAvailable() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
assertTrue(mBluetoothManager.isBluetoothAvailable());
}
+ @SmallTest
public void testIsAudioConnectedWithNoDevices() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.<BluetoothDevice>emptyList());
assertFalse(mBluetoothManager.isBluetoothAudioConnected());
}
+ @SmallTest
public void testIsAudioConnectedWhenAudioNotOn() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
@@ -97,6 +102,7 @@
assertFalse(mBluetoothManager.isBluetoothAudioConnected());
}
+ @SmallTest
public void testIsAudioConnectedWhenAudioOn() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
@@ -104,6 +110,7 @@
assertTrue(mBluetoothManager.isBluetoothAudioConnected());
}
+ @SmallTest
public void testShouldBePendingAfterConnectAudio() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
@@ -114,17 +121,20 @@
assertTrue(mBluetoothManager.isBluetoothAudioConnectedOrPending());
}
+ @SmallTest
public void testDisconnectAudioWhenHeadsetServiceConnected() {
mBluetoothManager.disconnectBluetoothAudio();
verify(mHeadsetProxy).disconnectAudio();
}
+ @SmallTest
public void testDisconnectAudioWithNoHeadsetService() {
mBluetoothManager.setBluetoothHeadsetForTesting(null);
mBluetoothManager.disconnectBluetoothAudio();
verify(mHeadsetProxy, never()).disconnectAudio();
}
+ @SmallTest
public void testConnectServiceWhenUninitialized1() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.<BluetoothDevice>emptyList());
@@ -133,6 +143,7 @@
BluetoothManager.BLUETOOTH_DISCONNECTED);
}
+ @SmallTest
public void testConnectServiceWhenUninitialized2() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
@@ -142,6 +153,7 @@
BluetoothManager.BLUETOOTH_DEVICE_CONNECTED);
}
+ @SmallTest
public void testConnectServiceWhenUninitialized3() {
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
Collections.singletonList(device1));
@@ -151,6 +163,7 @@
BluetoothManager.BLUETOOTH_AUDIO_CONNECTED);
}
+ @SmallTest
public void testReceiveAudioDisconnectWhenConnected() {
mBluetoothManager.setInternalBluetoothState(BluetoothManager.BLUETOOTH_AUDIO_CONNECTED);
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
@@ -162,6 +175,7 @@
BluetoothManager.BLUETOOTH_DEVICE_CONNECTED);
}
+ @SmallTest
public void testReceiveAudioConnectWhenDisconnected() {
mBluetoothManager.setInternalBluetoothState(BluetoothManager.BLUETOOTH_DEVICE_CONNECTED);
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
@@ -173,6 +187,7 @@
BluetoothManager.BLUETOOTH_AUDIO_CONNECTED);
}
+ @SmallTest
public void testReceiveAudioConnectWhenPending() {
mBluetoothManager.setInternalBluetoothState(BluetoothManager.BLUETOOTH_AUDIO_PENDING);
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
@@ -184,6 +199,7 @@
BluetoothManager.BLUETOOTH_AUDIO_CONNECTED);
}
+ @SmallTest
public void testReceiveAudioDisconnectWhenPending() {
mBluetoothManager.setInternalBluetoothState(BluetoothManager.BLUETOOTH_AUDIO_PENDING);
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
@@ -195,6 +211,7 @@
BluetoothManager.BLUETOOTH_DEVICE_CONNECTED);
}
+ @SmallTest
public void testReceiveAudioConnectingWhenPending() {
mBluetoothManager.setInternalBluetoothState(BluetoothManager.BLUETOOTH_AUDIO_PENDING);
when(mHeadsetProxy.getConnectedDevices()).thenReturn(
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java b/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
index 4c32dd7..f9502dd 100644
--- a/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallAudioModeStateMachineTest.java
@@ -16,9 +16,7 @@
package com.android.server.telecom.tests;
-import android.content.Context;
import android.media.AudioManager;
-import android.telecom.CallAudioState;
import android.test.suitebuilder.annotation.LargeTest;
import com.android.server.telecom.CallAudioManager;
diff --git a/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java b/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
index e8bd05c..0104172 100644
--- a/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
+++ b/tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java
@@ -24,6 +24,7 @@
import android.telecom.DisconnectCause;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.Call;
import com.android.server.telecom.CallIdMapper;
@@ -83,6 +84,7 @@
super.tearDown();
}
+ @SmallTest
public void testSimPhoneAccountSuccess() throws Exception {
PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -102,6 +104,7 @@
verify(mMockCreateConnectionResponse).handleCreateConnectionSuccess(mockCallIdMapper, null);
}
+ @SmallTest
public void testbadPhoneAccount() throws Exception {
PhoneAccountHandle pAHandle = null;
when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -119,6 +122,7 @@
eq(new DisconnectCause(DisconnectCause.ERROR)));
}
+ @SmallTest
public void testConnectionManagerSuccess() throws Exception {
PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -143,6 +147,7 @@
verify(mMockCreateConnectionResponse).handleCreateConnectionSuccess(mockCallIdMapper, null);
}
+ @SmallTest
public void testConnectionManagerFailedFallToSim() throws Exception {
PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -177,6 +182,7 @@
verify(mMockCreateConnectionResponse).handleCreateConnectionSuccess(mockCallIdMapper, null);
}
+ @SmallTest
public void testConnectionManagerFailedDoNotFallToSim() throws Exception {
PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
when(mMockCall.isEmergencyCall()).thenReturn(false);
@@ -206,6 +212,7 @@
new DisconnectCause(DisconnectCause.OTHER));
}
+ @SmallTest
public void testEmergencyCallToSim() throws Exception {
when(mMockCall.isEmergencyCall()).thenReturn(true);
// Put in a regular phone account to be sure it doesn't call that
@@ -228,6 +235,7 @@
verify(mMockCreateConnectionResponse).handleCreateConnectionSuccess(mockCallIdMapper, null);
}
+ @SmallTest
public void testEmergencyCallSimFailToConnectionManager() throws Exception {
when(mMockCall.isEmergencyCall()).thenReturn(true);
when(mMockCall.getHandle()).thenReturn(Uri.parse(""));
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
index ee3f691..5d98c0a 100644
--- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
+++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
@@ -30,6 +30,7 @@
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.test.mock.MockContext;
+import android.test.suitebuilder.annotation.MediumTest;
import com.android.server.telecom.BluetoothHeadsetProxy;
import com.android.server.telecom.Call;
@@ -98,6 +99,7 @@
super.tearDown();
}
+ @MediumTest
public void testBindToService_NoServicesFound_IncomingCall() throws Exception {
when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mUserHandle);
when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager);
@@ -124,6 +126,7 @@
assertNull(bindIntent.getExtras());
}
+ @MediumTest
public void testBindToService_NoServicesFound_OutgoingCall() throws Exception {
Bundle callExtras = new Bundle();
callExtras.putBoolean("whatever", true);
diff --git a/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java b/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
index 76bac9f..3a8c2d9 100644
--- a/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
+++ b/tests/src/com/android/server/telecom/tests/InCallWakeLockControllerTest.java
@@ -22,6 +22,7 @@
import static org.mockito.Mockito.never;
import android.os.PowerManager;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.Call;
import com.android.server.telecom.CallState;
@@ -54,6 +55,7 @@
super.tearDown();
}
+ @SmallTest
public void testRingingCallAdded() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(mCall);
when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -63,6 +65,7 @@
verify(mWakeLockAdapter).acquire();
}
+ @SmallTest
public void testNonRingingCallAdded() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(null);
when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -72,6 +75,7 @@
verify(mWakeLockAdapter, never()).acquire();
}
+ @SmallTest
public void testRingingCallTransition() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(mCall);
when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -81,6 +85,7 @@
verify(mWakeLockAdapter).acquire();
}
+ @SmallTest
public void testRingingCallRemoved() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(null);
when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -90,6 +95,7 @@
verify(mWakeLockAdapter, never()).acquire();
}
+ @SmallTest
public void testWakeLockReleased() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(null);
when(mWakeLockAdapter.isHeld()).thenReturn(true);
@@ -99,6 +105,7 @@
verify(mWakeLockAdapter).release(0);
}
+ @SmallTest
public void testAcquireWakeLockWhenHeld() throws Exception {
when(mCallsManager.getRingingCall()).thenReturn(mCall);
when(mWakeLockAdapter.isHeld()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/LogTest.java b/tests/src/com/android/server/telecom/tests/LogTest.java
index 7db000f..586105f 100644
--- a/tests/src/com/android/server/telecom/tests/LogTest.java
+++ b/tests/src/com/android/server/telecom/tests/LogTest.java
@@ -21,6 +21,7 @@
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
+import android.test.suitebuilder.annotation.MediumTest;
import com.android.internal.os.SomeArgs;
import com.android.server.telecom.Runnable;
@@ -237,6 +238,7 @@
super.tearDown();
}
+ @MediumTest
public void testSingleThreadSession() throws Exception {
String sessionName = "LT.sTS";
Log.startSession(sessionName);
@@ -252,6 +254,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testSingleHandlerThreadSession() throws Exception {
String sessionName = "LT.tSHTS";
Log.startSession(sessionName);
@@ -275,6 +278,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testSpawnMultipleThreadSessions() throws Exception {
final String sessionName = "LT.lTR";
mCompleteCount = new AtomicInteger(0);
@@ -302,6 +306,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testSpawnMultipleThreadMultipleHandlerSession() throws Exception {
String sessionName = "LT.tSMTMHS";
Log.startSession(sessionName);
@@ -334,6 +339,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testSpawnMultipleThreadMultipleHandlerSessions() throws Exception {
String sessionName = "LT.tSMTMHSs";
isHandlerCompleteWithEvents = false;
@@ -375,6 +381,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testCancelSubsession() throws Exception {
String sessionName = "LT.tCS";
Log.startSession(sessionName);
@@ -391,6 +398,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testInternalExternalCallToMethod() throws Exception {
String sessionName = "LT.tIECTM";
Log.startSession(sessionName);
@@ -409,6 +417,7 @@
assertEquals(true, mTestSystemLogger.isMessagesEmpty());
}
+ @MediumTest
public void testGarbageCollectionWithTimeout() throws Exception {
String sessionName = "LT.tGCWT";
diff --git a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
index c997b31..2ac9c50 100644
--- a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
@@ -30,6 +30,7 @@
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.Call;
import com.android.server.telecom.Constants;
@@ -112,10 +113,12 @@
mComponentContextFixture.setTelecomManager(mTelecomManager);
}
+ @SmallTest
public void testCancelNotificationInPrimaryUser() {
cancelNotificationTestInternal(PRIMARY_USER);
}
+ @SmallTest
public void testCancelNotificationInSecondaryUser() {
cancelNotificationTestInternal(SECONARY_USER);
}
@@ -147,6 +150,7 @@
verify(builder2).setContentText(CALLER_NAME);
}
+ @SmallTest
public void testNotifyMultipleMissedCalls() {
Notification.Builder[] builders = new Notification.Builder[4];
@@ -209,27 +213,32 @@
}
}
+ @SmallTest
public void testNotifySingleCallInPrimaryUser() {
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
}
+ @SmallTest
public void testNotifySingleCallInSecondaryUser() {
PhoneAccount phoneAccount = makePhoneAccount(SECONARY_USER, NO_CAPABILITY);
notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
}
+ @SmallTest
public void testNotifySingleCallInSecondaryUserWithMultiUserCapability() {
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER,
PhoneAccount.CAPABILITY_MULTI_USER);
notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
}
+ @SmallTest
public void testNotifySingleCallWhenCurrentUserIsSecondaryUser() {
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
notifySingleCallTestInternal(phoneAccount, SECONARY_USER);
}
+ @SmallTest
public void testNotifySingleCall() {
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
notifySingleCallTestInternal(phoneAccount, PRIMARY_USER);
@@ -299,6 +308,7 @@
smsIntent, PendingIntent.FLAG_NO_CREATE));
}
+ @SmallTest
public void testNoSmsBackAfterMissedSipCall() {
Notification.Builder builder1 = makeNotificationBuilder("builder1");
MissedCallNotifierImpl.NotificationBuilderFactory fakeBuilderFactory =
diff --git a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
index 67e3f70..ceabc58 100644
--- a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
+++ b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
@@ -29,6 +29,7 @@
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
+import android.test.suitebuilder.annotation.MediumTest;
import android.util.Xml;
import com.android.internal.telecom.IConnectionService;
@@ -83,6 +84,7 @@
super.tearDown();
}
+ @MediumTest
public void testPhoneAccountHandle() throws Exception {
PhoneAccountHandle input = new PhoneAccountHandle(new ComponentName("pkg0", "cls0"), "id0");
PhoneAccountHandle result = roundTripXml(this, input,
@@ -96,6 +98,7 @@
assertPhoneAccountHandleEquals(inputN, resultN);
}
+ @MediumTest
public void testPhoneAccount() throws Exception {
Bundle testBundle = new Bundle();
testBundle.putInt("EXTRA_INT_1", 1);
@@ -118,9 +121,10 @@
}
/**
- * Test to ensure non-supported balues
+ * Test to ensure non-supported values
* @throws Exception
*/
+ @MediumTest
public void testPhoneAccountExtrasEdge() throws Exception {
Bundle testBundle = new Bundle();
// Ensure null values for string are not persisted.
@@ -149,6 +153,7 @@
assertFalse(extras.keySet().contains("EXTRA_PARC"));
}
+ @MediumTest
public void testState() throws Exception {
PhoneAccountRegistrar.State input = makeQuickState();
PhoneAccountRegistrar.State result = roundTripXml(this, input,
@@ -162,6 +167,7 @@
mRegistrar.enablePhoneAccount(account.getAccountHandle(), true);
}
+ @MediumTest
public void testAccounts() throws Exception {
int i = 0;
@@ -192,10 +198,12 @@
PhoneAccount.SCHEME_TEL));
}
+ @MediumTest
public void testSimCallManager() throws Exception {
// TODO
}
+ @MediumTest
public void testDefaultOutgoing() throws Exception {
mComponentContextFixture.addConnectionService(
makeQuickConnectionServiceComponentName(),
@@ -244,6 +252,7 @@
mRegistrar.getOutgoingPhoneAccountForSchemeOfCurrentUser(PhoneAccount.SCHEME_TEL));
}
+ @MediumTest
public void testPhoneAccountParceling() throws Exception {
PhoneAccountHandle handle = makeQuickAccountHandle("foo");
roundTripPhoneAccount(new PhoneAccount.Builder(handle, null).build());
diff --git a/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java b/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
index f08da0c..01bd09e 100644
--- a/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/ProximitySensorManagerTest.java
@@ -17,6 +17,7 @@
package com.android.server.telecom.tests;
import android.os.PowerManager;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.Call;
import com.android.server.telecom.CallsManager;
@@ -55,6 +56,7 @@
super.tearDown();
}
+ @SmallTest
public void testTurnOnProximityWithCallsActive() throws Exception {
when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>(){{
add(mCall);
@@ -66,6 +68,7 @@
verify(mWakeLockAdapter).acquire();
}
+ @SmallTest
public void testTurnOnProximityWithNoCallsActive() throws Exception {
when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>());
when(mWakeLockAdapter.isHeld()).thenReturn(false);
@@ -76,6 +79,7 @@
}
+ @SmallTest
public void testTurnOffProximityExplicitly() throws Exception {
when(mWakeLockAdapter.isHeld()).thenReturn(true);
@@ -84,6 +88,7 @@
verify(mWakeLockAdapter).release(0);
}
+ @SmallTest
public void testCallRemovedFromCallsManagerCallsActive() throws Exception {
when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>(){{
add(mCall);
@@ -95,6 +100,7 @@
verify(mWakeLockAdapter, never()).release(0);
}
+ @SmallTest
public void testCallRemovedFromCallsManagerNoCallsActive() throws Exception {
when(mCallsManager.getCalls()).thenReturn(new ArrayList<Call>());
when(mWakeLockAdapter.isHeld()).thenReturn(true);
diff --git a/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java b/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
index 02e7ecf..ad740f4 100644
--- a/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
+++ b/tests/src/com/android/server/telecom/tests/SystemStateProviderTest.java
@@ -26,6 +26,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
+import android.test.suitebuilder.annotation.SmallTest;
import com.android.server.telecom.SystemStateProvider;
import com.android.server.telecom.SystemStateProvider.SystemStateListener;
@@ -58,6 +59,7 @@
super.tearDown();
}
+ @SmallTest
public void testListeners() throws Exception {
SystemStateProvider systemStateProvider = new SystemStateProvider(mContext);
@@ -67,18 +69,21 @@
assertFalse(systemStateProvider.removeListener(mSystemStateListener));
}
+ @SmallTest
public void testQuerySystemForCarMode_True() {
when(mContext.getSystemService(Context.UI_MODE_SERVICE)).thenReturn(mUiModeManager);
when(mUiModeManager.getCurrentModeType()).thenReturn(Configuration.UI_MODE_TYPE_CAR);
assertTrue(new SystemStateProvider(mContext).isCarMode());
}
+ @SmallTest
public void testQuerySystemForCarMode_False() {
when(mContext.getSystemService(Context.UI_MODE_SERVICE)).thenReturn(mUiModeManager);
when(mUiModeManager.getCurrentModeType()).thenReturn(Configuration.UI_MODE_TYPE_NORMAL);
assertFalse(new SystemStateProvider(mContext).isCarMode());
}
+ @SmallTest
public void testReceiverAndIntentFilter() {
ArgumentCaptor<IntentFilter> intentFilter = ArgumentCaptor.forClass(IntentFilter.class);
new SystemStateProvider(mContext);
@@ -89,6 +94,7 @@
assertEquals(UiModeManager.ACTION_EXIT_CAR_MODE, intentFilter.getValue().getAction(1));
}
+ @SmallTest
public void testOnEnterExitCarMode() {
ArgumentCaptor<BroadcastReceiver> receiver =
ArgumentCaptor.forClass(BroadcastReceiver.class);