Merge "Don't show wifi in status bar in QS DO NOT MERGE" into oc-dev
This commit is contained in:
@@ -77,6 +77,9 @@ public class QuickStatusBarHeader extends RelativeLayout {
|
|||||||
|
|
||||||
BatteryMeterView battery = findViewById(R.id.battery);
|
BatteryMeterView battery = findViewById(R.id.battery);
|
||||||
battery.setForceShowPercent(true);
|
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);
|
mActivityStarter = Dependency.get(ActivityStarter.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
|
|||||||
private boolean mBlockWifi;
|
private boolean mBlockWifi;
|
||||||
private boolean mBlockEthernet;
|
private boolean mBlockEthernet;
|
||||||
private boolean mActivityEnabled;
|
private boolean mActivityEnabled;
|
||||||
|
private boolean mForceBlockWifi;
|
||||||
|
|
||||||
public SignalClusterView(Context context) {
|
public SignalClusterView(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
@@ -151,6 +152,16 @@ public class SignalClusterView extends LinearLayout implements NetworkController
|
|||||||
updateActivityEnabled();
|
updateActivityEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setForceBlockWifi() {
|
||||||
|
mForceBlockWifi = true;
|
||||||
|
mBlockWifi = true;
|
||||||
|
if (isAttachedToWindow()) {
|
||||||
|
// Re-register to get new callbacks.
|
||||||
|
mNetworkController.removeCallback(this);
|
||||||
|
mNetworkController.addCallback(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTuningChanged(String key, String newValue) {
|
public void onTuningChanged(String key, String newValue) {
|
||||||
if (!StatusBarIconController.ICON_BLACKLIST.equals(key)) {
|
if (!StatusBarIconController.ICON_BLACKLIST.equals(key)) {
|
||||||
@@ -167,7 +178,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
|
|||||||
mBlockAirplane = blockAirplane;
|
mBlockAirplane = blockAirplane;
|
||||||
mBlockMobile = blockMobile;
|
mBlockMobile = blockMobile;
|
||||||
mBlockEthernet = blockEthernet;
|
mBlockEthernet = blockEthernet;
|
||||||
mBlockWifi = blockWifi;
|
mBlockWifi = blockWifi || mForceBlockWifi;
|
||||||
// Re-register to get new callbacks.
|
// Re-register to get new callbacks.
|
||||||
mNetworkController.removeCallback(this);
|
mNetworkController.removeCallback(this);
|
||||||
mNetworkController.addCallback(this);
|
mNetworkController.addCallback(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user