Merge changes from topic "api-review-getNetworkDisableReasonString" into rvc-dev

* changes:
  Settings: Rename NetworkSelectionStatus#getNetworkDisableReasonString
  Rename NetworkSelectionStatus#getNetworkDisableReasonString
This commit is contained in:
David Su
2020-02-26 23:42:53 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 10 deletions

View File

@@ -7315,8 +7315,8 @@ package android.net.wifi {
method @Deprecated public int getDisableReasonCounter(int); method @Deprecated public int getDisableReasonCounter(int);
method @Deprecated public long getDisableTime(); method @Deprecated public long getDisableTime();
method @Deprecated public static int getMaxNetworkSelectionDisableReason(); method @Deprecated public static int getMaxNetworkSelectionDisableReason();
method @Deprecated @Nullable public static String getNetworkDisableReasonString(int);
method @Deprecated public int getNetworkSelectionDisableReason(); method @Deprecated public int getNetworkSelectionDisableReason();
method @Deprecated @Nullable public static String getNetworkSelectionDisableReasonString(int);
method @Deprecated public int getNetworkSelectionStatus(); method @Deprecated public int getNetworkSelectionStatus();
method @Deprecated @NonNull public String getNetworkStatusString(); method @Deprecated @NonNull public String getNetworkStatusString();
method @Deprecated public boolean hasEverConnected(); method @Deprecated public boolean hasEverConnected();

View File

@@ -68,7 +68,8 @@ public class WifiUtils {
for (int reason = 0; reason <= getMaxNetworkSelectionDisableReason(); reason++) { for (int reason = 0; reason <= getMaxNetworkSelectionDisableReason(); reason++) {
if (networkStatus.getDisableReasonCounter(reason) != 0) { if (networkStatus.getDisableReasonCounter(reason) != 0) {
summary.append(" ") summary.append(" ")
.append(NetworkSelectionStatus.getNetworkDisableReasonString(reason)) .append(NetworkSelectionStatus
.getNetworkSelectionDisableReasonString(reason))
.append("=") .append("=")
.append(networkStatus.getDisableReasonCounter(reason)); .append(networkStatus.getDisableReasonCounter(reason));
} }

View File

@@ -1713,7 +1713,7 @@ public class WifiConfiguration implements Parcelable {
* @return network disable reason string, or null if the reason is invalid. * @return network disable reason string, or null if the reason is invalid.
*/ */
@Nullable @Nullable
public static String getNetworkDisableReasonString( public static String getNetworkSelectionDisableReasonString(
@NetworkSelectionDisableReason int reason) { @NetworkSelectionDisableReason int reason) {
DisableReasonInfo info = DISABLE_REASON_INFOS.get(reason); DisableReasonInfo info = DISABLE_REASON_INFOS.get(reason);
if (info == null) { if (info == null) {
@@ -1727,8 +1727,8 @@ public class WifiConfiguration implements Parcelable {
* @return current network disable reason in String (for debug purpose) * @return current network disable reason in String (for debug purpose)
* @hide * @hide
*/ */
public String getNetworkDisableReasonString() { public String getNetworkSelectionDisableReasonString() {
return getNetworkDisableReasonString(mNetworkSelectionDisableReason); return getNetworkSelectionDisableReasonString(mNetworkSelectionDisableReason);
} }
/** /**
@@ -2189,17 +2189,21 @@ public class WifiConfiguration implements Parcelable {
sbuf.append(" NetworkSelectionStatus ") sbuf.append(" NetworkSelectionStatus ")
.append(mNetworkSelectionStatus.getNetworkStatusString() + "\n"); .append(mNetworkSelectionStatus.getNetworkStatusString())
.append("\n");
if (mNetworkSelectionStatus.getNetworkSelectionDisableReason() > 0) { if (mNetworkSelectionStatus.getNetworkSelectionDisableReason() > 0) {
sbuf.append(" mNetworkSelectionDisableReason ") sbuf.append(" mNetworkSelectionDisableReason ")
.append(mNetworkSelectionStatus.getNetworkDisableReasonString() + "\n"); .append(mNetworkSelectionStatus.getNetworkSelectionDisableReasonString())
.append("\n");
for (int index = NetworkSelectionStatus.DISABLED_NONE; for (int index = NetworkSelectionStatus.DISABLED_NONE;
index < NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; index++) { index < NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; index++) {
if (mNetworkSelectionStatus.getDisableReasonCounter(index) != 0) { if (mNetworkSelectionStatus.getDisableReasonCounter(index) != 0) {
sbuf.append(NetworkSelectionStatus.getNetworkDisableReasonString(index) sbuf.append(
+ " counter:" + mNetworkSelectionStatus.getDisableReasonCounter(index) NetworkSelectionStatus.getNetworkSelectionDisableReasonString(index))
+ "\n"); .append(" counter:")
.append(mNetworkSelectionStatus.getDisableReasonCounter(index))
.append("\n");
} }
} }
} }