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

Commit c537bfa8 authored by songferngwang's avatar songferngwang
Browse files

Remove the new task for mobile network page starts the sim onboarding

Bug: 349695880
Test: manually test
Flag: EXEMPT bugfix
Change-Id: Id5f35a9311da5e47f0417a45feadb1d1a0a2e35d
parent b21b6290
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public class NetworkProviderSimListController extends BasePreferenceController i
                    if (!info.isEmbedded && !isActiveSubscriptionId
                            && !SubscriptionUtil.showToggleForPhysicalSim(mSubscriptionManager)) {
                        SubscriptionUtil.startToggleSubscriptionDialogActivity(mContext, subId,
                                true);
                                true, false);
                    } else {
                        MobileNetworkUtils.launchMobileNetworkSettings(mContext, info);
                    }
+4 −1
Original line number Diff line number Diff line
@@ -588,11 +588,14 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
        fun startSimOnboardingActivity(
            context: Context,
            subId: Int,
            isNewTask: Boolean = false,
        ) {
            val intent = Intent(context, SimOnboardingActivity::class.java).apply {
                putExtra(SUB_ID, subId)
                if(isNewTask) {
                    setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                }
            }
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(intent)
        }

+9 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.telephony.UiccSlotInfo.CARD_STATE_INFO_PRESENT;
import static com.android.internal.util.CollectionUtils.emptyIfNull;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkCapabilities;
@@ -515,18 +516,23 @@ public class SubscriptionUtil {
     * @param context {@code Context}
     * @param subId The id of subscription need to be enabled or disabled.
     * @param enable Whether the subscription with {@code subId} should be enabled or disabled.
     * @param isNewTask Whether the start activity add the new task or not
     */
    public static void startToggleSubscriptionDialogActivity(
            Context context, int subId, boolean enable) {
            Context context, int subId, boolean enable, boolean isNewTask) {
        if (!SubscriptionManager.isUsableSubscriptionId(subId)) {
            Log.i(TAG, "Unable to toggle subscription due to invalid subscription ID.");
            return;
        }
        if (enable && Flags.isDualSimOnboardingEnabled()) {
            SimOnboardingActivity.startSimOnboardingActivity(context, subId);
            SimOnboardingActivity.startSimOnboardingActivity(context, subId, isNewTask);
            return;
        }
        context.startActivity(ToggleSubscriptionDialogActivity.getIntent(context, subId, enable));
        Intent intent = ToggleSubscriptionDialogActivity.getIntent(context, subId, enable);
        if (isNewTask) {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        context.startActivity(intent);
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
        Intent intent = new Intent(context, ToggleSubscriptionDialogActivity.class);
        intent.putExtra(ARG_SUB_ID, subId);
        intent.putExtra(ARG_enable, enable);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        return intent;
    }

+1 −1
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ public class SimSlotChangeHandler {
            return;
        }
        Log.d(TAG, "Start ToggleSubscriptionDialogActivity with " + subId + " under DSDS+Mep.");
        SubscriptionUtil.startToggleSubscriptionDialogActivity(mContext, subId, true);
        SubscriptionUtil.startToggleSubscriptionDialogActivity(mContext, subId, true, true);
    }

    private boolean isMultipleEnabledProfilesSupported() {