Skip to content

Commit

Permalink
When wifi ssid is empty, return WifiSsid.NONE
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zhangshuxiao authored and temasek committed Mar 31, 2016
1 parent ac2e6a7 commit 3d923ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wifi/java/android/net/wifi/WifiInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ public String getSSID() {
if (!TextUtils.isEmpty(unicode)) {
return "\"" + unicode + "\"";
} else {
return mWifiSsid.getHexString();
String hex = mWifiSsid.getHexString();
return (hex != null) ? hex : WifiSsid.NONE;
}
}
return WifiSsid.NONE;
Expand Down
2 changes: 1 addition & 1 deletion wifi/java/android/net/wifi/WifiSsid.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public String getHexString() {
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} */
Expand Down

0 comments on commit 3d923ad

Please sign in to comment.