Merge "When wifi ssid is empty, return WifiSsid.NONE"

am: 4af5c34

* commit '4af5c34a78ab65c22fa931bd9167f18b9211fd99':
  When wifi ssid is empty, return WifiSsid.NONE

Change-Id: I800fb4daf9773fff697e6cb3ac0c6734085248d8
This commit is contained in:
zhangshuxiao
2016-03-29 22:47:04 +00:00
committed by android-build-merger
2 changed files with 3 additions and 2 deletions

View File

@@ -320,7 +320,8 @@ public class WifiInfo implements Parcelable {
if (!TextUtils.isEmpty(unicode)) { if (!TextUtils.isEmpty(unicode)) {
return "\"" + unicode + "\""; return "\"" + unicode + "\"";
} else { } else {
return mWifiSsid.getHexString(); String hex = mWifiSsid.getHexString();
return (hex != null) ? hex : WifiSsid.NONE;
} }
} }
return WifiSsid.NONE; return WifiSsid.NONE;

View File

@@ -205,7 +205,7 @@ public class WifiSsid implements Parcelable {
for (int i = 0; i < octets.size(); i++) { for (int i = 0; i < octets.size(); i++) {
out += String.format(Locale.US, "%02x", ssidbytes[i]); out += String.format(Locale.US, "%02x", ssidbytes[i]);
} }
return out; return (octets.size() > 0) ? out : null;
} }
/** Implement the Parcelable interface {@hide} */ /** Implement the Parcelable interface {@hide} */