diff options
author | Ling Ma <linggm@google.com> | 2023-12-06 15:16:35 -0800 |
---|---|---|
committer | Ling Ma <linggm@google.com> | 2023-12-06 15:16:35 -0800 |
commit | e40c5ebd9cb2c86f161fe88e0fc14b8a13832892 (patch) | |
tree | df2103cf77f2b278d93091957c1f2d196cf863a6 | |
parent | abba6fa3b8f89f6b426fca5a2601dab39b52df60 (diff) | |
download | ims-e40c5ebd9cb2c86f161fe88e0fc14b8a13832892.tar.gz |
Wrap subManager creation with createForAllProfiles
Since U, a sub can be associated to a particular profile, and thus in V we enforce filtering on 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 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.work_profile_api_split DEVELOPMENT
Change-Id: Ifa5fd5061ee48de2153d22eec43f3df71d589b6f
-rw-r--r-- | rcs/presencepolling/src/com/android/service/ims/presence/PresenceSetting.java | 4 | ||||
-rw-r--r-- | rcs/rcsservice/src/com/android/service/ims/RcsSettingUtils.java | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/rcs/presencepolling/src/com/android/service/ims/presence/PresenceSetting.java b/rcs/presencepolling/src/com/android/service/ims/presence/PresenceSetting.java index 10988c7..4be5f15 100644 --- a/rcs/presencepolling/src/com/android/service/ims/presence/PresenceSetting.java +++ b/rcs/presencepolling/src/com/android/service/ims/presence/PresenceSetting.java @@ -34,6 +34,7 @@ import android.telephony.SubscriptionManager; import android.telephony.ims.ProvisioningManager; import com.android.ims.internal.Logger; +import com.android.internal.telephony.flags.Flags; import java.util.List; @@ -245,6 +246,9 @@ public class PresenceSetting { public static int getDefaultSubscriptionId() { SubscriptionManager sm = sContext.getSystemService(SubscriptionManager.class); if (sm == null) return SubscriptionManager.INVALID_SUBSCRIPTION_ID; + if (Flags.workProfileApiSplit()) { + sm = sm.createForAllUserProfiles(); + } List<SubscriptionInfo> infos = sm.getActiveSubscriptionInfoList(); if (infos == null || infos.isEmpty()) { // There are no active subscriptions right now. diff --git a/rcs/rcsservice/src/com/android/service/ims/RcsSettingUtils.java b/rcs/rcsservice/src/com/android/service/ims/RcsSettingUtils.java index da4cbd6..839e60f 100644 --- a/rcs/rcsservice/src/com/android/service/ims/RcsSettingUtils.java +++ b/rcs/rcsservice/src/com/android/service/ims/RcsSettingUtils.java @@ -43,6 +43,7 @@ import android.telephony.ims.feature.MmTelFeature; import android.telephony.ims.stub.ImsRegistrationImplBase; import com.android.ims.internal.Logger; +import com.android.internal.telephony.flags.Flags; import java.util.List; import java.util.concurrent.LinkedBlockingQueue; @@ -360,7 +361,10 @@ public class RcsSettingUtils { public static int getDefaultSubscriptionId(Context context) { SubscriptionManager sm = context.getSystemService(SubscriptionManager.class); if (sm == null) return SubscriptionManager.INVALID_SUBSCRIPTION_ID; - List<SubscriptionInfo> infos = sm.getActiveSubscriptionInfoList(); + if (Flags.workProfileApiSplit()) { + sm = sm.createForAllUserProfiles(); + } + List<SubscriptionInfo> infos = sm.getActiveSubscriptionInfoList(); if (infos == null || infos.isEmpty()) { // There are no active subscriptions right now. return SubscriptionManager.INVALID_SUBSCRIPTION_ID; |