summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java18
2 files changed, 19 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 87d7a100b..3f31c7ff8 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -720,7 +720,7 @@ public class WifiConfigManager {
internalConfig.SSID = externalConfig.SSID;
}
if (externalConfig.BSSID != null) {
- internalConfig.BSSID = externalConfig.BSSID;
+ internalConfig.BSSID = externalConfig.BSSID.toLowerCase();
}
internalConfig.hiddenSSID = externalConfig.hiddenSSID;
if (externalConfig.preSharedKey != null
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index 987c50937..f61013841 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -3170,6 +3170,24 @@ public class WifiConfigManagerTest {
result.getNetworkId()); // Update networkID
}
+ /**
+ * Verifies that the app specified BSSID is converted and saved in lower case.
+ */
+ @Test
+ public void testAppSpecifiedBssidIsSavedInLowerCase() {
+ final String bssid = "0A:08:5C:BB:89:6D"; // upper case
+ WifiConfiguration openNetwork = WifiConfigurationTestUtil.createOpenNetwork();
+ openNetwork.BSSID = bssid;
+
+ NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(openNetwork);
+
+ WifiConfiguration retrievedNetwork = mWifiConfigManager.getConfiguredNetwork(
+ result.getNetworkId());
+
+ assertNotEquals(retrievedNetwork.BSSID, bssid);
+ assertEquals(retrievedNetwork.BSSID, bssid.toLowerCase());
+ }
+
private NetworkUpdateResult verifyAddOrUpdateNetworkWithProxySettingsAndPermissions(
boolean withConfOverride,
boolean withProfileOwnerPolicy,