Add debug output for bad wifi avoidance restrictions. am: a4e8808d16 am: c74af76009
am: 86bd4caed2 Change-Id: Ieedaeb98e71bc58f3813d7b5e5472c0e147e50f9
This commit is contained in:
@@ -2075,7 +2075,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mKeepaliveTracker.dump(pw);
|
mKeepaliveTracker.dump(pw);
|
||||||
|
|
||||||
pw.println();
|
pw.println();
|
||||||
|
dumpAvoidBadWifiSettings(pw);
|
||||||
|
|
||||||
|
pw.println();
|
||||||
if (mInetLog != null && mInetLog.size() > 0) {
|
if (mInetLog != null && mInetLog.size() > 0) {
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.println("Inet condition reports:");
|
pw.println("Inet condition reports:");
|
||||||
@@ -2812,6 +2814,42 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return mAvoidBadWifi != prev;
|
return mAvoidBadWifi != prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dumpAvoidBadWifiSettings(IndentingPrintWriter pw) {
|
||||||
|
boolean configRestrict = configRestrictsAvoidBadWifi();
|
||||||
|
if (!configRestrict) {
|
||||||
|
pw.println("Bad Wi-Fi avoidance: unrestricted");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pw.println("Bad Wi-Fi avoidance: " + avoidBadWifi());
|
||||||
|
pw.increaseIndent();
|
||||||
|
pw.println("Config restrict: " + configRestrict);
|
||||||
|
|
||||||
|
String value = Settings.Global.getString(
|
||||||
|
mContext.getContentResolver(), Settings.Global.NETWORK_AVOID_BAD_WIFI);
|
||||||
|
String description;
|
||||||
|
// Can't use a switch statement because strings are legal case labels, but null is not.
|
||||||
|
if ("0".equals(value)) {
|
||||||
|
description = "get stuck";
|
||||||
|
} else if (value == null) {
|
||||||
|
description = "prompt";
|
||||||
|
} else if ("1".equals(value)) {
|
||||||
|
description = "avoid";
|
||||||
|
} else {
|
||||||
|
description = value + " (?)";
|
||||||
|
}
|
||||||
|
pw.println("User setting: " + description);
|
||||||
|
pw.println("Network overrides:");
|
||||||
|
pw.increaseIndent();
|
||||||
|
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
||||||
|
if (nai.avoidUnvalidated) {
|
||||||
|
pw.println(nai.name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pw.decreaseIndent();
|
||||||
|
pw.decreaseIndent();
|
||||||
|
}
|
||||||
|
|
||||||
private void showValidationNotification(NetworkAgentInfo nai, NotificationType type) {
|
private void showValidationNotification(NetworkAgentInfo nai, NotificationType type) {
|
||||||
final String action;
|
final String action;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user