QS: Cellular tile icon state tweaks.
Bug:16371677
Bug:15586604
Change-Id: Id66fc8fc0353221aa3ed4f6ebd09b499ccba6b98
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index d76a2fe..42da282 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -93,10 +93,10 @@
final Resources r = mContext.getResources();
state.iconId = cb.noSim
? R.drawable.stat_sys_no_sim
- : cb.enabled && (cb.mobileSignalIconId > 0)
+ : cb.enabled && (cb.mobileSignalIconId > 0) && !cb.airplaneModeEnabled
? cb.mobileSignalIconId
: R.drawable.ic_qs_signal_no_signal;
- state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiEnabled
+ state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiConnected
? cb.dataTypeIconId
: 0;
state.filter = state.iconId != R.drawable.stat_sys_no_sim;
@@ -132,6 +132,8 @@
private static final class CallbackInfo {
boolean enabled;
boolean wifiEnabled;
+ boolean wifiConnected;
+ boolean airplaneModeEnabled;
int mobileSignalIconId;
String signalContentDescription;
int dataTypeIconId;
@@ -144,12 +146,15 @@
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
private boolean mWifiEnabled;
+ private boolean mWifiConnected;
+ private boolean mAirplaneModeEnabled;
@Override
- public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description) {
mWifiEnabled = enabled;
+ mWifiConnected = connected;
}
@Override
@@ -161,6 +166,8 @@
final CallbackInfo info = new CallbackInfo(); // TODO pool?
info.enabled = enabled;
info.wifiEnabled = mWifiEnabled;
+ info.wifiConnected = mWifiConnected;
+ info.airplaneModeEnabled = mAirplaneModeEnabled;
info.mobileSignalIconId = mobileSignalIconId;
info.signalContentDescription = mobileSignalContentDescriptionId;
info.dataTypeIconId = dataTypeIconId;
@@ -174,7 +181,7 @@
@Override
public void onAirplaneModeChanged(boolean enabled) {
- // noop
+ mAirplaneModeEnabled = enabled;
}
public void onMobileDataEnabled(boolean enabled) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index 900c7b26..1707b32 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -143,6 +143,7 @@
private static final class CallbackInfo {
boolean enabled;
+ boolean connected;
int wifiSignalIconId;
String enabledDesc;
boolean activityIn;
@@ -153,6 +154,7 @@
public String toString() {
return new StringBuilder("CallbackInfo[")
.append("enabled=").append(enabled)
+ .append(",connected=").append(connected)
.append(",wifiSignalIconId=").append(wifiSignalIconId)
.append(",enabledDesc=").append(enabledDesc)
.append(",activityIn=").append(activityIn)
@@ -164,12 +166,13 @@
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
@Override
- public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description) {
if (DEBUG) Log.d(TAG, "onWifiSignalChanged enabled=" + enabled);
final CallbackInfo info = new CallbackInfo();
info.enabled = enabled;
+ info.connected = connected;
info.wifiSignalIconId = wifiSignalIconId;
info.enabledDesc = description;
info.activityIn = activityIn;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 6d8b400..b64dcbe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -24,7 +24,7 @@
void setWifiEnabled(boolean enabled);
public interface NetworkSignalChangedCallback {
- void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description);
void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 70a82e4..4fc2e06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -401,7 +401,7 @@
boolean wifiOut = wifiEnabled && mWifiSsid != null
&& (mWifiActivity == WifiManager.DATA_ACTIVITY_INOUT
|| mWifiActivity == WifiManager.DATA_ACTIVITY_OUT);
- cb.onWifiSignalChanged(mWifiEnabled, mQSWifiIconId, wifiIn, wifiOut,
+ cb.onWifiSignalChanged(mWifiEnabled, mWifiConnected, mQSWifiIconId, wifiIn, wifiOut,
mContentDescriptionWifi, wifiDesc);
boolean mobileIn = mDataConnected && (mDataActivity == TelephonyManager.DATA_ACTIVITY_INOUT