From 2da9b2b8bfb01744d53c14a65a80035d3c8d7b2f Mon Sep 17 00:00:00 2001 From: Youhan Wang Date: Mon, 2 May 2016 15:57:11 -0700 Subject: [PATCH] Add getAidForApptype(). To TelephonyManager and ITelephony.aidl. Bug:27612001 Change-Id: Icb9dc5e29f3a635b2d807e8abcd15a5e1a85b02d --- .../android/telephony/TelephonyManager.java | 36 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 9 +++++ 2 files changed, 45 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 5fed594d72075..b661a22db8ba3 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5178,4 +5178,40 @@ public class TelephonyManager { } return false; } + + /** + * Return the application ID for the app type like {@link APPTYPE_CSIM}. + * + * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission + * + * @param appType the uicc app type like {@link APPTYPE_CSIM} + * @return Application ID for specificied app type or null if no uicc or error. + * @hide + */ + public String getAidForAppType(int appType) { + return getAidForAppType(getDefaultSubscription(), appType); + } + + /** + * Return the application ID for the app type like {@link APPTYPE_CSIM}. + * + * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission + * + * @param subId the subscription ID that this request applies to. + * @param appType the uicc app type, like {@link APPTYPE_CSIM} + * @return Application ID for specificied app type or null if no uicc or error. + * @hide + */ + public String getAidForAppType(int subId, int appType) { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getAidForAppType(subId, appType); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#getAidForAppType", e); + } + return null; + } + } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index bb8aaad5db599..e72d7227452c5 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1067,4 +1067,13 @@ interface ITelephony { * Returns a list of packages that have carrier privileges. */ List getPackagesWithCarrierPrivileges(); + + /** + * Return the application ID for the app type. + * + * @param subId the subscription ID that this request applies to. + * @param appType the uicc app type, + * @return Application ID for specificied app type or null if no uicc or error. + */ + String getAidForAppType(int subId, int appType); }