summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Santos Cordon <santoscordon@google.com> 2015-02-03 10:57:16 -0800
committer Santos Cordon <santoscordon@google.com> 2015-02-19 15:19:16 -0800
commited4ca5ca2c40ed2c838aaf483fcd58abdfa0ff08 (patch)
tree4174265d9b0c09db35aa5635e5710d57f6d88321
parent7870433c65daed452c57c6db4404036c2c4548b6 (diff)
Add Sub-ID-from-phone-account converter method.
There are several places in the code that currently attempt to parse the sub ID directly from the phone account which is undesireable. Before we can change from using the subID to using an ICC ID with the phone accounts, we need to create a conversion method so that no other components are parsing the sub ID out of the phone account directly. Change-Id: I74547fe0807da2fe13f3ff4422cd1d0a7a20d04c
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java20
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl6
2 files changed, 25 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 94691c088dd3..dda96264ed14 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -29,6 +29,7 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
+import android.telecom.PhoneAccount;
import android.util.Log;
import com.android.internal.telecom.ITelecomService;
@@ -3765,7 +3766,7 @@ public class TelephonyManager {
/**
* Returns the IMS Registration Status
- *@hide
+ * @hide
*/
public boolean isImsRegistered() {
try {
@@ -4116,4 +4117,21 @@ public class TelephonyManager {
ServiceState.rilRadioTechnologyToString(type));
}
}
+
+ /**
+ * Returns the subscription ID for the given phone account.
+ * @hide
+ */
+ public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
+ int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ try {
+ ITelephony service = getITelephony();
+ if (service != null) {
+ retval = service.getSubIdForPhoneAccount(phoneAccount);
+ }
+ } catch (RemoteException e) {
+ }
+
+ return retval;
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index bf3ee09daa97..62c8746f7ea9 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -18,6 +18,7 @@ package com.android.internal.telephony;
import android.content.Intent;
import android.os.Bundle;
+import android.telecom.PhoneAccount;
import android.telephony.CellInfo;
import android.telephony.IccOpenLogicalChannelResponse;
import android.telephony.NeighboringCellInfo;
@@ -879,4 +880,9 @@ interface ITelephony {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
String getDeviceId();
+
+ /**
+ * Returns the subscription ID associated with the specified PhoneAccount.
+ */
+ int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
}