Don't show the Wi-Fi icon when Wi-Fi is off

- Show an empty icon when the Wi-Fi level is unreachable

Bug: 339343274
Flag: EXEMPT bugfix
Test: Manual testing
atest -c SettingsRoboTests

Change-Id: I55f3be145150235b19484e256c35e37f885a1dcf
This commit is contained in:
Weng Su
2024-06-13 20:33:29 +08:00
parent 7b46a822ee
commit 3b161c23b3

View File

@@ -555,6 +555,9 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
int deviceType = ((HotspotNetworkEntry) wifiEntry).getDeviceType(); int deviceType = ((HotspotNetworkEntry) wifiEntry).getDeviceType();
return mContext.getDrawable(getHotspotIconResource(deviceType)); return mContext.getDrawable(getHotspotIconResource(deviceType));
} }
if (mWifiEntry.getLevel() == WifiEntry.WIFI_LEVEL_UNREACHABLE) {
return mContext.getDrawable(R.drawable.empty_icon);
}
return mIconInjector.getIcon(wifiEntry.shouldShowXLevelIcon(), wifiEntry.getLevel()); return mIconInjector.getIcon(wifiEntry.shouldShowXLevelIcon(), wifiEntry.getLevel());
} }