Loading src/java/com/android/internal/telephony/dataconnection/DataConnectionReasons.java +3 −3 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ public class DataConnectionReasons { // Soft failure reasons. Normally the reasons from users or policy settings. DATA_DISABLED(false), // Data is disabled by the user or policy. ROAMING_DISABLED(false), // Data roaming is disabled by the user. DEFAULT_DATA_UNSELECTED(false), // Default data not selected. // Belows are all hard failure reasons. NOT_ATTACHED(true), Loading @@ -111,7 +112,6 @@ public class DataConnectionReasons { PS_RESTRICTED(true), UNDESIRED_POWER_STATE(true), INTERNAL_DATA_DISABLED(true), DEFAULT_DATA_UNSELECTED(true), RADIO_DISABLED_BY_CARRIER(true), APN_NOT_CONNECTABLE(true), ON_IWLAN(true), Loading tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java +27 −1 Original line number Diff line number Diff line Loading @@ -626,6 +626,33 @@ public class DcTrackerTest extends TelephonyTest { } } // Test the unmetered APN setup when data is disabled. @Test @SmallTest public void testTrySetupDataUnmeteredDefaultNotSelected() throws Exception { initApns(PhoneConstants.APN_TYPE_FOTA, new String[]{PhoneConstants.APN_TYPE_ALL}); doReturn(SubscriptionManager.INVALID_SUBSCRIPTION_ID).when(mIsub).getDefaultDataSubId(); mBundle.putStringArray(CarrierConfigManager.KEY_CARRIER_METERED_APN_TYPES_STRINGS, new String[]{PhoneConstants.APN_TYPE_DEFAULT}); logd("Sending EVENT_RECORDS_LOADED"); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_RECORDS_LOADED, null)); waitForMs(200); logd("Sending EVENT_DATA_CONNECTION_ATTACHED"); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_DATA_CONNECTION_ATTACHED, null)); waitForMs(200); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_TRY_SETUP_DATA, mApnContext)); waitForMs(200); verify(mSimulatedCommandsVerifier, times(1)).setupDataCall( eq(AccessNetworkType.EUTRAN), any(DataProfile.class), eq(false), eq(false), eq(DataService.REQUEST_REASON_NORMAL), any(), any(Message.class)); } // Test the normal data call setup scenario. @Test @MediumTest Loading Loading @@ -782,7 +809,6 @@ public class DcTrackerTest extends TelephonyTest { assertEquals(DctConstants.State.CONNECTED, mDct.getState(PhoneConstants.APN_TYPE_IMS)); } @Test @MediumTest public void testTrySetupDataMmsAllowedDataDisabled() throws Exception { Loading Loading
src/java/com/android/internal/telephony/dataconnection/DataConnectionReasons.java +3 −3 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ public class DataConnectionReasons { // Soft failure reasons. Normally the reasons from users or policy settings. DATA_DISABLED(false), // Data is disabled by the user or policy. ROAMING_DISABLED(false), // Data roaming is disabled by the user. DEFAULT_DATA_UNSELECTED(false), // Default data not selected. // Belows are all hard failure reasons. NOT_ATTACHED(true), Loading @@ -111,7 +112,6 @@ public class DataConnectionReasons { PS_RESTRICTED(true), UNDESIRED_POWER_STATE(true), INTERNAL_DATA_DISABLED(true), DEFAULT_DATA_UNSELECTED(true), RADIO_DISABLED_BY_CARRIER(true), APN_NOT_CONNECTABLE(true), ON_IWLAN(true), Loading
tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java +27 −1 Original line number Diff line number Diff line Loading @@ -626,6 +626,33 @@ public class DcTrackerTest extends TelephonyTest { } } // Test the unmetered APN setup when data is disabled. @Test @SmallTest public void testTrySetupDataUnmeteredDefaultNotSelected() throws Exception { initApns(PhoneConstants.APN_TYPE_FOTA, new String[]{PhoneConstants.APN_TYPE_ALL}); doReturn(SubscriptionManager.INVALID_SUBSCRIPTION_ID).when(mIsub).getDefaultDataSubId(); mBundle.putStringArray(CarrierConfigManager.KEY_CARRIER_METERED_APN_TYPES_STRINGS, new String[]{PhoneConstants.APN_TYPE_DEFAULT}); logd("Sending EVENT_RECORDS_LOADED"); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_RECORDS_LOADED, null)); waitForMs(200); logd("Sending EVENT_DATA_CONNECTION_ATTACHED"); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_DATA_CONNECTION_ATTACHED, null)); waitForMs(200); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_TRY_SETUP_DATA, mApnContext)); waitForMs(200); verify(mSimulatedCommandsVerifier, times(1)).setupDataCall( eq(AccessNetworkType.EUTRAN), any(DataProfile.class), eq(false), eq(false), eq(DataService.REQUEST_REASON_NORMAL), any(), any(Message.class)); } // Test the normal data call setup scenario. @Test @MediumTest Loading Loading @@ -782,7 +809,6 @@ public class DcTrackerTest extends TelephonyTest { assertEquals(DctConstants.State.CONNECTED, mDct.getState(PhoneConstants.APN_TYPE_IMS)); } @Test @MediumTest public void testTrySetupDataMmsAllowedDataDisabled() throws Exception { Loading