summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorxinhe <xinhe@google.com>2015-07-31 12:50:55 -0700
committerxinhe <xinhe@google.com>2015-07-31 12:50:55 -0700
commitf2c01041fe1a5e8b51970774c4ac6f04eb5967f0 (patch)
treef0d7c72eb242dee2d1d4aeac31d02de4da8b77b6 /wifi
parent4604c1dc67f634e1fac37f623f5b093615d49f0f (diff)
downloadframeworks_base-f2c01041fe1a5e8b51970774c4ac6f04eb5967f0.zip
frameworks_base-f2c01041fe1a5e8b51970774c4ac6f04eb5967f0.tar.gz
frameworks_base-f2c01041fe1a5e8b51970774c4ac6f04eb5967f0.tar.bz2
Boot loop when SSID has non UTF-8 character in the name
b/22773761 Change-Id: I44c8a19c11470ab16baf27eef252097690ef5d4a
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/ScanResult.java16
-rw-r--r--wifi/java/android/net/wifi/WifiScanner.java2
2 files changed, 13 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index cc1e976..8a20012 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -363,11 +363,10 @@ public class ScanResult implements Parcelable {
}
/** {@hide} */
- public ScanResult(WifiSsid wifiSsid, String BSSID, String caps, int level, int frequency,
+ public ScanResult(String Ssid, String BSSID, String caps, int level, int frequency,
long tsf, int distCm, int distSdCm, int channelWidth, int centerFreq0, int centerFreq1,
boolean is80211McRTTResponder) {
- this.wifiSsid = wifiSsid;
- this.SSID = (wifiSsid != null) ? wifiSsid.toString() : WifiSsid.NONE;
+ this.SSID = Ssid;
this.BSSID = BSSID;
this.capabilities = caps;
this.level = level;
@@ -385,6 +384,15 @@ public class ScanResult implements Parcelable {
}
}
+ /** {@hide} */
+ public ScanResult(WifiSsid wifiSsid, String Ssid, String BSSID, String caps, int level,
+ int frequency, long tsf, int distCm, int distSdCm, int channelWidth,
+ int centerFreq0, int centerFreq1, boolean is80211McRTTResponder) {
+ this(Ssid, BSSID, caps,level, frequency, tsf, distCm, distSdCm, channelWidth, centerFreq0,
+ centerFreq1, is80211McRTTResponder);
+ this.wifiSsid = wifiSsid;
+ }
+
/** copy constructor {@hide} */
public ScanResult(ScanResult source) {
if (source != null) {
@@ -469,6 +477,7 @@ public class ScanResult implements Parcelable {
} else {
dest.writeInt(0);
}
+ dest.writeString(SSID);
dest.writeString(BSSID);
dest.writeString(capabilities);
dest.writeInt(level);
@@ -512,6 +521,7 @@ public class ScanResult implements Parcelable {
}
ScanResult sr = new ScanResult(
wifiSsid,
+ in.readString(), /* SSID */
in.readString(), /* BSSID */
in.readString(), /* capabilities */
in.readInt(), /* level */
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index a3dc077..a65f250 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -255,9 +255,7 @@ public class WifiScanner {
mResults = new ScanResult[s.mResults.length];
for (int i = 0; i < s.mResults.length; i++) {
ScanResult result = s.mResults[i];
- WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(result.SSID);
ScanResult newResult = new ScanResult(result);
- newResult.wifiSsid = wifiSsid;
mResults[i] = newResult;
}
}