Merge "Clean up aconfig flag oem_enabled_satellite_flag" into main

This commit is contained in:
Hakjun Choi
2025-02-04 19:31:29 -08:00
committed by Android (Google) Code Review
7 changed files with 7 additions and 34 deletions

View File

@@ -37,7 +37,6 @@ import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleOwner;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.overlay.FeatureFactory; import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.mobile.dataservice.MobileNetworkDatabase; import com.android.settingslib.mobile.dataservice.MobileNetworkDatabase;
@@ -509,8 +508,7 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
} }
if (subInfo.isEmbedded() if (subInfo.isEmbedded()
&& (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING && (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() || subInfo.isOnlyNonTerrestrialNetwork())) {
&& subInfo.isOnlyNonTerrestrialNetwork()))) {
if (DEBUG) { if (DEBUG) {
Log.d(TAG, "Do not insert the provisioning or satellite eSIM"); Log.d(TAG, "Do not insert the provisioning or satellite eSIM");
} }

View File

@@ -824,8 +824,7 @@ public class SubscriptionUtil {
private static boolean isEmbeddedSubscriptionVisible(@NonNull SubscriptionInfo subInfo) { private static boolean isEmbeddedSubscriptionVisible(@NonNull SubscriptionInfo subInfo) {
if (subInfo.isEmbedded() if (subInfo.isEmbedded()
&& (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING && (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (com.android.internal.telephony.flags.Flags.oemEnabledSatelliteFlag() || subInfo.isOnlyNonTerrestrialNetwork())) {
&& subInfo.isOnlyNonTerrestrialNetwork()))) {
return false; return false;
} }
return true; return true;

View File

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

View File

@@ -34,7 +34,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.network.SubscriptionUtil; import com.android.settings.network.SubscriptionUtil;
@@ -105,7 +104,7 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
final SubscriptionInfo info = getPreferredSubscription(); final SubscriptionInfo info = getPreferredSubscription();
if (info == null || (info.isEmbedded() if (info == null || (info.isEmbedded()
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork())))) { || info.isOnlyNonTerrestrialNetwork()))) {
dismiss("SubscriptionInfo is null or other esim's cases."); dismiss("SubscriptionInfo is null or other esim's cases.");
return; return;
} }

View File

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

View File

@@ -39,7 +39,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import com.android.internal.telephony.flags.Flags;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.network.SubscriptionUtil; import com.android.settings.network.SubscriptionUtil;
@@ -145,7 +144,7 @@ public class SimListDialogFragment extends SimDialogFragment {
// Remove the provisioning or satellite eSIM from the subscription list. // Remove the provisioning or satellite eSIM from the subscription list.
currentSubscriptions.removeIf(info -> info.isEmbedded() currentSubscriptions.removeIf(info -> info.isEmbedded()
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork()))); || info.isOnlyNonTerrestrialNetwork()));
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);

View File

@@ -88,25 +88,9 @@ class SubscriptionInfoListViewModelTest {
assertThat(listDeferred.await()).contains(listOf(SUB_INFO_1, SUB_INFO_2)) assertThat(listDeferred.await()).contains(listOf(SUB_INFO_1, SUB_INFO_2))
} }
@Test
fun onSubscriptionsChanged_flagOffHasNonTerrestrialNetwork_filterNonTerrestrialNetwork() =
runBlocking {
mSetFlagsRule.disableFlags(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
activeSubscriptionInfoList = listOf(SUB_INFO_1, SUB_INFO_2, SUB_INFO_4)
val listDeferred = async {
createViewModel().subscriptionInfoListFlow.toListWithTimeout()
}
delay(100)
subInfoListener?.onSubscriptionsChanged()
assertThat(listDeferred.await()).contains(listOf(SUB_INFO_1, SUB_INFO_2, SUB_INFO_4))
}
@Test @Test
fun onSubscriptionsChanged_flagOnHasNonTerrestrialNetwork_filterNonTerrestrialNetwork() = fun onSubscriptionsChanged_flagOnHasNonTerrestrialNetwork_filterNonTerrestrialNetwork() =
runBlocking { runBlocking {
mSetFlagsRule.enableFlags(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
activeSubscriptionInfoList = listOf(SUB_INFO_1, SUB_INFO_2, SUB_INFO_4) activeSubscriptionInfoList = listOf(SUB_INFO_1, SUB_INFO_2, SUB_INFO_4)
val listDeferred = async { val listDeferred = async {