Merge "Fix Wi-Fi SSID null handling" am: cadd76044e am: e7ac82b9a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624059 Change-Id: I9dacf92104c544f9ed12dc6fa60e4895ab228cbd
This commit is contained in:
@@ -198,15 +198,11 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> {
|
|||||||
final int oemManaged = getOemBitfield(snapshot.networkCapabilities);
|
final int oemManaged = getOemBitfield(snapshot.networkCapabilities);
|
||||||
|
|
||||||
if (legacyType == TYPE_WIFI) {
|
if (legacyType == TYPE_WIFI) {
|
||||||
if (snapshot.networkCapabilities.getSsid() != null) {
|
networkId = snapshot.networkCapabilities.getSsid();
|
||||||
networkId = snapshot.networkCapabilities.getSsid();
|
if (networkId == null) {
|
||||||
if (networkId == null) {
|
final WifiManager wifi = context.getSystemService(WifiManager.class);
|
||||||
// TODO: Figure out if this code path never runs. If so, remove them.
|
final WifiInfo info = wifi.getConnectionInfo();
|
||||||
final WifiManager wifi = (WifiManager) context.getSystemService(
|
networkId = info != null ? info.getSSID() : null;
|
||||||
Context.WIFI_SERVICE);
|
|
||||||
final WifiInfo info = wifi.getConnectionInfo();
|
|
||||||
networkId = info != null ? info.getSSID() : null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user