diff options
author | Oscar Shu <xshu@google.com> | 2020-06-18 17:23:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-18 17:23:27 +0000 |
commit | c5084bbfcbad824a3c789c99caa42dcb891190e8 (patch) | |
tree | 759ffd31a33426ac18826b059bda11c8525074cb /service | |
parent | 9f55a68611cdb7f0805af803f3f8f7487c9b208d (diff) | |
parent | ef4f7dc4ea5619b713bcfaa4985338ec07b9f479 (diff) |
Merge "Fix NPE in BssidBlocklistMonitor" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/BssidBlocklistMonitor.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/BssidBlocklistMonitor.java b/service/java/com/android/server/wifi/BssidBlocklistMonitor.java index 96770443d..dffd77443 100644 --- a/service/java/com/android/server/wifi/BssidBlocklistMonitor.java +++ b/service/java/com/android/server/wifi/BssidBlocklistMonitor.java @@ -220,6 +220,12 @@ public class BssidBlocklistMonitor { */ public void blockBssidForDurationMs(@NonNull String bssid, @NonNull String ssid, long durationMs) { + if (bssid == null || ssid == null || WifiManager.UNKNOWN_SSID.equals(ssid) + || bssid.equals(ClientModeImpl.SUPPLICANT_BSSID_ANY) || durationMs <= 0) { + Log.e(TAG, "Invalid input: BSSID=" + bssid + ", SSID=" + ssid + + ", durationMs=" + durationMs); + return; + } BssidStatus status = getOrCreateBssidStatus(bssid, ssid); if (status.isInBlocklist && status.blocklistEndTimeMs - mClock.getWallClockMillis() > durationMs) { @@ -407,6 +413,9 @@ public class BssidBlocklistMonitor { int prevSize = mBssidStatusMap.size(); mBssidStatusMap.entrySet().removeIf(e -> { BssidStatus status = e.getValue(); + if (status.ssid == null) { + return false; + } if (status.ssid.equals(ssid)) { mBssidStatusHistoryLogger.add(status, "clearBssidBlocklistForSsid"); return true; |