diff --git a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
index e9cf022..7f5297a 100644
--- a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
@@ -32,6 +32,7 @@
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.VideoProfile;
+import android.test.suitebuilder.annotation.MediumTest;
 
 import com.android.server.telecom.Call;
 import com.android.server.telecom.CallLogManager;
@@ -131,6 +132,7 @@
         when(userManager.getUserInfo(eq(MANAGED_USER_ID))).thenReturn(managedProfileUserInfo);
     }
 
+    @MediumTest
     public void testDontLogCancelledCall() {
         Call fakeCall = makeFakeCall(
                 DisconnectCause.CANCELED,
@@ -150,6 +152,7 @@
         verifyNoInsertion();
     }
 
+    @MediumTest
     public void testDontLogChoosingAccountCall() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -170,6 +173,7 @@
         verifyNoInsertion();
     }
 
+    @MediumTest
     public void testDontLogCallsFromEmergencyAccount() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(EMERGENCY_ACCT_HANDLE, 0));
@@ -191,6 +195,7 @@
         verifyNoInsertion();
     }
 
+    @MediumTest
     public void testLogCallDirectionOutgoing() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -213,6 +218,7 @@
                 Integer.valueOf(CallLog.Calls.OUTGOING_TYPE));
     }
 
+    @MediumTest
     public void testLogCallDirectionIncoming() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -235,6 +241,7 @@
                 Integer.valueOf(CallLog.Calls.INCOMING_TYPE));
     }
 
+    @MediumTest
     public void testLogCallDirectionMissed() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -258,6 +265,7 @@
                 Integer.valueOf(CallLog.Calls.MISSED_TYPE));
     }
 
+    @MediumTest
     public void testCreationTimeAndAge() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -283,6 +291,7 @@
                 Long.valueOf(duration / 1000));
     }
 
+    @MediumTest
     public void testLogPhoneAccountId() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -304,6 +313,7 @@
                 TEST_PHONE_ACCOUNT_ID);
     }
 
+    @MediumTest
     public void testLogCorrectPhoneNumber() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -326,6 +336,7 @@
         assertEquals(insertedValues.getAsString(CallLog.Calls.POST_DIAL_DIGITS), POST_DIAL_STRING);
     }
 
+    @MediumTest
     public void testLogCallVideoFeatures() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -347,6 +358,7 @@
                 & CallLog.Calls.FEATURES_VIDEO) == CallLog.Calls.FEATURES_VIDEO);
     }
 
+    @MediumTest
     public void testLogCallDirectionOutgoingWithMultiUserCapability() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mOtherUserAccountHandle,
@@ -377,6 +389,7 @@
         verifyNoInsertionInUser(MANAGED_USER_ID);
     }
 
+    @MediumTest
     public void testLogCallDirectionIncomingWithMultiUserCapability() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mOtherUserAccountHandle,
@@ -407,7 +420,7 @@
         verifyNoInsertionInUser(MANAGED_USER_ID);
     }
 
-
+    @MediumTest
     public void testLogCallDirectionOutgoingWithMultiUserCapabilityFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle,
@@ -435,6 +448,7 @@
                 Integer.valueOf(CallLog.Calls.OUTGOING_TYPE));
     }
 
+    @MediumTest
     public void testLogCallDirectionOutgoingFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle, 0));
@@ -462,6 +476,7 @@
                 Integer.valueOf(CallLog.Calls.OUTGOING_TYPE));
     }
 
+    @MediumTest
     public void testLogCallDirectionIngoingFromManagedProfile() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mManagedProfileAccountHandle, 0));
@@ -492,6 +507,7 @@
     /**
      * Ensure call data usage is persisted to the call log when present in the call.
      */
+    @MediumTest
     public void testLogCallDataUsageSet() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
@@ -516,6 +532,7 @@
     /**
      * Ensures call data usage is null in the call log when not set on the call.
      */
+    @MediumTest
     public void testLogCallDataUsageNotSet() {
         when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
                 .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
diff --git a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
index 07ae122..363d613 100644
--- a/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
+++ b/tests/src/com/android/server/telecom/tests/ContactsAsyncHelperTest.java
@@ -21,6 +21,7 @@
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.server.telecom.ContactsAsyncHelper;
 
@@ -85,6 +86,7 @@
         super.setUp();
     }
 
