Add getSubscriptionId API
The old getSubId or getSubscriptionIds return multiple sub ids
per slot index, which is not possible in today's implementation
because the slot index here refers to the logical slot index,
which is also known as phone id, or the logical modem index. In
today's telephony, one logical phone can only have one
subscription at one time, so does the modem.
Bug: 239607619
Test: Manual
Merged-In: I7e1e44509169b11024455d52749531f021ab7383
Change-Id: I7e1e44509169b11024455d52749531f021ab7383
diff --git a/src/com/android/phone/ImsUtil.java b/src/com/android/phone/ImsUtil.java
index ba4ad38..d90c256 100644
--- a/src/com/android/phone/ImsUtil.java
+++ b/src/com/android/phone/ImsUtil.java
@@ -154,12 +154,7 @@
}
private static int getSubId(int phoneId) {
- final int[] subIds = SubscriptionManager.getSubId(phoneId);
- int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
- if (subIds != null && subIds.length >= 1) {
- subId = subIds[0];
- }
- return subId;
+ return SubscriptionManager.getSubscriptionId(phoneId);
}
private static boolean getLastKnownRoamingState(int phoneId) {