Mark flaky presubmit tests as @Postsubmit

Previously tests passing <95% of the time were considered flaky. Now we
mark any test passing <99% of the time as flaky.
Also increase wait time before assert in switchToCdma which was failing
inconsistently.

Bug: 31041734
Change-Id: Ibb353c99049b049f57d0f67b5027278d58c5f69b
diff --git a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaCallTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaCallTrackerTest.java
index 4bcb5f8..ec05ee9 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaCallTrackerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaCallTrackerTest.java
@@ -16,6 +16,7 @@
 package com.android.internal.telephony;
 
 import android.os.HandlerThread;
+import android.platform.test.annotations.Postsubmit;
 import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
 import android.telephony.ServiceState;
@@ -175,6 +176,7 @@
 
     }
 
+    @Postsubmit
     @Test
     @MediumTest
     public void testMOCallPendingHangUp() {
diff --git a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
index 103da3d..fdc3289 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java
@@ -105,7 +105,7 @@
         mPhoneUT.sendMessage(mPhoneUT.obtainMessage(GsmCdmaPhone.EVENT_VOICE_RADIO_TECH_CHANGED,
                 new AsyncResult(null, new int[]{ServiceState.RIL_RADIO_TECHNOLOGY_IS95A}, null)));
         //wait for voice RAT to be updated
-        waitForMs(50);
+        waitForMs(100);
         assertEquals(PhoneConstants.PHONE_TYPE_CDMA, mPhoneUT.getPhoneType());
     }
 
diff --git a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java
index 528b4aa..a8f16d9 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java
@@ -28,6 +28,7 @@
 import android.os.Parcel;
 import android.os.SystemClock;
 import android.os.UserHandle;
+import android.platform.test.annotations.Postsubmit;
 import android.telephony.CellInfo;
 import android.telephony.CellInfoGsm;
 import android.telephony.ServiceState;
@@ -312,6 +313,7 @@
         assertFalse(sst.isImsRegistered());
     }
 
+    @Postsubmit
     @Test
     @MediumTest
     public void testSignalStrength() {
@@ -876,4 +878,4 @@
         waitForMs(100);
         verify(mAlarmManager, times(1)).setTime(anyLong());
     }
-}
\ No newline at end of file
+}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java
index 0cd750b..4298262 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java
@@ -31,6 +31,7 @@
 import android.os.IBinder;
 import android.os.Message;
 import android.os.PersistableBundle;
+import android.platform.test.annotations.Postsubmit;
 import android.provider.Settings;
 import android.provider.Telephony;
 import android.telephony.CarrierConfigManager;
@@ -655,6 +656,7 @@
         waitForMs(200);
     }
 
+    @Postsubmit
     @Test
     @MediumTest
     public void testDataCallOnUserDisableRoaming() throws Exception {
@@ -765,6 +767,7 @@
     }
 
     // Test for API carrierActionSetMeteredApnsEnabled.
+    @Postsubmit
     @Test
     @MediumTest
     public void testCarrierActionSetMeteredApnsEnabled() throws Exception {
diff --git a/tests/telephonytests/src/com/android/internal/telephony/dataconnection/TelephonyNetworkFactoryTest.java b/tests/telephonytests/src/com/android/internal/telephony/dataconnection/TelephonyNetworkFactoryTest.java
index 5ff26e2..60c8a0e 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/dataconnection/TelephonyNetworkFactoryTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/dataconnection/TelephonyNetworkFactoryTest.java
@@ -33,6 +33,7 @@
 import android.os.HandlerThread;
 import android.os.Looper;
 import android.os.Message;
+import android.platform.test.annotations.Postsubmit;
 import android.net.ConnectivityManager;
 import android.net.IConnectivityManager;
 import android.net.NetworkCapabilities;
@@ -133,6 +134,7 @@
     /**
      * Test that phone active changes cause the DcTracker to get poked.
      */
+    @Postsubmit
     @SmallTest
     public void testActive() throws Exception {
         mTestName = "testActive";
diff --git a/tests/telephonytests/src/com/android/internal/telephony/gsm/GsmInboundSmsHandlerTest.java b/tests/telephonytests/src/com/android/internal/telephony/gsm/GsmInboundSmsHandlerTest.java
index 9729729..ddabe90 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/gsm/GsmInboundSmsHandlerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/gsm/GsmInboundSmsHandlerTest.java
@@ -29,6 +29,7 @@
 import android.os.RemoteException;
 import android.os.UserHandle;
 import android.os.UserManager;
+import android.platform.test.annotations.Postsubmit;
 import android.provider.Telephony;
 import android.test.mock.MockContentResolver;
 import android.test.suitebuilder.annotation.MediumTest;
@@ -351,6 +352,7 @@
         doReturn(mInboundSmsTrackerCVPart2).when(mInboundSmsTrackerPart2).getContentValues();
     }
 
+    @Postsubmit
     @Test
     @MediumTest
     public void testMultiPartSms() {
@@ -573,6 +575,7 @@
 
     }
 
+    @Postsubmit
     @Test
     @MediumTest
     public void testBroadcastUndeliveredMultiPart() throws Exception {