From d7c311fa9ba4327584e9edcd1a2b7714495579e9 Mon Sep 17 00:00:00 2001 From: yinxu Date: Wed, 17 Feb 2021 18:12:33 -0800 Subject: [PATCH] Fix the A11y issues in the InternetTile 1. The WiFi enable state should always be updated even when qsIcon=null 2. The secondary label should be added into the description no matter the WiFi is enabled or not as long as the secondary label is not empty. Bug: 179499535 Test: Manual Tests Change-Id: If9a2e622299e3073649fc44cc9b752f19432c800 --- .../android/systemui/qs/tiles/InternetTile.java | 17 +++++++---------- .../statusbar/phone/StatusBarSignalPolicy.java | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) 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 0abff77c4e39d..946d041bdd938 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java @@ -248,15 +248,13 @@ public class InternetTile extends QSTileImpl { + "isTransient = " + isTransient + "," + "statusLabel = " + statusLabel); } - // When airplane mode is enabled, we need to refresh the Internet Tile even if the WiFi - // is not the default network. + mWifiInfo.mEnabled = enabled; if (qsIcon == null) { return; } mWifiInfo.mConnected = qsIcon.visible; mWifiInfo.mWifiSignalIconId = qsIcon.icon; mWifiInfo.mWifiSignalContentDescription = qsIcon.contentDescription; - mWifiInfo.mEnabled = enabled; mWifiInfo.mSsid = description; mWifiInfo.mActivityIn = activityIn; mWifiInfo.mActivityOut = activityOut; @@ -465,14 +463,13 @@ public class InternetTile extends QSTileImpl { } minimalContentDescription.append( mContext.getString(R.string.quick_settings_internet_label)).append(","); - if (state.value) { - if (wifiConnected) { - minimalStateDescription.append(cb.mWifiSignalContentDescription); - minimalContentDescription.append(removeDoubleQuotes(cb.mSsid)); - } else if (!TextUtils.isEmpty(state.secondaryLabel)) { - minimalContentDescription.append(",").append(state.secondaryLabel); - } + if (state.value && wifiConnected) { + minimalStateDescription.append(cb.mWifiSignalContentDescription); + minimalContentDescription.append(removeDoubleQuotes(cb.mSsid)); + } else if (!TextUtils.isEmpty(state.secondaryLabel)) { + minimalContentDescription.append(",").append(state.secondaryLabel); } + state.stateDescription = minimalStateDescription.toString(); state.contentDescription = minimalContentDescription.toString(); state.dualLabelContentDescription = r.getString( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java index 7bc1bb39642b0..dacd9417b22ab 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java @@ -40,7 +40,7 @@ import java.util.Objects; public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallback, SecurityController.SecurityControllerCallback, Tunable { private static final String TAG = "StatusBarSignalPolicy"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.INFO); + private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private final String mSlotAirplane; private final String mSlotMobile;