From dfdff144ae2336abd07cbadb8a8406132f820866 Mon Sep 17 00:00:00 2001 From: yinxu Date: Fri, 7 May 2021 11:37:44 -0700 Subject: [PATCH] Don't refresh the Tile if the airplane mode is not changed Bug: 187336225 Test: Manual tests Change-Id: I1e01387871b3c436952e1ec364b0e13fc6a37c3b --- .../systemui/qs/tiles/InternetTile.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java index 577c0d8455ebe..b7f2cd0da6425 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java @@ -319,10 +319,18 @@ public class InternetTile extends QSTileImpl { Log.d(TAG, "setIsAirplaneMode: " + "icon = " + (icon == null ? "" : icon.toString())); } + if (mCellularInfo.mAirplaneModeEnabled == icon.visible) { + return; + } mCellularInfo.mAirplaneModeEnabled = icon.visible; mWifiInfo.mAirplaneModeEnabled = icon.visible; if (!mSignalCallback.mEthernetInfo.mConnected) { - refreshState(mCellularInfo); + if (mWifiInfo.mEnabled && (mWifiInfo.mWifiSignalIconId > 0) + && (mWifiInfo.mSsid != null)) { + refreshState(mWifiInfo); + } else { + refreshState(mCellularInfo); + } } } @@ -456,6 +464,9 @@ public class InternetTile extends QSTileImpl { state.dualLabelContentDescription = r.getString( R.string.accessibility_quick_settings_open_settings, getTileLabel()); state.expandedAccessibilityClassName = Switch.class.getName(); + if (DEBUG) { + Log.d(TAG, "handleUpdateWifiState: " + "SignalState = " + state.toString()); + } } private void handleUpdateCellularState(SignalState state, Object arg) { @@ -496,6 +507,9 @@ public class InternetTile extends QSTileImpl { } else { state.stateDescription = state.secondaryLabel; } + if (DEBUG) { + Log.d(TAG, "handleUpdateCellularState: " + "SignalState = " + state.toString()); + } } private void handleUpdateEthernetState(SignalState state, Object arg) { @@ -508,6 +522,9 @@ public class InternetTile extends QSTileImpl { state.state = Tile.STATE_ACTIVE; state.icon = ResourceIcon.get(cb.mEthernetSignalIconId); state.secondaryLabel = cb.mEthernetContentDescription; + if (DEBUG) { + Log.d(TAG, "handleUpdateEthernetState: " + "SignalState = " + state.toString()); + } } private CharSequence appendMobileDataType(CharSequence current, CharSequence dataType) {