am de6fefb4: Merge "Update the preferred network type APIs." into lmp-dev

* commit 'de6fefb4f5e9da6aedc600abd7c10d14398b47c7':
  Update the preferred network type APIs.
This commit is contained in:
Derek Tan
2014-09-06 00:18:28 +00:00
committed by Android Git Automerger
2 changed files with 17 additions and 24 deletions

View File

@@ -29009,7 +29009,6 @@ package android.telephony {
method public void enableSimplifiedNetworkSettings(boolean);
method public void enableSimplifiedNetworkSettings(long, boolean);
method public java.util.List<android.telephony.CellInfo> 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

View File

@@ -2949,27 +2949,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.
@@ -2979,6 +2958,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 {
@@ -3001,6 +2981,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 {
@@ -3013,6 +2994,20 @@ public class TelephonyManager {
return false;
}
/**
* 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.
*/