Merge "Clean up aconfig flag oem_enabled_satellite_flag" into main
This commit is contained in:
@@ -37,7 +37,6 @@ import androidx.annotation.GuardedBy;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.android.internal.telephony.flags.Flags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settingslib.mobile.dataservice.MobileNetworkDatabase;
|
||||
@@ -509,8 +508,7 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
||||
}
|
||||
if (subInfo.isEmbedded()
|
||||
&& (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag()
|
||||
&& subInfo.isOnlyNonTerrestrialNetwork()))) {
|
||||
|| subInfo.isOnlyNonTerrestrialNetwork())) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Do not insert the provisioning or satellite eSIM");
|
||||
}
|
||||
|
@@ -824,8 +824,7 @@ public class SubscriptionUtil {
|
||||
private static boolean isEmbeddedSubscriptionVisible(@NonNull SubscriptionInfo subInfo) {
|
||||
if (subInfo.isEmbedded()
|
||||
&& (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (com.android.internal.telephony.flags.Flags.oemEnabledSatelliteFlag()
|
||||
&& subInfo.isOnlyNonTerrestrialNetwork()))) {
|
||||
|| subInfo.isOnlyNonTerrestrialNetwork())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@@ -26,8 +26,6 @@ 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;
|
||||
|
||||
@@ -59,8 +57,7 @@ public class CallsSimListDialogFragment extends SimListDialogFragment {
|
||||
SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId);
|
||||
if (info == null || (info.isEmbedded()
|
||||
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag()
|
||||
&& info.isOnlyNonTerrestrialNetwork())))) {
|
||||
|| info.isOnlyNonTerrestrialNetwork()))) {
|
||||
continue;
|
||||
}
|
||||
result.add(subscriptionManager.getActiveSubscriptionInfo(subId));
|
||||
|
@@ -34,7 +34,6 @@ 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;
|
||||
|
||||
@@ -105,7 +104,7 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
|
||||
final SubscriptionInfo info = getPreferredSubscription();
|
||||
if (info == null || (info.isEmbedded()
|
||||
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork())))) {
|
||||
|| info.isOnlyNonTerrestrialNetwork()))) {
|
||||
dismiss("SubscriptionInfo is null or other esim's cases.");
|
||||
return;
|
||||
}
|
||||
|
@@ -35,7 +35,6 @@ 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;
|
||||
|
||||
@@ -137,12 +136,10 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple
|
||||
|
||||
if ((newSubInfo.isEmbedded()
|
||||
&& (newSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag()
|
||||
&& newSubInfo.isOnlyNonTerrestrialNetwork())))
|
||||
|| newSubInfo.isOnlyNonTerrestrialNetwork()))
|
||||
|| (currentDataSubInfo.isEmbedded()
|
||||
&& (currentDataSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag()
|
||||
&& currentDataSubInfo.isOnlyNonTerrestrialNetwork())))) {
|
||||
|| currentDataSubInfo.isOnlyNonTerrestrialNetwork()))) {
|
||||
Log.d(TAG, "do not set the provisioning or satellite eSIM");
|
||||
dismiss();
|
||||
return;
|
||||
|
@@ -39,7 +39,6 @@ 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;
|
||||
|
||||
@@ -145,7 +144,7 @@ public class SimListDialogFragment extends SimDialogFragment {
|
||||
// Remove the provisioning or satellite eSIM from the subscription list.
|
||||
currentSubscriptions.removeIf(info -> info.isEmbedded()
|
||||
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|
||||
|| (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork())));
|
||||
|| info.isOnlyNonTerrestrialNetwork()));
|
||||
|
||||
boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
|
||||
boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);
|
||||
|
@@ -88,25 +88,9 @@ class SubscriptionInfoListViewModelTest {
|
||||
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
|
||||
fun onSubscriptionsChanged_flagOnHasNonTerrestrialNetwork_filterNonTerrestrialNetwork() =
|
||||
runBlocking {
|
||||
mSetFlagsRule.enableFlags(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
|
||||
activeSubscriptionInfoList = listOf(SUB_INFO_1, SUB_INFO_2, SUB_INFO_4)
|
||||
|
||||
val listDeferred = async {
|
||||
|
Reference in New Issue
Block a user