Merge "[Settings] Hide satellite eSIM from users" into main

This commit is contained in:
Jayachandran C
2023-09-26 07:14:28 +00:00
committed by Android (Google) Code Review
5 changed files with 23 additions and 10 deletions

View File

@@ -40,6 +40,7 @@ import android.util.Log;
import androidx.annotation.GuardedBy;
import androidx.lifecycle.LifecycleOwner;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.network.telephony.MobileNetworkUtils;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -703,9 +704,10 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
Log.d(TAG, "insert subInfo to subInfoEntity, subInfo = " + subInfo);
}
if (subInfo.isEmbedded()
&& subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING) {
&& (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && subInfo.isNtn()))) {
if (DEBUG) {
Log.d(TAG, "Do not insert the provision eSIM");
Log.d(TAG, "Do not insert the provisioning or satellite eSIM");
}
continue;
}

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);