From 4eb5678ed8a0704fe1e4f5e7a3a3156f69b6884f Mon Sep 17 00:00:00 2001 From: Youhan Wang Date: Mon, 18 Jul 2016 18:34:43 -0700 Subject: [PATCH] Add getCdmaPrlVersion(). Bug:27612001 Change-Id: Icce9e99d360e30268d41bc063eeefc7484627df6 --- .../android/telephony/TelephonyManager.java | 33 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 10 ++++++ 2 files changed, 43 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index df81d7f90008e..a3dc34374c62f 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5423,6 +5423,39 @@ public class TelephonyManager { return null; } + /** + * Return the Preferred Roaming List Version + * + * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission + * + * @return PRLVersion or null if error. + * @hide + */ + public String getCdmaPrlVersion() { + return getCdmaPrlVersion(getDefaultSubscription()); + } + + /** + * Return the Preferred Roaming List Version + * + * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission + * + * @param subId the subscription ID that this request applies to. + * @return PRLVersion or null if error. + * @hide + */ + public String getCdmaPrlVersion(int subId) { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getCdmaPrlVersion(subId); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#getCdmaPrlVersion", e); + } + return null; + } + /** * Get snapshot of Telephony histograms * @return List of Telephony histograms diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 167e1a739ca50..7e7071ee173a0 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1106,6 +1106,16 @@ interface ITelephony { */ String getEsn(int subId); + /** + * Return the Preferred Roaming List Version + * + * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission + * @param subId the subscription ID that this request applies to. + * @return PRLVersion or null if error. + * @hide + */ + String getCdmaPrlVersion(int subId); + /** * Get snapshot of Telephony histograms * @return List of Telephony histograms