diff options
| author | Santos Cordon <santoscordon@google.com> | 2015-02-03 10:57:16 -0800 |
|---|---|---|
| committer | Etan Cohen <etancohen@google.com> | 2015-03-02 11:17:20 -0800 |
| commit | 9b09c15c35879838458d690e18fc67b0167485a2 (patch) | |
| tree | 20edba71f429ce1b513ecbbe672f486b676a789e /telephony/java/android | |
| parent | 57f8f0d7f9ff9e7a916ada7efaf2f59931de89b1 (diff) | |
| download | frameworks_base-9b09c15c35879838458d690e18fc67b0167485a2.zip frameworks_base-9b09c15c35879838458d690e18fc67b0167485a2.tar.gz frameworks_base-9b09c15c35879838458d690e18fc67b0167485a2.tar.bz2 | |
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
Diffstat (limited to 'telephony/java/android')
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index a7350c9..b96f528 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; @@ -3779,7 +3780,7 @@ public class TelephonyManager { /** * Returns the IMS Registration Status - *@hide + * @hide */ public boolean isImsRegistered() { try { @@ -4130,4 +4131,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; + } } |
