diff options
author | Oscar Shu <xshu@google.com> | 2020-04-07 17:35:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-07 17:35:26 +0000 |
commit | 82298418fe24c1d0d8f62ba1b79e55d168bf6351 (patch) | |
tree | 91d004336f9b99b9e73ad31387b76ab98e0e442f /service | |
parent | 21f44c83048dc643d699fe821ccc17a4e0509eb0 (diff) | |
parent | 8621d267442a829f94627183de76215acdcabf97 (diff) |
Merge "BssidBlocklistMonitor - log block reason" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/BssidBlocklistMonitor.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/BssidBlocklistMonitor.java b/service/java/com/android/server/wifi/BssidBlocklistMonitor.java index 70c919340..2d93e304d 100644 --- a/service/java/com/android/server/wifi/BssidBlocklistMonitor.java +++ b/service/java/com/android/server/wifi/BssidBlocklistMonitor.java @@ -155,7 +155,7 @@ public class BssidBlocklistMonitor { } private void addToBlocklist(@NonNull BssidStatus entry, long durationMs, String reasonString) { - entry.addToBlocklist(durationMs); + entry.addToBlocklist(durationMs, reasonString); localLog(TAG + " addToBlocklist: bssid=" + entry.bssid + ", ssid=" + entry.ssid + ", durationMs=" + durationMs + ", reason=" + reasonString); } @@ -497,6 +497,7 @@ public class BssidBlocklistMonitor { public final String bssid; public final String ssid; public final int[] failureCount = new int[NUMBER_REASON_CODES]; + private String mBlockReason = ""; // reason of blocking for logging only // The following are used to flag how long this BSSID stays in the blocklist. public boolean isInBlocklist; @@ -519,9 +520,10 @@ public class BssidBlocklistMonitor { * Add this BSSID to blocklist for the specified duration. * @param durationMs */ - public void addToBlocklist(long durationMs) { + public void addToBlocklist(long durationMs, String blockReason) { isInBlocklist = true; blocklistEndTimeMs = mClock.getWallClockMillis() + durationMs; + mBlockReason = blockReason; } /** @@ -530,6 +532,7 @@ public class BssidBlocklistMonitor { public void removeFromBlocklist() { isInBlocklist = false; blocklistEndTimeMs = 0; + mBlockReason = ""; localLog(TAG + " removeFromBlocklist BSSID=" + bssid); } @@ -540,6 +543,7 @@ public class BssidBlocklistMonitor { sb.append(", SSID=" + ssid); sb.append(", isInBlocklist=" + isInBlocklist); if (isInBlocklist) { + sb.append(", blockReason=" + mBlockReason); mCalendar.setTimeInMillis(blocklistEndTimeMs); sb.append(", blocklistEndTimeMs=" + String.format("%tm-%td %tH:%tM:%tS.%tL", mCalendar, mCalendar, |