Disable SIM On/Off operation when device is in Satellite Enabled Mode
Cherry-picking ag/26965536 into the 24D1-dev branch caused conflicts. Therefore, manually create this CL to migrate the MobileNetworkSwitchController to Kotlin and utilize Compose. Bug: 315928920 Test: atest, manual Change-Id: I215b5a4615a3b3da6fc160f76c85c814210cc3ef Merged-In: I7aaaf43b4c449129197e7cc92565d274ffdd2d8c
This commit is contained in:
@@ -50,12 +50,12 @@ import com.android.settings.network.helper.SelectableSubscriptions;
|
||||
import com.android.settings.network.helper.SubscriptionAnnotation;
|
||||
import com.android.settings.network.telephony.DeleteEuiccSubscriptionDialogActivity;
|
||||
import com.android.settings.network.telephony.EuiccRacConnectivityDialogActivity;
|
||||
import com.android.settings.network.telephony.SubscriptionRepositoryKt;
|
||||
import com.android.settings.network.telephony.ToggleSubscriptionDialogActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -505,40 +505,7 @@ public class SubscriptionUtil {
|
||||
* @return list of user selectable subscriptions.
|
||||
*/
|
||||
public static List<SubscriptionInfo> getSelectableSubscriptionInfoList(Context context) {
|
||||
SubscriptionManager subManager = context.getSystemService(SubscriptionManager.class);
|
||||
List<SubscriptionInfo> availableList = subManager.getAvailableSubscriptionInfoList();
|
||||
if (availableList == null) {
|
||||
return null;
|
||||
} else {
|
||||
// Multiple subscriptions in a group should only have one representative.
|
||||
// It should be the current active primary subscription if any, or any
|
||||
// primary subscription.
|
||||
List<SubscriptionInfo> selectableList = new ArrayList<>();
|
||||
Map<ParcelUuid, SubscriptionInfo> groupMap = new HashMap<>();
|
||||
|
||||
for (SubscriptionInfo info : availableList) {
|
||||
// Opportunistic subscriptions are considered invisible
|
||||
// to users so they should never be returned.
|
||||
if (!isSubscriptionVisible(subManager, context, info)) continue;
|
||||
|
||||
ParcelUuid groupUuid = info.getGroupUuid();
|
||||
if (groupUuid == null) {
|
||||
// Doesn't belong to any group. Add in the list.
|
||||
selectableList.add(info);
|
||||
} else if (!groupMap.containsKey(groupUuid)
|
||||
|| (groupMap.get(groupUuid).getSimSlotIndex() == INVALID_SIM_SLOT_INDEX
|
||||
&& info.getSimSlotIndex() != INVALID_SIM_SLOT_INDEX)) {
|
||||
// If it belongs to a group that has never been recorded or it's the current
|
||||
// active subscription, add it in the list.
|
||||
selectableList.remove(groupMap.get(groupUuid));
|
||||
selectableList.add(info);
|
||||
groupMap.put(groupUuid, info);
|
||||
}
|
||||
|
||||
}
|
||||
Log.d(TAG, "getSelectableSubscriptionInfoList: " + selectableList);
|
||||
return selectableList;
|
||||
}
|
||||
return SubscriptionRepositoryKt.getSelectableSubscriptionInfoList(context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user