diff --git a/api/current.txt b/api/current.txt index 5d3477f8641c3..93b09952e2a21 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29009,7 +29009,6 @@ package android.telephony { method public void enableSimplifiedNetworkSettings(boolean); method public void enableSimplifiedNetworkSettings(long, boolean); method public java.util.List getAllCellInfo(); - method public int getCalculatedPreferredNetworkType(); method public int getCallState(); method public android.telephony.CellLocation getCellLocation(); method public int getDataActivity(); @@ -29026,7 +29025,6 @@ package android.telephony { method public java.lang.String getNetworkOperatorName(); method public int getNetworkType(); method public int getPhoneType(); - method public int getPreferredNetworkType(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName(); @@ -29048,10 +29046,10 @@ package android.telephony { method public boolean isSmsCapable(); method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); + method public boolean setGlobalPreferredNetworkType(); method public void setLine1NumberForDisplay(java.lang.String, java.lang.String); method public void setLine1NumberForDisplay(long, java.lang.String, java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String); - method public boolean setPreferredNetworkType(int); field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final int CALL_STATE_IDLE = 0; // 0x0 diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0af1ca08bf46e..53a7a73800501 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2902,27 +2902,6 @@ public class TelephonyManager { } } - /** - * Get the calculated preferred network type. - * Used for debugging incorrect network type. - *

- * 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. @@ -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 { @@ -2966,6 +2947,20 @@ public class TelephonyManager { return false; } + /** + * Set the preferred network type to global mode which includes LTE, CDMA, EvDo and GSM/WCDMA. + * + *

+ * 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. */