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

Commit ae8b9b5f 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: I88e29b445a11f36e1a3db80368bb9e46ef06eac3
parent 76144abc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ public class EnableAutoDataSwitchDialogFragment extends SimDialogFragment implem
    }

    private SubscriptionManager getSubscriptionManager() {
        return getContext().getSystemService(SubscriptionManager.class);
        return getContext().getSystemService(SubscriptionManager.class).createForAllUserProfiles();
    }

    @VisibleForTesting
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple

    @VisibleForTesting
    protected SubscriptionManager getSubscriptionManager() {
        return getContext().getSystemService(SubscriptionManager.class);
        return getContext().getSystemService(SubscriptionManager.class).createForAllUserProfiles();
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class SimListDialogFragment extends SimDialogFragment {

    protected List<SubscriptionInfo> getCurrentSubscriptions() {
        final SubscriptionManager manager = getContext().getSystemService(
                SubscriptionManager.class);
                SubscriptionManager.class).createForAllUserProfiles();
        return manager.getActiveSubscriptionInfoList();
    }

+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ public class EnableAutoDataSwitchDialogFragmentTest
        doReturn(mContext).when(mFragment).getContext();

        doReturn(mSubscriptionManager).when(mContext).getSystemService(SubscriptionManager.class);
        doReturn(mSubscriptionManager).when(mSubscriptionManager).createForAllUserProfiles();
        doReturn(mTelephonyManager).when(mContext).getSystemService(TelephonyManager.class);
        doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(anyInt());
        doReturn(mUserManager).when(mContext).getSystemService(UserManager.class);