Revert the change to fix the failed unit test cases
Jack Yu [Sat, 1 Apr 2017 19:29:23 +0000 (12:29 -0700)]
Also fixed some typos.

Test: telephony unit tests
bug: 29579544
Change-Id: Ia7e867c5f1723f528ed543e7da3a5254ae7b7729

src/java/com/android/internal/telephony/dataconnection/DataConnection.java
src/java/com/android/internal/telephony/dataconnection/DcTracker.java
tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java

index c1995b1..ab2804c 100644 (file)
@@ -816,7 +816,7 @@ public class DataConnection extends StateMachine {
      *
      * This gets set once per connection setup and is based on conditions at that time.
      * We could theoretically have dynamic capabilities but now is not a good time to
-     * experiement with that.
+     * experiment with that.
      *
      * This flag overrides the APN-based restriction capability, restricting the network
      * based on both having a NetworkRequest with restricted AND needing a restricted
index dfbe7ae..ded0637 100644 (file)
@@ -1556,7 +1556,7 @@ public class DcTracker extends Handler {
         boolean isEmergencyApn = apnContext.getApnType().equals(PhoneConstants.APN_TYPE_EMERGENCY);
         final ServiceStateTracker sst = mPhone.getServiceStateTracker();
 
-        // set to false if apn type is non-metered or if we have a restricted (priveleged)
+        // set to false if apn type is non-metered or if we have a restricted (privileged)
         // request for the network.
         // TODO - may want restricted requests to only apply to carrier-limited data access
         //        rather than applying to user limited as well.
index c1d0403..17ed49e 100644 (file)
@@ -28,7 +28,6 @@ import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.nullable;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
@@ -705,9 +704,6 @@ public class DcTrackerTest extends TelephonyTest {
         mDct.setDataEnabled(true);
 
         waitForMs(200);
-        verify(mSimulatedCommandsVerifier, times(1)).setInitialAttachApn(any(DataProfile.class),
-                eq(true), nullable(Message.class));
-
         ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
         verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(
                 eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
@@ -717,6 +713,11 @@ public class DcTrackerTest extends TelephonyTest {
         assertEquals(DctConstants.State.CONNECTED, mDct.getOverallState());
         assertEquals(DctConstants.State.IDLE, mDct.getState(PhoneConstants.APN_TYPE_DEFAULT));
         assertEquals(DctConstants.State.CONNECTED, mDct.getState(PhoneConstants.APN_TYPE_IMS));
+
+        // reset roaming settings / data enabled settings at end of this test
+        mDct.setDataOnRoamingEnabled(roamingEnabled);
+        mDct.setDataEnabled(dataEnabled);
+        waitForMs(200);
     }
 
     // Test the default data switch scenario.