diff options
| author | Nancy Chen <nancychen@google.com> | 2014-10-15 18:50:38 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-15 18:50:38 +0000 |
| commit | 00bc5cf896814f55db4dd27be72fe26bc48a0d0b (patch) | |
| tree | 4499f94f30563a1f6d90e131c7eaf4e9968fc554 /telecomm | |
| parent | ce711c6d57732c3582da0828c0361f55381f4223 (diff) | |
| parent | 9faf13b47467916897cf5c019a3a74df871b8f65 (diff) | |
| download | frameworks_base-00bc5cf896814f55db4dd27be72fe26bc48a0d0b.zip frameworks_base-00bc5cf896814f55db4dd27be72fe26bc48a0d0b.tar.gz frameworks_base-00bc5cf896814f55db4dd27be72fe26bc48a0d0b.tar.bz2 | |
am 9faf13b4: Merge "Add API method to extract subscription ID from phone account (1/3)" into lmp-sprout-dev
* commit '9faf13b47467916897cf5c019a3a74df871b8f65':
Add API method to extract subscription ID from phone account (1/3)
Diffstat (limited to 'telecomm')
| -rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 44 | ||||
| -rw-r--r-- | telecomm/java/com/android/internal/telecom/ITelecomService.aidl | 10 |
2 files changed, 54 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 168ac41..a86f405 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -318,6 +318,50 @@ public class TelecomManager { } /** + * Return the corresponding PhoneAccount id of a given subscription id. + * + * @param subscriptionId The value of the subscription id the caller is trying to get a phone + * account id for. + * @return A string representing the phone account id or null. + * + * @hide + */ + @SystemApi + public String getPhoneAccountIdForSubscriptionId(long subscriptionId) { + try { + if (isServiceConnected()) { + return getTelecomService().getPhoneAccountIdForSubscriptionId(subscriptionId); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelecomService#getSubscriptionIdForPhoneAccount", e); + } + return null; + } + + /** + * Return the subscription id of the PhoneAccount if it exists. This only applies to PSTN + * or SIM-based phone accounts. Return -1 otherwise. + * + * @param accountHandle The {@link PhoneAccountHandle} the caller is trying to get the + * subscription id for. + * @return The subscription id (a long) or -1 if the phone account is not a SIM or + * a subscription id does not exist. + * + * @hide + */ + @SystemApi + public long getSubscriptionIdForPhoneAccount(PhoneAccountHandle accountHandle) { + try { + if (isServiceConnected()) { + return getTelecomService().getSubscriptionIdForPhoneAccount(accountHandle); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelecomService#getSubscriptionIdForPhoneAccount", e); + } + return -1; + } + + /** * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing phone * calls with a specified URI scheme. * <p> diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index f1cf885..09ee1cb 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -35,6 +35,16 @@ interface ITelecomService { void showInCallScreen(boolean showDialpad); /** + * @see TelecomServiceImpl#getPhoneAccountIdForSubscriptionId + */ + String getPhoneAccountIdForSubscriptionId(in long subscriptionId); + + /** + * @see TelecomServiceImpl#getSubscriptionIdForPhoneAccount + */ + long getSubscriptionIdForPhoneAccount(in PhoneAccountHandle account); + + /** * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount */ PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme); |
