Merge "Show sim onboarding for user when insert psim" into main

This commit is contained in:
SongFerng Wang
2024-05-16 06:22:52 +00:00
committed by Android (Google) Code Review

View File

@@ -108,19 +108,18 @@ public class SimSlotChangeHandler {
setRemovableSimSlotState(mContext, currentRemovableSlotState); setRemovableSimSlotState(mContext, currentRemovableSlotState);
if (mTelMgr.getActiveModemCount() > 1) { 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) { if (!isRemovableSimInserted) {
Log.d(TAG, "Removable Sim is not inserted in DSDS mode. Do nothing."); Log.d(TAG, "Removable Sim is not inserted in DSDS mode. Do nothing.");
return; return;
} }
boolean isDdsInvalidForNewUi = Flags.isDualSimOnboardingEnabled()
&& SubscriptionManager.getDefaultDataSubscriptionId() if (Flags.isDualSimOnboardingEnabled()) {
== SubscriptionManager.INVALID_SUBSCRIPTION_ID; // ForNewUi, when the user inserts the psim, showing the sim onboarding for the user
if (isDdsInvalidForNewUi) { // to setup the sim switching or the default data subscription.
handleRemovableSimInsertWhenDsdsAndNoDds(); handleRemovableSimInsertWhenDsds();
} else if (!isMultipleEnabledProfilesSupported()) {
Log.d(TAG, "The device is already in DSDS mode and no MEP. Do nothing.");
return;
} else if (isMultipleEnabledProfilesSupported()) { } else if (isMultipleEnabledProfilesSupported()) {
handleRemovableSimInsertUnderDsdsMep(removableSlotInfo); handleRemovableSimInsertUnderDsdsMep(removableSlotInfo);
return; return;
@@ -259,13 +258,13 @@ public class SimSlotChangeHandler {
startChooseSimActivity(false); startChooseSimActivity(false);
} }
private void handleRemovableSimInsertWhenDsdsAndNoDds() { private void handleRemovableSimInsertWhenDsds() {
List<SubscriptionInfo> subscriptionInfos = getAvailableRemovableSubscription(); List<SubscriptionInfo> subscriptionInfos = getAvailableRemovableSubscription();
if (subscriptionInfos.isEmpty()) { if (subscriptionInfos.isEmpty()) {
Log.e(TAG, "Unable to find the removable subscriptionInfo. Do nothing."); Log.e(TAG, "Unable to find the removable subscriptionInfo. Do nothing.");
return; return;
} }
Log.d(TAG, "isDdsInvalidForNewUi and getAvailableRemovableSubscription:" Log.d(TAG, "ForNewUi and getAvailableRemovableSubscription:"
+ subscriptionInfos); + subscriptionInfos);
startSimConfirmDialogActivity(subscriptionInfos.get(0).getSubscriptionId()); startSimConfirmDialogActivity(subscriptionInfos.get(0).getSubscriptionId());
} }