Merge "[Settings] Provision status checking of eSIM in dialog fragment"
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.sim;
|
package com.android.settings.sim;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.telecom.PhoneAccountHandle;
|
import android.telecom.PhoneAccountHandle;
|
||||||
@@ -51,6 +53,12 @@ public class CallsSimListDialogFragment extends SimListDialogFragment {
|
|||||||
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId);
|
||||||
|
if (info == null || (info.isEmbedded()
|
||||||
|
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
result.add(subscriptionManager.getActiveSubscriptionInfo(subId));
|
result.add(subscriptionManager.getActiveSubscriptionInfo(subId));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.sim;
|
package com.android.settings.sim;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
@@ -95,7 +97,8 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
final SubscriptionInfo info = getPreferredSubscription();
|
final SubscriptionInfo info = getPreferredSubscription();
|
||||||
if (info == null) {
|
if (info == null || (info.isEmbedded()
|
||||||
|
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
|
||||||
dismiss();
|
dismiss();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.sim;
|
package com.android.settings.sim;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@@ -113,6 +115,15 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple
|
|||||||
dismiss();
|
dismiss();
|
||||||
return;
|
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()
|
Log.d(TAG, "newSubId: " + newSubInfo.getSubscriptionId()
|
||||||
+ "currentDataSubID: " + currentDataSubInfo.getSubscriptionId());
|
+ "currentDataSubID: " + currentDataSubInfo.getSubscriptionId());
|
||||||
setTargetSubscriptionInfo(newSubInfo);
|
setTargetSubscriptionInfo(newSubInfo);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.sim;
|
package com.android.settings.sim;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -137,6 +139,11 @@ public class SimListDialogFragment extends SimDialogFragment {
|
|||||||
dismiss();
|
dismiss();
|
||||||
return;
|
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 includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
|
||||||
boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);
|
boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);
|
||||||
if (includeAskEveryTime || isCancelItemShowed) {
|
if (includeAskEveryTime || isCancelItemShowed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user