summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2020-01-30 18:16:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-30 18:16:53 +0000
commit0d0e0d79d46390fd2a63787ae161c75df80df377 (patch)
treef188bb9428cd2b9b197d8b116244ecb89fa67d66
parentb6d7dd66e054c2b22365aed623309a8c168da4d6 (diff)
parent1750ca5df88fb23ed3b44030341f74459b90ebc9 (diff)
Merge "Rename removeDoubleQuotes to sanitizeSsid"
-rw-r--r--libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java4
-rw-r--r--libs/WifiTrackerLib/src/com/android/wifitrackerlib/StandardWifiEntry.java8
2 files changed, 6 insertions, 6 deletions
diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java
index 6749f6ede..b4610cb9c 100644
--- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java
+++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/PasspointWifiEntry.java
@@ -16,7 +16,7 @@
package com.android.wifitrackerlib;
-import static android.net.wifi.WifiInfo.removeDoubleQuotes;
+import static android.net.wifi.WifiInfo.sanitizeSsid;
import static androidx.core.util.Preconditions.checkNotNull;
@@ -113,7 +113,7 @@ class PasspointWifiEntry extends WifiEntry {
@Override
public String getSsid() {
- return mWifiConfig != null ? removeDoubleQuotes(mWifiConfig.SSID) : null;
+ return mWifiConfig != null ? sanitizeSsid(mWifiConfig.SSID) : null;
}
@Override
diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/StandardWifiEntry.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/StandardWifiEntry.java
index 02ae59ac5..44204cd25 100644
--- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/StandardWifiEntry.java
+++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/StandardWifiEntry.java
@@ -16,7 +16,7 @@
package com.android.wifitrackerlib;
-import static android.net.wifi.WifiInfo.removeDoubleQuotes;
+import static android.net.wifi.WifiInfo.sanitizeSsid;
import static androidx.core.util.Preconditions.checkNotNull;
@@ -715,11 +715,11 @@ class StandardWifiEntry extends WifiEntry {
@WorkerThread
void updateConfig(@Nullable WifiConfiguration wifiConfig) throws IllegalArgumentException {
if (wifiConfig != null) {
- if (!TextUtils.equals(mSsid, removeDoubleQuotes(wifiConfig.SSID))) {
+ if (!TextUtils.equals(mSsid, sanitizeSsid(wifiConfig.SSID))) {
throw new IllegalArgumentException(
"Attempted to update with wrong SSID!"
+ " Expected: " + mSsid
- + ", Actual: " + removeDoubleQuotes(wifiConfig.SSID)
+ + ", Actual: " + sanitizeSsid(wifiConfig.SSID)
+ ", Config: " + wifiConfig);
}
if (mSecurity != getSecurityTypeFromWifiConfiguration(wifiConfig)) {
@@ -763,7 +763,7 @@ class StandardWifiEntry extends WifiEntry {
static String wifiConfigToStandardWifiEntryKey(@NonNull WifiConfiguration config) {
checkNotNull(config, "Cannot create key with null config!");
checkNotNull(config.SSID, "Cannot create key with null SSID in config!");
- return KEY_PREFIX + removeDoubleQuotes(config.SSID) + ","
+ return KEY_PREFIX + sanitizeSsid(config.SSID) + ","
+ getSecurityTypeFromWifiConfiguration(config);
}