diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-11-18 19:06:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-11-18 19:06:58 +0000 |
commit | f8773d7e3b5bda7236c355d64751abb4eedba023 (patch) | |
tree | 0d98fc8f8562e635f673e777e71085a58ba6dede | |
parent | 908eda596c7d233b5ef234837b2e41cf4e8872f5 (diff) | |
parent | 503e557a87d364b725fd4b7a45a452d5fcb37163 (diff) |
Merge "Only report L2KeyAndGroupHint when connected"
-rw-r--r-- | service/java/com/android/server/wifi/WifiScoreCard.java | 3 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiScoreCardTest.java | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiScoreCard.java b/service/java/com/android/server/wifi/WifiScoreCard.java index e7a8715cf..22bd1b1ba 100644 --- a/service/java/com/android/server/wifi/WifiScoreCard.java +++ b/service/java/com/android/server/wifi/WifiScoreCard.java @@ -549,6 +549,9 @@ public class WifiScoreCard { } catch (IllegalArgumentException e) { return mDummyPerBssid; } + if (mac.equals(mDummyPerBssid.bssid)) { + return mDummyPerBssid; + } PerBssid ans = mApForBssid.get(mac); if (ans == null || !ans.ssid.equals(ssid)) { ans = new PerBssid(ssid, mac); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiScoreCardTest.java b/tests/wifitests/src/com/android/server/wifi/WifiScoreCardTest.java index 69ef041d3..5c2fc0a27 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiScoreCardTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiScoreCardTest.java @@ -144,6 +144,10 @@ public class WifiScoreCardTest extends WifiBaseTest { Pair<String, String> p3 = mWifiScoreCard.getL2KeyAndGroupHint(mWifiInfo); assertNull(p3.first); assertNull(p3.second); + mWifiInfo.setBSSID("02:00:00:00:00:00"); + Pair<String, String> p4 = mWifiScoreCard.getL2KeyAndGroupHint(mWifiInfo); + assertNull(p4.first); + assertNull(p4.second); } /** |