Merge "Support exposing getNetworkSelectionMode"
This commit is contained in:
@@ -45750,6 +45750,7 @@ package android.telephony {
|
|||||||
method public String getNetworkCountryIso();
|
method public String getNetworkCountryIso();
|
||||||
method public String getNetworkOperator();
|
method public String getNetworkOperator();
|
||||||
method public String getNetworkOperatorName();
|
method public String getNetworkOperatorName();
|
||||||
|
method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public int getNetworkSelectionMode();
|
||||||
method public String getNetworkSpecifier();
|
method public String getNetworkSpecifier();
|
||||||
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType();
|
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType();
|
||||||
method @Deprecated public int getPhoneCount();
|
method @Deprecated public int getPhoneCount();
|
||||||
@@ -45882,6 +45883,9 @@ package android.telephony {
|
|||||||
field public static final int MULTISIM_ALLOWED = 0; // 0x0
|
field public static final int MULTISIM_ALLOWED = 0; // 0x0
|
||||||
field public static final int MULTISIM_NOT_SUPPORTED_BY_CARRIER = 2; // 0x2
|
field public static final int MULTISIM_NOT_SUPPORTED_BY_CARRIER = 2; // 0x2
|
||||||
field public static final int MULTISIM_NOT_SUPPORTED_BY_HARDWARE = 1; // 0x1
|
field public static final int MULTISIM_NOT_SUPPORTED_BY_HARDWARE = 1; // 0x1
|
||||||
|
field public static final int NETWORK_SELECTION_MODE_AUTO = 1; // 0x1
|
||||||
|
field public static final int NETWORK_SELECTION_MODE_MANUAL = 2; // 0x2
|
||||||
|
field public static final int NETWORK_SELECTION_MODE_UNKNOWN = 0; // 0x0
|
||||||
field public static final int NETWORK_TYPE_1xRTT = 7; // 0x7
|
field public static final int NETWORK_TYPE_1xRTT = 7; // 0x7
|
||||||
field public static final int NETWORK_TYPE_CDMA = 4; // 0x4
|
field public static final int NETWORK_TYPE_CDMA = 4; // 0x4
|
||||||
field public static final int NETWORK_TYPE_EDGE = 2; // 0x2
|
field public static final int NETWORK_TYPE_EDGE = 2; // 0x2
|
||||||
|
|||||||
@@ -196,11 +196,8 @@ public class TelephonyManager {
|
|||||||
NETWORK_SELECTION_MODE_MANUAL})
|
NETWORK_SELECTION_MODE_MANUAL})
|
||||||
public @interface NetworkSelectionMode {}
|
public @interface NetworkSelectionMode {}
|
||||||
|
|
||||||
/** @hide */
|
|
||||||
public static final int NETWORK_SELECTION_MODE_UNKNOWN = 0;
|
public static final int NETWORK_SELECTION_MODE_UNKNOWN = 0;
|
||||||
/** @hide */
|
|
||||||
public static final int NETWORK_SELECTION_MODE_AUTO = 1;
|
public static final int NETWORK_SELECTION_MODE_AUTO = 1;
|
||||||
/** @hide */
|
|
||||||
public static final int NETWORK_SELECTION_MODE_MANUAL = 2;
|
public static final int NETWORK_SELECTION_MODE_MANUAL = 2;
|
||||||
|
|
||||||
/** The otaspMode passed to PhoneStateListener#onOtaspChanged */
|
/** The otaspMode passed to PhoneStateListener#onOtaspChanged */
|
||||||
@@ -7524,14 +7521,18 @@ public class TelephonyManager {
|
|||||||
*
|
*
|
||||||
* <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
|
* <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
|
||||||
* given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
|
* given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
|
||||||
|
* <p>Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE
|
||||||
* @return the network selection mode.
|
* READ_PRECISE_PHONE_STATE}
|
||||||
|
* or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
|
||||||
*
|
*
|
||||||
* @hide
|
* @return the network selection mode.
|
||||||
*/
|
*/
|
||||||
@NetworkSelectionMode
|
@SuppressAutoDoc // No support for carrier privileges (b/72967236).
|
||||||
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
@RequiresPermission(anyOf = {
|
||||||
public int getNetworkSelectionMode() {
|
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
|
||||||
|
android.Manifest.permission.READ_PRECISE_PHONE_STATE
|
||||||
|
})
|
||||||
|
public @NetworkSelectionMode int getNetworkSelectionMode() {
|
||||||
int mode = NETWORK_SELECTION_MODE_UNKNOWN;
|
int mode = NETWORK_SELECTION_MODE_UNKNOWN;
|
||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
|
|||||||
Reference in New Issue
Block a user