When wifi ssid is empty, return WifiSsid.NONE
Issue 199610 When WifistateMachine enter Roaming State, WifiInfo getSSID will return 0x, statusbar show "0x", because roaming State do not update WifiInfo mWifiSsid. Change-Id: I241f8e9c11dc16db26cadde133043745f2f19573 Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>
This commit is contained in:
@@ -320,7 +320,8 @@ public class WifiInfo implements Parcelable {
|
||||
if (!TextUtils.isEmpty(unicode)) {
|
||||
return "\"" + unicode + "\"";
|
||||
} else {
|
||||
return mWifiSsid.getHexString();
|
||||
String hex = mWifiSsid.getHexString();
|
||||
return (hex != null) ? hex : WifiSsid.NONE;
|
||||
}
|
||||
}
|
||||
return WifiSsid.NONE;
|
||||
|
||||
@@ -205,7 +205,7 @@ public class WifiSsid implements Parcelable {
|
||||
for (int i = 0; i < octets.size(); i++) {
|
||||
out += String.format(Locale.US, "%02x", ssidbytes[i]);
|
||||
}
|
||||
return out;
|
||||
return (octets.size() > 0) ? out : null;
|
||||
}
|
||||
|
||||
/** Implement the Parcelable interface {@hide} */
|
||||
|
||||
Reference in New Issue
Block a user