From 2b2469b07d6ea9410bdb8d1234aa2320b02bdaa9 Mon Sep 17 00:00:00 2001 From: Junda Liu Date: Thu, 14 Aug 2014 22:14:26 -0700 Subject: [PATCH] Add getCdmaMdn and getCdmaMin as system api to telmgr. Bug: b/16966140 Change-Id: I36d8f850eca7c392f7ed5186254ef9862d4177f7 --- .../android/telephony/TelephonyManager.java | 36 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 12 +++++++ 2 files changed, 48 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index c50110a58b1b6..b133a3c8d46a5 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3023,6 +3023,42 @@ public class TelephonyManager { * Expose the rest of ITelephony to @SystemApi */ + /** @hide */ + @SystemApi + public String getCdmaMdn() { + return getCdmaMdn(getDefaultSubscription()); + } + + /** @hide */ + @SystemApi + public String getCdmaMdn(long subId) { + try { + return getITelephony().getCdmaMdn(subId); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + return null; + } + } + + /** @hide */ + @SystemApi + public String getCdmaMin() { + return getCdmaMin(getDefaultSubscription()); + } + + /** @hide */ + @SystemApi + public String getCdmaMin(long subId) { + try { + return getITelephony().getCdmaMin(subId); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + return null; + } + } + /** @hide */ @SystemApi public int checkCarrierPrivilegesForPackage(String pkgname) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index d256f9d863271..22c09f0289949 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -676,6 +676,18 @@ interface ITelephony { */ void setImsRegistrationState(boolean registered); + /** + * Return MDN string for CDMA phone. + * @param subId user preferred subId. + */ + String getCdmaMdn(long subId); + + /** + * Return MIN string for CDMA phone. + * @param subId user preferred subId. + */ + String getCdmaMin(long subId); + /** * Has the calling application been granted special privileges by the carrier. *