From 6ab74ab24ca3b21e0780d959a13e509b28e0fc23 Mon Sep 17 00:00:00 2001 From: songferngwang Date: Wed, 15 May 2024 12:06:50 +0000 Subject: [PATCH] Show sim onboarding for user when insert psim When the user inserts the psim, showing the sim onboarding for the user to setup the sim switching or the default data subscription. Bug: 336488573 Test: verify UI Change-Id: I1faab0a3166efab3f1fd82d6a69ab4d33b624556 --- .../sim/receivers/SimSlotChangeHandler.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java b/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java index be40f2961a6..8f934d7e887 100644 --- a/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java +++ b/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java @@ -108,19 +108,18 @@ public class SimSlotChangeHandler { setRemovableSimSlotState(mContext, currentRemovableSlotState); if (mTelMgr.getActiveModemCount() > 1) { - if (!Flags.isDualSimOnboardingEnabled() && !isMultipleEnabledProfilesSupported()) { - Log.d(TAG, "The device is already in DSDS mode and no MEP. Do nothing."); - return; - } if (!isRemovableSimInserted) { Log.d(TAG, "Removable Sim is not inserted in DSDS mode. Do nothing."); return; } - boolean isDdsInvalidForNewUi = Flags.isDualSimOnboardingEnabled() - && SubscriptionManager.getDefaultDataSubscriptionId() - == SubscriptionManager.INVALID_SUBSCRIPTION_ID; - if (isDdsInvalidForNewUi) { - handleRemovableSimInsertWhenDsdsAndNoDds(); + + if (Flags.isDualSimOnboardingEnabled()) { + // ForNewUi, when the user inserts the psim, showing the sim onboarding for the user + // to setup the sim switching or the default data subscription. + handleRemovableSimInsertWhenDsds(); + } else if (!isMultipleEnabledProfilesSupported()) { + Log.d(TAG, "The device is already in DSDS mode and no MEP. Do nothing."); + return; } else if (isMultipleEnabledProfilesSupported()) { handleRemovableSimInsertUnderDsdsMep(removableSlotInfo); return; @@ -259,13 +258,13 @@ public class SimSlotChangeHandler { startChooseSimActivity(false); } - private void handleRemovableSimInsertWhenDsdsAndNoDds() { + private void handleRemovableSimInsertWhenDsds() { List subscriptionInfos = getAvailableRemovableSubscription(); if (subscriptionInfos.isEmpty()) { Log.e(TAG, "Unable to find the removable subscriptionInfo. Do nothing."); return; } - Log.d(TAG, "isDdsInvalidForNewUi and getAvailableRemovableSubscription:" + Log.d(TAG, "ForNewUi and getAvailableRemovableSubscription:" + subscriptionInfos); startSimConfirmDialogActivity(subscriptionInfos.get(0).getSubscriptionId()); }