diff options
author | Jason Monk <jmonk@google.com> | 2014-11-12 16:50:31 -0500 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2014-12-02 10:35:09 -0500 |
commit | b574627ebc383d35cf8212ee241b191b26518a0d (patch) | |
tree | 13b5a036ab3660bd48f28899aae904dbda66b572 /packages/SystemUI/src/com/android/systemui/qs | |
parent | fbeeac8266c190afba084cfc1164385ff5020fce (diff) | |
download | frameworks_base-b574627ebc383d35cf8212ee241b191b26518a0d.zip frameworks_base-b574627ebc383d35cf8212ee241b191b26518a0d.tar.gz frameworks_base-b574627ebc383d35cf8212ee241b191b26518a0d.tar.bz2 |
SysUI: Actual MSIM status bar support
Expand SignalClusterView and NetworkController to handle multiple
SIMs. It does this by creating multiple MobileSignalControllers
for each of the active subscriptions on the device.
Also some minor changes for followup on the NetworkController
refactor that went in before this.
Bug: 18222975
Change-Id: Ic7a857cfc5cadb46d51bb9ded0df8187eea799f7
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/qs')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java | 53 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java | 6 |
2 files changed, 35 insertions, 24 deletions
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 80ddd4a..f2ebcf6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -147,16 +147,15 @@ public class CellularTile extends QSTile<QSTile.SignalState> { } private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() { - private boolean mWifiEnabled; - private boolean mWifiConnected; - private boolean mAirplaneModeEnabled; + private final CallbackInfo mInfo = new CallbackInfo(); @Override public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId, boolean activityIn, boolean activityOut, String wifiSignalContentDescriptionId, String description) { - mWifiEnabled = enabled; - mWifiConnected = connected; + mInfo.wifiEnabled = enabled; + mInfo.wifiConnected = connected; + refreshState(mInfo); } @Override @@ -164,28 +163,35 @@ public class CellularTile extends QSTile<QSTile.SignalState> { int mobileSignalIconId, String mobileSignalContentDescriptionId, int dataTypeIconId, boolean activityIn, boolean activityOut, - String dataTypeContentDescriptionId, String description, boolean noSim, + String dataTypeContentDescriptionId, String description, boolean isDataTypeIconWide) { - 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; - info.dataContentDescription = dataTypeContentDescriptionId; - info.activityIn = activityIn; - info.activityOut = activityOut; - info.enabledDesc = description; - info.noSim = noSim; - info.isDataTypeIconWide = isDataTypeIconWide; - refreshState(info); + mInfo.enabled = enabled; + mInfo.mobileSignalIconId = mobileSignalIconId; + mInfo.signalContentDescription = mobileSignalContentDescriptionId; + mInfo.dataTypeIconId = dataTypeIconId; + mInfo.dataContentDescription = dataTypeContentDescriptionId; + mInfo.activityIn = activityIn; + mInfo.activityOut = activityOut; + mInfo.enabledDesc = description; + mInfo.isDataTypeIconWide = isDataTypeIconWide; + refreshState(mInfo); + } + + @Override + public void onNoSimVisibleChanged(boolean visible) { + mInfo.noSim = visible; + if (mInfo.noSim) { + // Make sure signal gets cleared out when no sims. + mInfo.mobileSignalIconId = 0; + mInfo.dataTypeIconId = 0; + } + refreshState(mInfo); } @Override public void onAirplaneModeChanged(boolean enabled) { - mAirplaneModeEnabled = enabled; + mInfo.airplaneModeEnabled = enabled; + refreshState(mInfo); } public void onMobileDataEnabled(boolean enabled) { @@ -203,7 +209,8 @@ public class CellularTile extends QSTile<QSTile.SignalState> { @Override public Boolean getToggleState() { return mDataController.isMobileDataSupported() - ? mDataController.isMobileDataEnabled() : null; + ? mDataController.isMobileDataEnabled() + : null; } @Override 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 4fb1189..5e30622 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -217,11 +217,15 @@ public class WifiTile extends QSTile<QSTile.SignalState> { int mobileSignalIconId, String mobileSignalContentDescriptionId, int dataTypeIconId, boolean activityIn, boolean activityOut, - String dataTypeContentDescriptionId, String description, boolean noSim, + String dataTypeContentDescriptionId, String description, boolean isDataTypeIconWide) { // noop } + public void onNoSimVisibleChanged(boolean noSims) { + // noop + } + @Override public void onAirplaneModeChanged(boolean enabled) { // noop |