diff --git a/api/current.txt b/api/current.txt index 0e517e67c1512..8496858e260ca 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45751,6 +45751,7 @@ package android.telephony { method public String getNetworkCountryIso(); method public String getNetworkOperator(); 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 @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType(); method @Deprecated public int getPhoneCount(); @@ -45883,6 +45884,9 @@ package android.telephony { 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_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_CDMA = 4; // 0x4 field public static final int NETWORK_TYPE_EDGE = 2; // 0x2 diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index bd8321e21f1ba..ef631b8a05dcd 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -196,11 +196,8 @@ public class TelephonyManager { NETWORK_SELECTION_MODE_MANUAL}) public @interface NetworkSelectionMode {} - /** @hide */ public static final int NETWORK_SELECTION_MODE_UNKNOWN = 0; - /** @hide */ public static final int NETWORK_SELECTION_MODE_AUTO = 1; - /** @hide */ public static final int NETWORK_SELECTION_MODE_MANUAL = 2; /** The otaspMode passed to PhoneStateListener#onOtaspChanged */ @@ -7524,14 +7521,18 @@ public class TelephonyManager { * *
If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()} - - * @return the network selection mode. + *
Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE + * READ_PRECISE_PHONE_STATE} + * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). * - * @hide + * @return the network selection mode. */ - @NetworkSelectionMode - @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public int getNetworkSelectionMode() { + @SuppressAutoDoc // No support for carrier privileges (b/72967236). + @RequiresPermission(anyOf = { + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, + android.Manifest.permission.READ_PRECISE_PHONE_STATE + }) + public @NetworkSelectionMode int getNetworkSelectionMode() { int mode = NETWORK_SELECTION_MODE_UNKNOWN; try { ITelephony telephony = getITelephony();