diff options
author | Derek Tan <derektan@google.com> | 2014-09-05 15:53:01 -0700 |
---|---|---|
committer | Derek Tan <derektan@google.com> | 2014-09-05 17:06:46 -0700 |
commit | 54e883bedc8a2402a8b13d27bc055c5ed1a70015 (patch) | |
tree | 30dc641a3fd5cffed529a48ff2fcf697088df252 /telephony | |
parent | b5928445d12d92598845bcef3cd019aa09acb12d (diff) | |
download | frameworks_base-54e883bedc8a2402a8b13d27bc055c5ed1a70015.zip frameworks_base-54e883bedc8a2402a8b13d27bc055c5ed1a70015.tar.gz frameworks_base-54e883bedc8a2402a8b13d27bc055c5ed1a70015.tar.bz2 |
Update the preferred network type APIs.
Bug: 17255752
Change-Id: I8f74749752f8d8c6cd5b28dd5fe4ed89a33481ed
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0af1ca0..53a7a73 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2903,27 +2903,6 @@ public class TelephonyManager { } /** - * Get the calculated preferred network type. - * Used for debugging incorrect network type. - * <p> - * Requires Permission: - * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} - * - * @return the preferred network type, defined in RILConstants.java or -1 if - * none available. - */ - public int getCalculatedPreferredNetworkType() { - try { - return getITelephony().getCalculatedPreferredNetworkType(); - } catch (RemoteException ex) { - Rlog.e(TAG, "getCalculatedPreferredNetworkType RemoteException", ex); - } catch (NullPointerException ex) { - Rlog.e(TAG, "getCalculatedPreferredNetworkType NPE", ex); - } - return -1; - } - - /** * Get the preferred network type. * Used for device configuration by some CDMA operators. * <p> @@ -2932,6 +2911,7 @@ public class TelephonyManager { * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @return the preferred network type, defined in RILConstants.java. + * @hide */ public int getPreferredNetworkType() { try { @@ -2954,6 +2934,7 @@ public class TelephonyManager { * * @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 { @@ -2967,6 +2948,20 @@ public class TelephonyManager { } /** + * Set the preferred network type to global mode which includes LTE, CDMA, EvDo and GSM/WCDMA. + * + * <p> + * Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges + * + * @return true on success; false on any failure. + */ + public boolean setGlobalPreferredNetworkType() { + return setPreferredNetworkType(RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA); + } + + /** * Values used to return status for hasCarrierPrivileges call. */ public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; |