[Settings] Hide satellite eSIM from users

Bug: 302044287
Test: Manually verified by forcing the eSIM profile to be NTN
Change-Id: Iba4e42778bdf072ceaecc35a2245ea737e552e5c
This commit is contained in:
Jayachandran C
2023-09-26 01:23:56 +00:00
parent af77327017
commit 544d7697a9
5 changed files with 23 additions and 10 deletions

View File

@@ -26,6 +26,8 @@ import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import com.android.internal.telephony.flags.Flags;
import java.util.ArrayList;
import java.util.List;
@@ -56,7 +58,8 @@ public class CallsSimListDialogFragment extends SimListDialogFragment {
SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId);
if (info == null || (info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isNtn())))) {
continue;
}
result.add(subscriptionManager.getActiveSubscriptionInfo(subId));

View File

@@ -32,6 +32,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.R;
import com.android.settings.network.SubscriptionUtil;
@@ -98,7 +99,8 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
final SubscriptionInfo info = getPreferredSubscription();
if (info == null || (info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isNtn())))) {
dismiss();
return;
}

View File

@@ -35,6 +35,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.R;
import com.android.settings.network.SubscriptionUtil;
@@ -133,10 +134,13 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple
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");
if ((newSubInfo.isEmbedded()
&& (newSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && newSubInfo.isNtn())))
|| (currentDataSubInfo.isEmbedded()
&& (currentDataSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && currentDataSubInfo.isNtn())))) {
Log.d(TAG, "do not set the provisioning or satellite eSIM");
dismiss();
return;
}

View File

@@ -39,6 +39,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.R;
import com.android.settings.network.SubscriptionUtil;
@@ -141,9 +142,10 @@ public class SimListDialogFragment extends SimDialogFragment {
return;
}
// Remove the provision eSIM from the subscription list.
// Remove the provisioning or satellite eSIM from the subscription list.
currentSubscriptions.removeIf(info -> info.isEmbedded()
&& info.getProfileClass() == PROFILE_CLASS_PROVISIONING);
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isNtn())));
boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);