From e2d48ca6e7e4229441726eaeecbb9889ab2d973d Mon Sep 17 00:00:00 2001 From: Minming Qi Date: Fri, 10 Mar 2017 13:56:44 +0800 Subject: [PATCH] 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 --- packages/SystemUI/res/values/config.xml | 3 +++ .../systemui/statusbar/policy/WifiSignalController.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index eb1a1ebc08508..45a7a8b6e8039 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -126,6 +126,9 @@ true + + false + false diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java index b890a3006e569..1bef0c27901fb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java @@ -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());