+    @SmallTest
     public void testEmptyUri() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mNullContentResolverAdapter);
         try {
@@ -96,6 +98,7 @@
                 any(Drawable.class), any(Bitmap.class), anyObject());
     }
 
+    @SmallTest
     public void testNullReturnFromOpenInputStream() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mNullContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI, mListener, COOKIE);
@@ -104,6 +107,7 @@
                 isNull(Drawable.class), isNull(Bitmap.class), eq(COOKIE));
     }
 
+    @SmallTest
     public void testImageScaling() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mWorkingContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI, mListener, COOKIE);
@@ -122,6 +126,7 @@
         assertTrue(iconSize >= iconCaptor.getValue().getWidth());
     }
 
+    @SmallTest
     public void testNoScaling() {
         ContactsAsyncHelper cah = new ContactsAsyncHelper(mWorkingContentResolverAdapter);
         cah.startObtainPhotoAsync(TOKEN, mContext, SAMPLE_CONTACT_PHOTO_URI_SMALL,
diff --git a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
index 462593b..17ca5b9 100644
--- a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
+++ b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
@@ -31,6 +31,7 @@
 import android.telecom.TelecomManager;
 import android.telecom.VideoProfile;
 import android.telephony.DisconnectCause;
+import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.server.telecom.Call;
 import com.android.server.telecom.CallsManager;
@@ -76,6 +77,7 @@
         mPhoneNumberUtilsAdapterSpy = spy(new PhoneNumberUtilsAdapterImpl());
     }
 
+    @SmallTest
     public void testNullHandle() {
         Intent intent = new Intent(Intent.ACTION_CALL, null);
         int result = processIntent(intent, true);
@@ -84,6 +86,7 @@
         verifyNoCallPlaced();
     }
 
+    @SmallTest
     public void testVoicemailCall() {
         String voicemailNumber = "voicemail:18005551234";
         Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(voicemailNumber));
@@ -96,14 +99,17 @@
                 any(GatewayInfo.class), eq(true), eq(VideoProfile.STATE_AUDIO_ONLY));
     }
 
+    @SmallTest
     public void testVoicemailCallWithBadAction() {
         badCallActionHelper(Uri.parse("voicemail:18005551234"), DisconnectCause.OUTGOING_CANCELED);
     }
 
+    @SmallTest
     public void testTelCallWithBadCallAction() {
         badCallActionHelper(Uri.parse("tel:6505551234"), DisconnectCause.INVALID_NUMBER);
     }
 
+    @SmallTest
     public void testSipCallWithBadCallAction() {
         badCallActionHelper(Uri.parse("sip:testuser@testsite.com"), DisconnectCause.INVALID_NUMBER);
     }
@@ -118,6 +124,7 @@
         verifyNoCallPlaced();
     }
 
+    @SmallTest
     public void testNoNumberSupplied() {
         Uri handle = Uri.parse("tel:");
         Intent intent = new Intent(Intent.ACTION_CALL, handle);
@@ -129,7 +136,7 @@
         verifyNoCallPlaced();
     }
 
-
+    @SmallTest
     public void testEmergencyCallWithNonDefaultDialer() {
         Uri handle = Uri.parse("tel:6505551911");
         doReturn(true).when(mPhoneNumberUtilsAdapterSpy).isPotentialLocalEmergencyNumber(
@@ -158,24 +165,28 @@
         assertEquals(Intent.FLAG_ACTIVITY_NEW_TASK, dialerIntent.getFlags());
     }
 
+    @SmallTest
     public void testActionCallEmergencyCall() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL, null);
         emergencyCallTestHelper(intent, null);
     }
 
+    @SmallTest
     public void testActionEmergencyWithEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL_EMERGENCY, null);
         emergencyCallTestHelper(intent, null);
     }
 
+    @SmallTest
     public void testActionPrivCallWithEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         Intent intent = buildIntent(handle, Intent.ACTION_CALL_PRIVILEGED, null);
         emergencyCallTestHelper(intent, null);
     }
 
+    @SmallTest
     public void testEmergencyCallWithGatewayExtras() {
         Uri handle = Uri.parse("tel:6505551911");
         Bundle gatewayExtras = new Bundle();
@@ -187,6 +198,7 @@
         emergencyCallTestHelper(intent, gatewayExtras);
     }
 
