From ddb74d8eb05bf50ebae673fda87730b80e52a758 Mon Sep 17 00:00:00 2001 From: Junda Liu Date: Mon, 30 Jun 2014 13:49:03 -0700 Subject: [PATCH] add setCdmaSubscription to telephonymanager. Bug: b/12799863 Change-Id: Ieeb3e800cd7757335135901b1e4e94aaf6f4ede7 --- .../android/telephony/TelephonyManager.java | 19 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 124a8ec6cf690..0e5b0e6114e1e 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2792,6 +2792,25 @@ public class TelephonyManager { return false; } + /** + * Set the CDMA subscription source. + * Used for device supporting both NV and RUIM for CDMA. + * + * @param subscriptionType the subscription type, 0 for RUIM, 1 for NV. + * @return true on success; false on any failure. + * @hide + */ + public boolean setCdmaSubscription(int subscriptionType) { + try { + return getITelephony().setCdmaSubscription(subscriptionType); + } catch (RemoteException ex) { + Rlog.e(TAG, "setCdmaSubscription RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "setCdmaSubscription NPE", ex); + } + return false; + } + /** * Expose the rest of ITelephony to @SystemApi */ diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index beee6167e422e..237e7f3d342fc 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -605,6 +605,15 @@ interface ITelephony { */ boolean setPreferredNetworkType(int networkType); + /** + * Set the CDMA subscription source. + * Used for device supporting both NV and RUIM for CDMA. + * + * @param subscriptionType the subscription type, 0 for RUIM, 1 for NV. + * @return true on success; false on any failure. + */ + boolean setCdmaSubscription(int subscriptionType); + /** * User enable/disable Mobile Data. *