getMergedSubscriberIds considers subId

This logic can be simplified a lot but for stability we will make the
smallest change, and follow up in another CL with simplification logic.

Bug: 131189269
Test: manually verified subscription group includes subId
Merged-In: Idf09e267ff3f4e27a2751f2b5220d7213bc09983
Change-Id: Idf09e267ff3f4e27a2751f2b5220d7213bc09983
(cherry picked from commit 5fd17a66c7758157731061a227410db986600a19)
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index bdf66df..ae3670a 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4980,7 +4980,7 @@
     }
 
     @Override
-    public String[] getMergedSubscriberIds(String callingPackage) {
+    public String[] getMergedSubscriberIds(int subId, String callingPackage) {
         // This API isn't public, so no need to provide a valid subscription ID - we're not worried
         // about carrier-privileged callers not having access.
         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
@@ -5002,7 +5002,12 @@
             // Otherwise AppOps check will fail.
 
             final int[] subIds = sub.getActiveSubscriptionIdList();
-            for (int subId : subIds) {
+            for (int id : subIds) {
+                // Only consider subs which match the current subId
+                // This logic can be simplified. See b/131189269 for progress.
+                if (subId != id) {
+                    continue;
+                }
                 activeSubscriberIds.add(tele.getSubscriberId(subId));
             }