From ccda9966112b759a8bbc01f31046fe42be96b531 Mon Sep 17 00:00:00 2001 From: Jeff Davidson Date: Mon, 26 Jan 2015 18:23:24 -0800 Subject: [PATCH] Use consistent logic for data icon overlays. Ensure that we always show the data icon in both Quick Settings and the status bar, or in neither, but never one or the other. The particular inconsistency this is intended to fix is that in some circumstances, Wi-Fi may be connected, but the cell radio may be still be used by certain apps, due to new multinetworking APIs in L. In this case, we should always show the data icon; currently appears in the status bar, but not Quick Settings, which was unconditionally dropping the icon if any Wi-Fi connection was up. Bug: 19112322 Change-Id: I9942f6b24081e061a72804ef47ad4fe719f32ec2 --- .../src/com/android/systemui/qs/tiles/CellularTile.java | 4 +--- .../systemui/statusbar/policy/NetworkControllerImpl.java | 9 +++++---- 2 files changed, 6 insertions(+), 7 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 ddb96a2a1739e..30f92b97346a0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -97,9 +97,7 @@ public class CellularTile extends QSTile { state.icon = ResourceIcon.get(iconId); state.isOverlayIconWide = cb.isDataTypeIconWide; state.autoMirrorDrawable = !cb.noSim; - state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiConnected - ? cb.dataTypeIconId - : 0; + state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) ? cb.dataTypeIconId : 0; state.filter = iconId != R.drawable.ic_qs_no_sim; state.activityIn = cb.enabled && cb.activityIn; state.activityOut = cb.enabled && cb.activityOut; 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 6d38d38816a00..9a7f21ea130b6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -1187,10 +1187,13 @@ public class NetworkControllerImpl extends BroadcastReceiver String contentDescription = getStringIfExists(getContentDescription()); String dataContentDescription = getStringIfExists(icons.mDataContentDescription); + + boolean showDataIcon = mCurrentState.dataConnected && mCurrentState.inetForNetwork != 0 + || mCurrentState.iconGroup == TelephonyIcons.ROAMING; + // Only send data sim callbacks to QS. if (mCurrentState.dataSim) { - int qsTypeIcon = mCurrentState.dataConnected ? - icons.mQsDataType[mCurrentState.inetForNetwork] : 0; + int qsTypeIcon = showDataIcon ? icons.mQsDataType[mCurrentState.inetForNetwork] : 0; int length = mSignalsChangedCallbacks.size(); for (int i = 0; i < length; i++) { mSignalsChangedCallbacks.get(i).onMobileDataSignalChanged(mCurrentState.enabled @@ -1205,8 +1208,6 @@ public class NetworkControllerImpl extends BroadcastReceiver icons.mIsWide && qsTypeIcon != 0); } } - boolean showDataIcon = mCurrentState.dataConnected && mCurrentState.inetForNetwork != 0 - || mCurrentState.iconGroup == TelephonyIcons.ROAMING; int typeIcon = showDataIcon ? icons.mDataType : 0; int signalClustersLength = mSignalClusters.size(); for (int i = 0; i < signalClustersLength; i++) {