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: I8bb10babd47f02df892f60da0a37a6feba5341ca
diff --git a/src/com/android/phone/SpecialCharSequenceMgr.java b/src/com/android/phone/SpecialCharSequenceMgr.java
index 3bf0e1a..8fe084b 100644
--- a/src/com/android/phone/SpecialCharSequenceMgr.java
+++ b/src/com/android/phone/SpecialCharSequenceMgr.java
@@ -33,6 +33,7 @@
 import com.android.internal.telephony.IccCardConstants;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.TelephonyCapabilities;
+import com.android.internal.telephony.flags.Flags;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -208,6 +209,9 @@
 
     private static int getNextSubIdForState(IccCardConstants.State state, Context context) {
         SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
+        if (Flags.workProfileApiSplit()) {
+            subscriptionManager = subscriptionManager.createForAllUserProfiles();
+        }
         List<SubscriptionInfo> list = subscriptionManager.getActiveSubscriptionInfoList();
         if (list == null) {
             // getActiveSubscriptionInfoList was null callers expect an empty list.