diff options
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; |