Rename NetworkSelectionStatus.NETWORK_SELECTION_ENABLE

Renamed to DISABLED_NONE to be consistent with the
other DISABLE_* constants.

Bug: 146046526
Test: compiles
Change-Id: Ic1aedf783e28ad773614dc879cf9d2d2393a28ed
This commit is contained in:
David Su
2020-01-30 17:57:22 -08:00
parent c87521077d
commit 6b3e3cb4c8
3 changed files with 21 additions and 21 deletions

View File

@@ -7576,10 +7576,10 @@ package android.net.wifi {
field @Deprecated public static final int DISABLED_BY_WIFI_MANAGER = 7; // 0x7
field @Deprecated public static final int DISABLED_BY_WRONG_PASSWORD = 8; // 0x8
field @Deprecated public static final int DISABLED_DHCP_FAILURE = 3; // 0x3
field @Deprecated public static final int DISABLED_NONE = 0; // 0x0
field @Deprecated public static final int DISABLED_NO_INTERNET_PERMANENT = 6; // 0x6
field @Deprecated public static final int DISABLED_NO_INTERNET_TEMPORARY = 4; // 0x4
field @Deprecated public static final int NETWORK_SELECTION_DISABLED_MAX = 10; // 0xa
field @Deprecated public static final int NETWORK_SELECTION_ENABLE = 0; // 0x0
field @Deprecated public static final int NETWORK_SELECTION_ENABLED = 0; // 0x0
field @Deprecated public static final int NETWORK_SELECTION_PERMANENTLY_DISABLED = 2; // 0x2
field @Deprecated public static final int NETWORK_SELECTION_TEMPORARY_DISABLED = 1; // 0x1

View File

@@ -60,7 +60,7 @@ public class WifiUtils {
if (config != null) {
WifiConfiguration.NetworkSelectionStatus networkStatus =
config.getNetworkSelectionStatus();
for (int index = WifiConfiguration.NetworkSelectionStatus.NETWORK_SELECTION_ENABLE;
for (int index = WifiConfiguration.NetworkSelectionStatus.DISABLED_NONE;
index < WifiConfiguration.NetworkSelectionStatus
.NETWORK_SELECTION_DISABLED_MAX; index++) {
if (networkStatus.getDisableReasonCounter(index) != 0) {

View File

@@ -1251,8 +1251,8 @@ public class WifiConfiguration implements Parcelable {
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
NETWORK_SELECTION_ENABLE,
@IntDef(prefix = "DISABLED_", value = {
DISABLED_NONE,
DISABLED_ASSOCIATION_REJECTION,
DISABLED_AUTHENTICATION_FAILURE,
DISABLED_DHCP_FAILURE,
@@ -1266,7 +1266,7 @@ public class WifiConfiguration implements Parcelable {
// Quality Network disabled reasons
/** Default value. Means not disabled. */
public static final int NETWORK_SELECTION_ENABLE = 0;
public static final int DISABLED_NONE = 0;
/**
* The starting index for network selection disabled reasons.
* @hide
@@ -1355,7 +1355,7 @@ public class WifiConfiguration implements Parcelable {
private static SparseArray<DisableReasonInfo> buildDisableReasonInfos() {
SparseArray<DisableReasonInfo> reasons = new SparseArray<>();
reasons.append(NETWORK_SELECTION_ENABLE,
reasons.append(DISABLED_NONE,
new DisableReasonInfo(
// Note that these strings are persisted in
// XmlUtil.NetworkSelectionStatusXmlUtil#writeToXml,
@@ -1649,7 +1649,7 @@ public class WifiConfiguration implements Parcelable {
/**
*
* Set the current network's disable reason.
* One of the {@link #NETWORK_SELECTION_ENABLE} or DISABLED_* constants.
* One of the {@link #DISABLED_NONE} or DISABLED_* constants.
* e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
* @see NetworkSelectionStatus#getNetworkSelectionDisableReason()
*/
@@ -1673,7 +1673,7 @@ public class WifiConfiguration implements Parcelable {
/**
* Get the network disable reason string for a reason code (for debugging).
* @param reason specific error reason. One of the {@link #NETWORK_SELECTION_ENABLE} or
* @param reason specific error reason. One of the {@link #DISABLED_NONE} or
* DISABLED_* constants e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
* @return network disable reason string, or null if the reason is invalid.
*/
@@ -1739,7 +1739,7 @@ public class WifiConfiguration implements Parcelable {
/**
* Returns the current network's disable reason.
* One of the {@link #NETWORK_SELECTION_ENABLE} or DISABLED_* constants
* One of the {@link #DISABLED_NONE} or DISABLED_* constants
* e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
*/
@NetworkSelectionDisableReason
@@ -1779,13 +1779,13 @@ public class WifiConfiguration implements Parcelable {
/**
* Get the disable counter of a specific reason.
* @param reason specific failure reason. One of the {@link #NETWORK_SELECTION_ENABLE} or
* @param reason specific failure reason. One of the {@link #DISABLED_NONE} or
* DISABLED_* constants e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
* @exception IllegalArgumentException for invalid reason
* @return counter number for specific error reason.
*/
public int getDisableReasonCounter(@NetworkSelectionDisableReason int reason) {
if (reason >= NETWORK_SELECTION_ENABLE && reason < NETWORK_SELECTION_DISABLED_MAX) {
if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
return mNetworkSeclectionDisableCounter[reason];
} else {
throw new IllegalArgumentException("Illegal reason value: " + reason);
@@ -1800,7 +1800,7 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public void setDisableReasonCounter(int reason, int value) {
if (reason >= NETWORK_SELECTION_ENABLE && reason < NETWORK_SELECTION_DISABLED_MAX) {
if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
mNetworkSeclectionDisableCounter[reason] = value;
} else {
throw new IllegalArgumentException("Illegal reason value: " + reason);
@@ -1814,7 +1814,7 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public void incrementDisableReasonCounter(int reason) {
if (reason >= NETWORK_SELECTION_ENABLE && reason < NETWORK_SELECTION_DISABLED_MAX) {
if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
mNetworkSeclectionDisableCounter[reason]++;
} else {
throw new IllegalArgumentException("Illegal reason value: " + reason);
@@ -1828,8 +1828,8 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public void clearDisableReasonCounter(int reason) {
if (reason >= NETWORK_SELECTION_ENABLE && reason < NETWORK_SELECTION_DISABLED_MAX) {
mNetworkSeclectionDisableCounter[reason] = NETWORK_SELECTION_ENABLE;
if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
mNetworkSeclectionDisableCounter[reason] = DISABLED_NONE;
} else {
throw new IllegalArgumentException("Illegal reason value: " + reason);
}
@@ -1840,7 +1840,7 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public void clearDisableReasonCounter() {
Arrays.fill(mNetworkSeclectionDisableCounter, NETWORK_SELECTION_ENABLE);
Arrays.fill(mNetworkSeclectionDisableCounter, DISABLED_NONE);
}
/**
@@ -1870,7 +1870,7 @@ public class WifiConfiguration implements Parcelable {
public void copy(NetworkSelectionStatus source) {
mStatus = source.mStatus;
mNetworkSelectionDisableReason = source.mNetworkSelectionDisableReason;
for (int index = NETWORK_SELECTION_ENABLE; index < NETWORK_SELECTION_DISABLED_MAX;
for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
index++) {
mNetworkSeclectionDisableCounter[index] =
source.mNetworkSeclectionDisableCounter[index];
@@ -1888,7 +1888,7 @@ public class WifiConfiguration implements Parcelable {
public void writeToParcel(Parcel dest) {
dest.writeInt(getNetworkSelectionStatus());
dest.writeInt(getNetworkSelectionDisableReason());
for (int index = NETWORK_SELECTION_ENABLE; index < NETWORK_SELECTION_DISABLED_MAX;
for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
index++) {
dest.writeInt(getDisableReasonCounter(index));
}
@@ -1907,7 +1907,7 @@ public class WifiConfiguration implements Parcelable {
public void readFromParcel(Parcel in) {
setNetworkSelectionStatus(in.readInt());
setNetworkSelectionDisableReason(in.readInt());
for (int index = NETWORK_SELECTION_ENABLE; index < NETWORK_SELECTION_DISABLED_MAX;
for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
index++) {
setDisableReasonCounter(index, in.readInt());
}
@@ -2129,8 +2129,8 @@ public class WifiConfiguration implements Parcelable {
sbuf.append(" mNetworkSelectionDisableReason ")
.append(mNetworkSelectionStatus.getNetworkDisableReasonString() + "\n");
for (int index = mNetworkSelectionStatus.NETWORK_SELECTION_ENABLE;
index < mNetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; index++) {
for (int index = NetworkSelectionStatus.DISABLED_NONE;
index < NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; index++) {
if (mNetworkSelectionStatus.getDisableReasonCounter(index) != 0) {
sbuf.append(NetworkSelectionStatus.getNetworkDisableReasonString(index)
+ " counter:" + mNetworkSelectionStatus.getDisableReasonCounter(index)