am 3832b13c: am 54cea234: Merge "Boot loop when SSID has non UTF-8 character in the name" into mnc-dev

* commit '3832b13c1fe316be416bacb1f1badc5e67f44b4e':
  Boot loop when SSID has non UTF-8 character in the name
This commit is contained in:
xin He
2015-08-05 01:27:12 +00:00
committed by Android Git Automerger
2 changed files with 13 additions and 5 deletions

View File

@@ -363,11 +363,10 @@ public class ScanResult implements Parcelable {
} }
/** {@hide} */ /** {@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, long tsf, int distCm, int distSdCm, int channelWidth, int centerFreq0, int centerFreq1,
boolean is80211McRTTResponder) { boolean is80211McRTTResponder) {
this.wifiSsid = wifiSsid; this.SSID = Ssid;
this.SSID = (wifiSsid != null) ? wifiSsid.toString() : WifiSsid.NONE;
this.BSSID = BSSID; this.BSSID = BSSID;
this.capabilities = caps; this.capabilities = caps;
this.level = level; 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} */ /** copy constructor {@hide} */
public ScanResult(ScanResult source) { public ScanResult(ScanResult source) {
if (source != null) { if (source != null) {
@@ -469,6 +477,7 @@ public class ScanResult implements Parcelable {
} else { } else {
dest.writeInt(0); dest.writeInt(0);
} }
dest.writeString(SSID);
dest.writeString(BSSID); dest.writeString(BSSID);
dest.writeString(capabilities); dest.writeString(capabilities);
dest.writeInt(level); dest.writeInt(level);
@@ -512,6 +521,7 @@ public class ScanResult implements Parcelable {
} }
ScanResult sr = new ScanResult( ScanResult sr = new ScanResult(
wifiSsid, wifiSsid,
in.readString(), /* SSID */
in.readString(), /* BSSID */ in.readString(), /* BSSID */
in.readString(), /* capabilities */ in.readString(), /* capabilities */
in.readInt(), /* level */ in.readInt(), /* level */

View File

@@ -255,9 +255,7 @@ public class WifiScanner {
mResults = new ScanResult[s.mResults.length]; mResults = new ScanResult[s.mResults.length];
for (int i = 0; i < s.mResults.length; i++) { for (int i = 0; i < s.mResults.length; i++) {
ScanResult result = s.mResults[i]; ScanResult result = s.mResults[i];
WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(result.SSID);
ScanResult newResult = new ScanResult(result); ScanResult newResult = new ScanResult(result);
newResult.wifiSsid = wifiSsid;
mResults[i] = newResult; mResults[i] = newResult;
} }
} }