+    @SmallTest
     public void testActionEmergencyWithNonEmergencyNumber() {
         Uri handle = Uri.parse("tel:6505551911");
         doReturn(false).when(mPhoneNumberUtilsAdapterSpy).isPotentialLocalEmergencyNumber(
@@ -222,6 +234,7 @@
         assertNull(receiver);
     }
 
+    @SmallTest
     public void testUnmodifiedRegularCall() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -236,6 +249,7 @@
                 eq(true), eq(VideoProfile.STATE_BIDIRECTIONAL));
     }
 
+    @SmallTest
     public void testUnmodifiedSipCall() {
         Uri handle = Uri.parse("sip:test@test.com");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -252,6 +266,7 @@
                 eq(true), eq(VideoProfile.STATE_BIDIRECTIONAL));
     }
 
+    @SmallTest
     public void testCallWithGatewayInfo() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -270,6 +285,7 @@
                 isNotNull(GatewayInfo.class), eq(true), eq(VideoProfile.STATE_BIDIRECTIONAL));
     }
 
+    @SmallTest
     public void testCallNumberModifiedToNull() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
@@ -282,6 +298,7 @@
         verify(mCall).disconnect(true);
     }
 
+    @SmallTest
     public void testCallModifiedToEmergency() {
         Uri handle = Uri.parse("tel:6505551234");
         Intent callIntent = buildIntent(handle, Intent.ACTION_CALL, null);
diff --git a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
index e49e986..d0b723a 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
@@ -38,6 +38,7 @@
 import android.telecom.TelecomManager;
 import android.telecom.VideoProfile;
 import android.telephony.TelephonyManager;
+import android.test.suitebuilder.annotation.SmallTest;
 
 import com.android.internal.telecom.ITelecomService;
 import com.android.server.telecom.Call;
@@ -203,6 +204,7 @@
                 .isDefaultOrSystemDialer(any(Context.class), eq(DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetDefaultOutgoingPhoneAccount() throws RemoteException {
         when(mFakePhoneAccountRegistrar
                 .getOutgoingPhoneAccountForScheme(eq("tel"), any(UserHandle.class)))
@@ -221,6 +223,7 @@
         assertEquals(SIP_PA_HANDLE_17, returnedHandleSip);
     }
 
+    @SmallTest
     public void testGetDefaultOutgoingPhoneAccountFailure() throws RemoteException {
         // make sure that the list of user profiles doesn't include anything the PhoneAccountHandles
         // are associated with
@@ -240,6 +243,7 @@
         assertNull(returnedHandleTel);
     }
 
+    @SmallTest
     public void testGetUserSelectedOutgoingPhoneAccount() throws RemoteException {
         when(mFakePhoneAccountRegistrar.getUserSelectedOutgoingPhoneAccount(any(UserHandle.class)))
                 .thenReturn(TEL_PA_HANDLE_16);
@@ -251,12 +255,14 @@
         assertEquals(TEL_PA_HANDLE_16, returnedHandle);
     }
 
+    @SmallTest
     public void testSetUserSelectedOutgoingPhoneAccount() throws RemoteException {
         mTSIBinder.setUserSelectedOutgoingPhoneAccount(TEL_PA_HANDLE_16);
         verify(mFakePhoneAccountRegistrar)
                 .setUserSelectedOutgoingPhoneAccount(eq(TEL_PA_HANDLE_16), any(UserHandle.class));
     }
 
+    @SmallTest
     public void testSetUserSelectedOutgoingPhoneAccountFailure() throws RemoteException {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 anyString(), anyString());
@@ -270,6 +276,7 @@
                         any(PhoneAccountHandle.class), any(UserHandle.class));
     }
 
+    @SmallTest
     public void testGetCallCapablePhoneAccounts() throws RemoteException {
         List<PhoneAccountHandle> fullPHList = new ArrayList<PhoneAccountHandle>() {{
             add(TEL_PA_HANDLE_16);
@@ -295,6 +302,7 @@
                 mTSIBinder.getCallCapablePhoneAccounts(false, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetCallCapablePhoneAccountsFailure() throws RemoteException {
         List<String> enforcedPermissions = new ArrayList<String>() {{
             add(READ_PHONE_STATE);
@@ -314,6 +322,7 @@
                 .getCallCapablePhoneAccounts(anyString(), anyBoolean(), any(UserHandle.class));
     }
 
+    @SmallTest
     public void testGetPhoneAccountsSupportingScheme() throws RemoteException {
         List<PhoneAccountHandle> sipPHList = new ArrayList<PhoneAccountHandle>() {{
             add(SIP_PA_HANDLE_17);
@@ -336,6 +345,7 @@
                 mTSIBinder.getPhoneAccountsSupportingScheme("sip", DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetPhoneAccountsForPackage() throws RemoteException {
         List<PhoneAccountHandle> phoneAccountHandleList = new ArrayList<PhoneAccountHandle>() {{
             add(TEL_PA_HANDLE_16);
@@ -350,6 +360,7 @@
                         TEL_PA_HANDLE_16.getComponentName().getPackageName()));
     }
 
+    @SmallTest
     public void testGetPhoneAccount() throws RemoteException {
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_16, SIP_PA_HANDLE_17);
         assertEquals(TEL_PA_HANDLE_16, mTSIBinder.getPhoneAccount(TEL_PA_HANDLE_16)
@@ -358,6 +369,7 @@
                 .getAccountHandle());
     }
 
+    @SmallTest
     public void testGetAllPhoneAccounts() throws RemoteException {
         List<PhoneAccount> phoneAccountList = new ArrayList<PhoneAccount>() {{
             add(makePhoneAccount(TEL_PA_HANDLE_16).build());
@@ -369,6 +381,7 @@
         assertEquals(2, mTSIBinder.getAllPhoneAccounts().size());
     }
 
+    @SmallTest
     public void testRegisterPhoneAccount() throws RemoteException {
         String packageNameToUse = "com.android.officialpackage";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -380,6 +393,7 @@
         registerPhoneAccountTestHelper(phoneAccount, true);
     }
 
+    @SmallTest
     public void testRegisterPhoneAccountWithoutModifyPermission() throws RemoteException {
         // tests the case where the package does not have MODIFY_PHONE_STATE but is
         // registering its own phone account as a third-party connection service
@@ -396,6 +410,7 @@
         registerPhoneAccountTestHelper(phoneAccount, true);
     }
 
+    @SmallTest
     public void testRegisterPhoneAccountWithoutModifyPermissionFailure() throws RemoteException {
         // tests the case where the third party package should not be allowed to register a phone
         // account due to the lack of modify permission.
@@ -412,6 +427,7 @@
         registerPhoneAccountTestHelper(phoneAccount, false);
     }
 
+    @SmallTest
     public void testRegisterPhoneAccountWithoutSimSubscriptionPermissionFailure()
             throws RemoteException {
         String packageNameToUse = "com.thirdparty.connectionservice";
@@ -429,6 +445,7 @@
         registerPhoneAccountTestHelper(phoneAccount, false);
     }
 
+    @SmallTest
     public void testRegisterPhoneAccountWithoutMultiUserPermissionFailure()
             throws Exception {
         String packageNameToUse = "com.thirdparty.connectionservice";
@@ -478,6 +495,7 @@
         }
     }
 
+    @SmallTest
     public void testUnregisterPhoneAccount() throws RemoteException {
         String packageNameToUse = "com.android.officialpackage";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -499,6 +517,7 @@
         assertEquals(phHandle, intentExtras.get(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE));
     }
 
+    @SmallTest
     public void testUnregisterPhoneAccountFailure() throws RemoteException {
         String packageNameToUse = "com.thirdparty.connectionservice";
         PhoneAccountHandle phHandle = new PhoneAccountHandle(new ComponentName(
@@ -520,6 +539,7 @@
                 .sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), anyString());
     }
 
+    @SmallTest
     public void testAddNewIncomingCall() throws Exception {
         doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString());
         Bundle extras = createSampleExtras();
@@ -530,6 +550,7 @@
                 CallIntentProcessor.KEY_IS_INCOMING_CALL, extras, false);
     }
 
+    @SmallTest
     public void testAddNewIncomingCallFailure() throws Exception {
         try {
             mTSIBinder.addNewIncomingCall(TEL_PA_HANDLE_16, null);
@@ -550,6 +571,7 @@
                 .processIncomingCallIntent(any(CallsManager.class), any(Intent.class));
     }
 
+    @SmallTest
     public void testAddNewUnknownCall() throws Exception {
         doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString());
         Bundle extras = createSampleExtras();
@@ -560,6 +582,7 @@
                 CallIntentProcessor.KEY_IS_UNKNOWN_CALL, extras, true);
     }
 
+    @SmallTest
     public void testAddNewUnknownCallFailure() throws Exception {
         try {
             mTSIBinder.addNewUnknownCall(TEL_PA_HANDLE_16, null);
@@ -609,6 +632,7 @@
         }
     }
 
+    @SmallTest
     public void testPlaceCallWithNonEmergencyPermission() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -622,6 +646,7 @@
         placeCallTestHelper(handle, extras, true);
     }
 
+    @SmallTest
     public void testPlaceCallWithAppOpsOff() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -635,6 +660,7 @@
         placeCallTestHelper(handle, extras, false);
     }
 
+    @SmallTest
     public void testPlaceCallWithNoCallingPermission() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -659,6 +685,7 @@
         assertTrue(areBundlesEqual(expectedExtras, capturedIntent.getExtras()));
     }
 
+    @SmallTest
     public void testPlaceCallFailure() throws Exception {
         Uri handle = Uri.parse("tel:6505551234");
         Bundle extras = createSampleExtras();
@@ -676,6 +703,7 @@
                 .processIntent(any(Intent.class), anyString(), anyBoolean());
     }
 
+    @SmallTest
     public void testSetDefaultDialer() throws Exception {
         String packageName = "sample.package";
 
@@ -696,12 +724,14 @@
         assertEquals(packageName, packageNameExtra);
     }
 
+    @SmallTest
     public void testSetDefaultDialerNoModifyPhoneStatePermission() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 eq(MODIFY_PHONE_STATE), anyString());
         setDefaultDialerFailureTestHelper();
     }
 
+    @SmallTest
     public void testSetDefaultDialerNoWriteSecureSettingsPermission() throws Exception {
         doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
                 eq(WRITE_SECURE_SETTINGS), anyString());
@@ -721,6 +751,7 @@
         verify(mContext, never()).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class));
     }
 
