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

Commit 6f72f454 authored by SongFerng Wang's avatar SongFerng Wang Committed by Android (Google) Code Review
Browse files

Merge "Remove the new task for mobile network page starts the sim onboarding" into main

parents fd7258ea c537bfa8
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() {