Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a8df2c5 authored by sandeepjs's avatar sandeepjs
Browse files

Duplicate Data Selection Dialog during SUW

During SetupWizard in default SS devices we had only one active subscription,
for default DSDS devices we have 2 active Subscriptions so a dialog is being displayed to select default data during SuW as well as a full screen activity.
so during SuW we are hiding the Dialog to select default data.

Test: atest MultiSimSettingControllerTest
Test: manual test
Bug: 228130260
Change-Id: I3ede490bf08ffbb1d23f49d36e13b866ae872842
parent 41aabfd2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -725,8 +725,12 @@ public class MultiSimSettingController extends Handler {
                && (!dataSelected || !smsSelected || !voiceSelected)) {
            dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL;
        } else if (mPrimarySubList.size() > 1 && (isUserVisibleChange(change)
                || (change == PRIMARY_SUB_INITIALIZED && !dataSelected))) {
                || (change == PRIMARY_SUB_INITIALIZED && !dataSelected
                && Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.DEVICE_PROVISIONED, 0) != 0))) {
            // If change is SWAPPED_IN_GROUP or MARKED_OPPT, don't ask user again.
            // In default DSDS devices, do not show data selection dialog during SuW as there is
            // fullscreen activity to choose data preference.
            dialogType = EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DATA;
        }

+29 −0
Original line number Diff line number Diff line
@@ -462,6 +462,35 @@ public class MultiSimSettingControllerTest extends TelephonyTest {
        verify(mDataEnabledSettingsMock2, times(1)).setDataEnabled(anyInt(), anyBoolean());
    }

    @Test
    @SmallTest
    public void testSimpleDsdsInSuW() {
        // at first boot default is not set
        doReturn(-1).when(mSubControllerMock).getDefaultDataSubId();

        doReturn(true).when(mPhoneMock1).isUserDataEnabled();
        doReturn(true).when(mPhoneMock2).isUserDataEnabled();
        // setting DEVICE_PROVISIONED as 0 to indicate SuW is running.
        Settings.Global.putInt(mContext.getContentResolver(),
                Settings.Global.DEVICE_PROVISIONED, 0);
        // After initialization, sub 2 should have mobile data off.
        mMultiSimSettingControllerUT.notifyAllSubscriptionLoaded();
        mMultiSimSettingControllerUT.notifyCarrierConfigChanged(0, 1);
        mMultiSimSettingControllerUT.notifyCarrierConfigChanged(1, 2);
        processAllMessages();
        verify(mDataEnabledSettingsMock1).setDataEnabled(
                TelephonyManager.DATA_ENABLED_REASON_USER, false);
        verify(mDataEnabledSettingsMock2).setDataEnabled(
                TelephonyManager.DATA_ENABLED_REASON_USER, false);

        // as a result of the above calls, update new values to be returned
        doReturn(false).when(mPhoneMock1).isUserDataEnabled();
        doReturn(false).when(mPhoneMock2).isUserDataEnabled();

        // No user selection needed, no intent should be sent.
        verify(mContext, never()).sendBroadcast(any());
    }

    @Test
    @SmallTest
    public void testDsdsGrouping() {