diff options
6 files changed, 53 insertions, 6 deletions
diff --git a/Android.bp b/Android.bp index 892a48a46d..5b684d2362 100644 --- a/Android.bp +++ b/Android.bp @@ -107,6 +107,7 @@ java_library { "net-utils-framework-common", "telephony-protos", "modules-utils-build_system", + "modules-utils-fastxmlserializer", "modules-utils-statemachine", ], @@ -17,6 +17,5 @@ tjstuart@google.com tnd@google.com xiaotonj@google.com - - - +# Domain Selection code is co-owned, adding additional owners for this code +per-file EmergencyStateTracker*=hwangoo@google.com,forestchoi@google.com,avinashmp@google.com,mkoon@google.com,seheele@google.com diff --git a/src/java/com/android/internal/telephony/data/PhoneSwitcher.java b/src/java/com/android/internal/telephony/data/PhoneSwitcher.java index 5e13f6b74e..d2fdf4abb9 100644 --- a/src/java/com/android/internal/telephony/data/PhoneSwitcher.java +++ b/src/java/com/android/internal/telephony/data/PhoneSwitcher.java @@ -1776,7 +1776,7 @@ public class PhoneSwitcher extends Handler { // If validation feature is not supported, set it directly. Otherwise, // start validation on the subscription first. if (!mValidator.isValidationFeatureSupported()) { - setAutoSelectedDataSubIdInternal(subIdToValidate); + setAutoSelectedDataSubIdInternal(subId); sendSetOpptCallbackHelper(callback, SET_OPPORTUNISTIC_SUB_SUCCESS); return; } diff --git a/src/java/com/android/internal/telephony/domainselection/OWNERS b/src/java/com/android/internal/telephony/domainselection/OWNERS new file mode 100644 index 0000000000..b9112be19b --- /dev/null +++ b/src/java/com/android/internal/telephony/domainselection/OWNERS @@ -0,0 +1,8 @@ +# automatically inherit owners from fw/opt/telephony + +hwangoo@google.com +forestchoi@google.com +avinashmp@google.com +mkoon@google.com +seheele@google.com +radhikaagrawal@google.com diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java index bc691f62b8..0eba3fe96f 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/data/PhoneSwitcherTest.java @@ -865,6 +865,37 @@ public class PhoneSwitcherTest extends TelephonyTest { } @Test + public void testSetAutoSelectedValidationFeatureNotSupported() throws Exception { + doReturn(false).when(mCellularNetworkValidator).isValidationFeatureSupported(); + initialize(); + + // Phone 0 has sub 1, phone 1 has sub 2. + // Sub 1 is default data sub. + // Both are active subscriptions are active sub, as they are in both active slots. + setSlotIndexToSubId(0, 1); + setSlotIndexToSubId(1, 2); + setDefaultDataSubId(1); + + doReturn(new SubscriptionInfoInternal.Builder(mSubscriptionManagerService + .getSubscriptionInfoInternal(2)).setOpportunistic(1).build()) + .when(mSubscriptionManagerService).getSubscriptionInfoInternal(2); + + mPhoneSwitcherUT.trySetOpportunisticDataSubscription(2, false, mSetOpptDataCallback1); + processAllMessages(); + mPhoneSwitcherUT.mValidationCallback.onNetworkAvailable(null, 2); + processAllMessages(); + assertEquals(2, mPhoneSwitcherUT.getAutoSelectedDataSubId()); + + // Switch to the default sub, verify AutoSelectedDataSubId is the default value. + clearInvocations(mSetOpptDataCallback1); + mPhoneSwitcherUT.trySetOpportunisticDataSubscription(SubscriptionManager + .DEFAULT_SUBSCRIPTION_ID, true, mSetOpptDataCallback1); + processAllMessages(); + assertEquals(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, + mPhoneSwitcherUT.getAutoSelectedDataSubId()); + } + + @Test @SmallTest public void testSetPreferredDataModemCommand() throws Exception { doReturn(true).when(mMockRadioConfig).isSetPreferredDataCommandSupported(); @@ -1540,7 +1571,7 @@ public class PhoneSwitcherTest extends TelephonyTest { .when(mSubscriptionManagerService).getSubscriptionInfoInternal(2); // Switch to primary before a primary is selected/inactive. - setDefaultDataSubId(-1); + setDefaultDataSubId(SubscriptionManager.INVALID_SUBSCRIPTION_ID); mPhoneSwitcherUT.trySetOpportunisticDataSubscription( SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, false, mSetOpptDataCallback1); processAllMessages(); @@ -2158,7 +2189,7 @@ public class PhoneSwitcherTest extends TelephonyTest { doReturn(true).when(mDataConfigManager).isPingTestBeforeAutoDataSwitchRequired(); } - private void setDefaultDataSubId(int defaultDataSub) throws Exception { + private void setDefaultDataSubId(int defaultDataSub) { mDefaultDataSub = defaultDataSub; doReturn(mDefaultDataSub).when(mSubscriptionManagerService).getDefaultDataSubId(); if (defaultDataSub == 1) { diff --git a/tests/telephonytests/src/com/android/internal/telephony/domainselection/OWNERS b/tests/telephonytests/src/com/android/internal/telephony/domainselection/OWNERS new file mode 100644 index 0000000000..b9112be19b --- /dev/null +++ b/tests/telephonytests/src/com/android/internal/telephony/domainselection/OWNERS @@ -0,0 +1,8 @@ +# automatically inherit owners from fw/opt/telephony + +hwangoo@google.com +forestchoi@google.com +avinashmp@google.com +mkoon@google.com +seheele@google.com +radhikaagrawal@google.com |