summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2020-01-23 18:58:06 -0800
committerDavid Su <dysu@google.com>2020-01-24 10:10:51 -0800
commit1750ca5df88fb23ed3b44030341f74459b90ebc9 (patch)
tree37f0713f4f9b32d1b298b8ec7b018a1a25ae0b80
parentb45dc82408a75d76aa7abe9378534a099d37b33c (diff)
Rename removeDoubleQuotes to sanitizeSsid
Bug: 145745815 Test: compiles Change-Id: I2ecb8185a8ea4645043f52b4029ca8b047808e5d
-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 cda52adc2..dec9b11f6 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;
@@ -118,7 +118,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 2b6dd2566..3fa7e70c7 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;
@@ -713,11 +713,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)) {
@@ -761,7 +761,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);
}