Merge "[Settings] Provision status checking of eSIM in dialog fragment"

This commit is contained in:
Zoey Chen
2022-12-20 03:47:31 +00:00
committed by Android (Google) Code Review
4 changed files with 30 additions and 1 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.sim;
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.telecom.PhoneAccountHandle;
@@ -51,6 +53,12 @@ public class CallsSimListDialogFragment extends SimListDialogFragment {
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
continue;
}
SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId);
if (info == null || (info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
continue;
}
result.add(subscriptionManager.getActiveSubscriptionInfo(subId));
}
return result;

View File

@@ -16,6 +16,8 @@
package com.android.settings.sim;
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
import android.app.Activity;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
@@ -95,7 +97,8 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
}
final SubscriptionInfo info = getPreferredSubscription();
if (info == null) {
if (info == null || (info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
dismiss();
return;
}

View File

@@ -16,6 +16,8 @@
package com.android.settings.sim;
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
@@ -113,6 +115,15 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple
dismiss();
return;
}
if ((newSubInfo.isEmbedded() && newSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING)
|| (currentDataSubInfo.isEmbedded()
&& currentDataSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
Log.d(TAG, "do not set the provision eSIM");
dismiss();
return;
}
Log.d(TAG, "newSubId: " + newSubInfo.getSubscriptionId()
+ "currentDataSubID: " + currentDataSubInfo.getSubscriptionId());
setTargetSubscriptionInfo(newSubInfo);

View File

@@ -16,6 +16,8 @@
package com.android.settings.sim;
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.Context;
@@ -137,6 +139,11 @@ public class SimListDialogFragment extends SimDialogFragment {
dismiss();
return;
}
// Remove the provision eSIM from the subscription list.
currentSubscriptions.removeIf(info -> info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING);
boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);
if (includeAskEveryTime || isCancelItemShowed) {