OSDN Git Service

Don't show wifi in status bar in QS DO NOT MERGE
authorJason Monk <jmonk@google.com>
Wed, 10 May 2017 14:57:27 +0000 (10:57 -0400)
committerJason Monk <jmonk@google.com>
Wed, 10 May 2017 17:30:17 +0000 (17:30 +0000)
This is a partial revert of the revert of
d1ba5fbb54a02fad0c68f71183078527bfa9bd49

Test: manual
Change-Id: If5675620026c9e90855525a20a8fd92987acbf80
Fixes: 16544554

packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java

index 7518527..e457d72 100644 (file)
@@ -77,6 +77,9 @@ public class QuickStatusBarHeader extends RelativeLayout {
 
         BatteryMeterView battery = findViewById(R.id.battery);
         battery.setForceShowPercent(true);
+        // Don't show the Wi-Fi indicator here, because it is shown just below in the tile.
+        SignalClusterView signalCluster = findViewById(R.id.signal_cluster);
+        signalCluster.setForceBlockWifi();
 
         mActivityStarter = Dependency.get(ActivityStarter.class);
     }
index dc254f9..28a858c 100644 (file)
@@ -120,6 +120,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
     private boolean mBlockWifi;
     private boolean mBlockEthernet;
     private boolean mActivityEnabled;
+    private boolean mForceBlockWifi;
 
     public SignalClusterView(Context context) {
         this(context, null);
@@ -151,6 +152,16 @@ public class SignalClusterView extends LinearLayout implements NetworkController
         updateActivityEnabled();
     }
 
+    public void setForceBlockWifi() {
+        mForceBlockWifi = true;
+        mBlockWifi = true;
+        if (isAttachedToWindow()) {
+            // Re-register to get new callbacks.
+            mNetworkController.removeCallback(this);
+            mNetworkController.addCallback(this);
+        }
+    }
+
     @Override
     public void onTuningChanged(String key, String newValue) {
         if (!StatusBarIconController.ICON_BLACKLIST.equals(key)) {
@@ -167,7 +178,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
             mBlockAirplane = blockAirplane;
             mBlockMobile = blockMobile;
             mBlockEthernet = blockEthernet;
-            mBlockWifi = blockWifi;
+            mBlockWifi = blockWifi || mForceBlockWifi;
             // Re-register to get new callbacks.
             mNetworkController.removeCallback(this);
             mNetworkController.addCallback(this);