+    @SmallTest
     public void testIsVoicemailNumber() throws Exception {
         String vmNumber = "010";
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_CURRENT);
@@ -731,6 +762,7 @@
                 vmNumber, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testIsVoicemailNumberAccountNotVisibleFailure() throws Exception {
         String vmNumber = "010";
 
@@ -743,6 +775,7 @@
                 .isVoiceMailNumber(TEL_PA_HANDLE_CURRENT, vmNumber, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetVoicemailNumberWithNullAccountHandle() throws Exception {
         when(mFakePhoneAccountRegistrar.getPhoneAccount(isNull(PhoneAccountHandle.class),
                 eq(Binder.getCallingUserHandle())))
@@ -758,6 +791,7 @@
         assertEquals(vmNumber, mTSIBinder.getVoiceMailNumber(null, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetVoicemailNumberWithNonNullAccountHandle() throws Exception {
         when(mFakePhoneAccountRegistrar.getPhoneAccount(eq(TEL_PA_HANDLE_CURRENT),
                 eq(Binder.getCallingUserHandle())))
@@ -775,6 +809,7 @@
                 mTSIBinder.getVoiceMailNumber(TEL_PA_HANDLE_CURRENT, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testGetLine1Number() throws Exception {
         int subId = 58374;
         String line1Number = "9482752023479";
@@ -789,6 +824,7 @@
                 mTSIBinder.getLine1Number(TEL_PA_HANDLE_CURRENT, DEFAULT_DIALER_PACKAGE));
     }
 
+    @SmallTest
     public void testEndCallWithRingingForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.RINGING);
@@ -797,6 +833,7 @@
         verify(call).reject(false, null);
     }
 
+    @SmallTest
     public void testEndCallWithNonRingingForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.ACTIVE);
@@ -805,6 +842,7 @@
         verify(call).disconnect();
     }
 
+    @SmallTest
     public void testEndCallWithNoForegroundCall() throws Exception {
         Call call = mock(Call.class);
         when(call.getState()).thenReturn(CallState.ACTIVE);
@@ -814,10 +852,12 @@
         verify(call).disconnect();
     }
 
+    @SmallTest
     public void testEndCallWithNoCalls() throws Exception {
         assertFalse(mTSIBinder.endCall());
     }
 
+    @SmallTest
     public void testAcceptRingingCall() throws Exception {
         Call call = mock(Call.class);
         when(mFakeCallsManager.getFirstCallWithState(any(int[].class)))
@@ -830,6 +870,7 @@
         verify(call).answer(fakeVideoState);
     }
 
+    @SmallTest
     public void testAcceptRingingCallWithValidVideoState() throws Exception {
         Call call = mock(Call.class);
         when(mFakeCallsManager.getFirstCallWithState(any(int[].class)))
