From f1c3d0993c10510ef75ff700a2203b08b219f1bf Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Wed, 17 Mar 2021 11:08:51 -0400 Subject: [PATCH] Assume wifi is connected if the icon is says so We used only the SSID to determine if we are connected. It can be that the ssid is null but we are connected (the icon is not NO_NETWORK). In that case, assume we are connected and show the default label. Test: manual Bug: 182916016 Change-Id: I5952c47696da37453dc39c28effe5e38cae1820b --- .../src/com/android/systemui/qs/tiles/WifiTile.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java index dab68ed30c2b3..86ea50c646097 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -177,8 +177,10 @@ public class WifiTile extends QSTileImpl { } } boolean transientEnabling = arg == ARG_SHOW_TRANSIENT_ENABLING; - boolean wifiConnected = cb.enabled && (cb.wifiSignalIconId > 0) && (cb.ssid != null); - boolean wifiNotConnected = (cb.wifiSignalIconId > 0) && (cb.ssid == null); + boolean wifiConnected = cb.enabled && (cb.wifiSignalIconId > 0) + && (cb.ssid != null || cb.wifiSignalIconId != WifiIcons.QS_WIFI_NO_NETWORK); + boolean wifiNotConnected = (cb.ssid == null) + && (cb.wifiSignalIconId == WifiIcons.QS_WIFI_NO_NETWORK); boolean enabledChanging = state.value != cb.enabled; if (enabledChanging) { mDetailAdapter.setItemsVisible(cb.enabled); @@ -210,7 +212,7 @@ public class WifiTile extends QSTileImpl { state.label = r.getString(R.string.quick_settings_wifi_label); } else if (wifiConnected) { state.icon = ResourceIcon.get(cb.wifiSignalIconId); - state.label = removeDoubleQuotes(cb.ssid); + state.label = cb.ssid != null ? removeDoubleQuotes(cb.ssid) : getTileLabel(); } else if (wifiNotConnected) { state.icon = ResourceIcon.get(WifiIcons.QS_WIFI_NO_NETWORK); state.label = r.getString(R.string.quick_settings_wifi_label);