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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user