Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c3ad34d authored by Ling Ma's avatar Ling Ma
Browse files

Wrap subManager creation with createForAllProfiles

Since U, a sub can be associated with a particular profile, and thus in V we enforce filtering on the caller and only show the subs that are associated with the caller.
However, in some cases the caller indeed needs to see all subs regardless of its association, e.g. sysUI. Therefore, a param isForAllProfile is added to indicate whether the caller intends to see all subs.

Bug: 296076674
Test: voice call + data browsing
Flag: ACONFIG com.android.internal.telephony.flags.enforce_subscription_user_filter
 DEVELOPMENT
Change-Id: Ib5ccc841029a32ae9cf25d7a65b156e363d6b139
parent 76144abc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -174,7 +174,8 @@ public abstract class ActiveSubscriptionsListener
     */
    public SubscriptionManager getSubscriptionManager() {
        if (mSubscriptionManager == null) {
            mSubscriptionManager = mContext.getSystemService(SubscriptionManager.class);
            mSubscriptionManager = mContext.getSystemService(SubscriptionManager.class)
                    .createForAllUserProfiles();
        }
        return mSubscriptionManager;
    }
+2 −1
Original line number Diff line number Diff line
@@ -153,7 +153,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        mPreferenceGroupKey = preferenceGroupKey;
        mStartOrder = startOrder;
        mTelephonyManager = context.getSystemService(TelephonyManager.class);
        mSubscriptionManager = context.getSystemService(SubscriptionManager.class);
        mSubscriptionManager = context.getSystemService(SubscriptionManager.class)
                .createForAllUserProfiles();
        mWifiManager = context.getSystemService(WifiManager.class);
        mSubscriptionPreferences = new ArrayMap<>();
        mSubscriptionsListener = new SubscriptionsChangeListener(context, this);
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class SwitchToEuiccSubscriptionSidecar extends EuiccOperationSidecar {
        }

        SubscriptionManager subscriptionManager = getContext().getSystemService(
                SubscriptionManager.class);
                SubscriptionManager.class).createForAllUserProfiles();
        mActiveSubInfos = SubscriptionUtil.getActiveSubscriptions(subscriptionManager);

        // To check whether the esim slot's port is active. If yes, skip setSlotMapping. If no,
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class SwitchToRemovableSlotSidecar extends EuiccOperationSidecar
        mPhysicalSlotId = physicalSlotId;
        mRemovedSubInfo = removedSubInfo;
        SubscriptionManager subscriptionManager =
                getContext().getSystemService(SubscriptionManager.class);
                getContext().getSystemService(SubscriptionManager.class).createForAllUserProfiles();
        if (!mTelephonyManager.isMultiSimEnabled()
                && SubscriptionUtil.getActiveSubscriptions(subscriptionManager).stream().anyMatch(
                SubscriptionInfo::isEmbedded)) {
+3 −3
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ public class UiccSlotUtil {
        Log.d(TAG, "The SimSlotMapping: " + uiccSlotMappings);

        SubscriptionManager subscriptionManager = context.getSystemService(
                SubscriptionManager.class);
                SubscriptionManager.class).createForAllUserProfiles();
        int excludedLogicalSlotIndex = getExcludedLogicalSlotIndex(uiccSlotMappings,
                SubscriptionUtil.getActiveSubscriptions(subscriptionManager), removedSubInfo,
                telMgr.isMultiSimEnabled());
@@ -203,7 +203,7 @@ public class UiccSlotUtil {
        }

        SubscriptionManager subscriptionManager = context.getSystemService(
                SubscriptionManager.class);
                SubscriptionManager.class).createForAllUserProfiles();
        int excludedLogicalSlotIndex = getExcludedLogicalSlotIndex(uiccSlotMappings,
                SubscriptionUtil.getActiveSubscriptions(subscriptionManager), removedSubInfo,
                telMgr.isMultiSimEnabled());
@@ -222,7 +222,7 @@ public class UiccSlotUtil {
        List<UiccCardInfo> uiccCardInfos = telMgr.getUiccCardsInfo();
        ImmutableList<UiccSlotInfo> slotInfos = UiccSlotUtil.getSlotInfos(telMgr);
        SubscriptionManager subscriptionManager = context.getSystemService(
                SubscriptionManager.class);
                SubscriptionManager.class).createForAllUserProfiles();
        SubscriptionInfo subInfo = SubscriptionUtil.getSubById(subscriptionManager, subId);

        // checking whether this is the removable esim. If it is, then return the removable slot id.
Loading