diff options
author | Jake Hamby <jhamby@google.com> | 2014-03-03 13:27:20 -0800 |
---|---|---|
committer | Jake Hamby <jhamby@google.com> | 2014-03-03 13:27:20 -0800 |
commit | 4a2fa35a6ad03d5ee1cd03ae94b4e7d70b50811c (patch) | |
tree | 3ec3e712e95f61c9faeb0a3b3b12e4e0baee84f3 /telephony/java/android | |
parent | 03c6628f40a2e56a214990da127242707ff02b73 (diff) | |
download | frameworks_base-4a2fa35a6ad03d5ee1cd03ae94b4e7d70b50811c.zip frameworks_base-4a2fa35a6ad03d5ee1cd03ae94b4e7d70b50811c.tar.gz frameworks_base-4a2fa35a6ad03d5ee1cd03ae94b4e7d70b50811c.tar.bz2 |
Add get/setPreferredNetworkType() for OMA DM client.
Add get/setPreferredNetworkType() commands for OMA DM client.
Bug: 8847590
Change-Id: Ia898d712b90ec583d61efe7385a5a1844d8beff1
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index d28d76d..ec4d574 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1841,4 +1841,41 @@ public class TelephonyManager { } return false; } + + /** + * Get the preferred network type. + * Used for device configuration by some CDMA operators. + * + * @return the preferred network type, defined in RILConstants.java. + * @hide + */ + public int getPreferredNetworkType() { + try { + return getITelephony().getPreferredNetworkType(); + } catch (RemoteException ex) { + Rlog.e(TAG, "getPreferredNetworkType RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "getPreferredNetworkType NPE", ex); + } + return -1; + } + + /** + * Set the preferred network type. + * Used for device configuration by some CDMA operators. + * + * @param networkType the preferred network type, defined in RILConstants.java. + * @return true on success; false on any failure. + * @hide + */ + public boolean setPreferredNetworkType(int networkType) { + try { + return getITelephony().setPreferredNetworkType(networkType); + } catch (RemoteException ex) { + Rlog.e(TAG, "setPreferredNetworkType RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "setPreferredNetworkType NPE", ex); + } + return false; + } } |