SystemUI: Customize wifi indicator for China carriers

Use config_showWifiIndicatorWhenEnabled to control whether to show
indicator for Wifi on but not connected.

Change-Id: Ic613952d82e0e1fefd88ce421b7ae21cf6c32793
This commit is contained in:
Minming Qi
2017-03-10 13:56:44 +08:00
parent 6d198966fe
commit e2d48ca6e7
2 changed files with 6 additions and 1 deletions

View File

@@ -126,6 +126,9 @@
<!-- Should "4G" be shown instead of "LTE" when the network is NETWORK_TYPE_LTE? -->
<bool name="config_show4GForLTE">true</bool>
<!-- Show indicator for Wifi on but not connected. -->
<bool name="config_showWifiIndicatorWhenEnabled">false</bool>
<!-- Should "LTE"/"4G" be shown instead of "LTE+"/"4G+" when on NETWORK_TYPE_LTE_CA? -->
<bool name="config_hideLtePlus">false</bool>

View File

@@ -77,8 +77,10 @@ public class WifiSignalController extends
@Override
public void notifyListeners(SignalCallback callback) {
// only show wifi in the cluster if connected or if wifi-only
boolean visibleWhenEnabled = mContext.getResources().getBoolean(
R.bool.config_showWifiIndicatorWhenEnabled);
boolean wifiVisible = mCurrentState.enabled
&& (mCurrentState.connected || !mHasMobileData);
&& (mCurrentState.connected || !mHasMobileData || visibleWhenEnabled);
String wifiDesc = wifiVisible ? mCurrentState.ssid : null;
boolean ssidPresent = wifiVisible && mCurrentState.ssid != null;
String contentDescription = getStringIfExists(getContentDescription());