Merge "Fix the A11y issues in the InternetTile" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-02-20 18:38:47 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 11 deletions

View File

@@ -248,15 +248,13 @@ public class InternetTile extends QSTileImpl<SignalState> {
+ "isTransient = " + isTransient + "," + "isTransient = " + isTransient + ","
+ "statusLabel = " + statusLabel); + "statusLabel = " + statusLabel);
} }
// When airplane mode is enabled, we need to refresh the Internet Tile even if the WiFi mWifiInfo.mEnabled = enabled;
// is not the default network.
if (qsIcon == null) { if (qsIcon == null) {
return; return;
} }
mWifiInfo.mConnected = qsIcon.visible; mWifiInfo.mConnected = qsIcon.visible;
mWifiInfo.mWifiSignalIconId = qsIcon.icon; mWifiInfo.mWifiSignalIconId = qsIcon.icon;
mWifiInfo.mWifiSignalContentDescription = qsIcon.contentDescription; mWifiInfo.mWifiSignalContentDescription = qsIcon.contentDescription;
mWifiInfo.mEnabled = enabled;
mWifiInfo.mSsid = description; mWifiInfo.mSsid = description;
mWifiInfo.mActivityIn = activityIn; mWifiInfo.mActivityIn = activityIn;
mWifiInfo.mActivityOut = activityOut; mWifiInfo.mActivityOut = activityOut;
@@ -465,14 +463,13 @@ public class InternetTile extends QSTileImpl<SignalState> {
} }
minimalContentDescription.append( minimalContentDescription.append(
mContext.getString(R.string.quick_settings_internet_label)).append(","); mContext.getString(R.string.quick_settings_internet_label)).append(",");
if (state.value) { if (state.value && wifiConnected) {
if (wifiConnected) { minimalStateDescription.append(cb.mWifiSignalContentDescription);
minimalStateDescription.append(cb.mWifiSignalContentDescription); minimalContentDescription.append(removeDoubleQuotes(cb.mSsid));
minimalContentDescription.append(removeDoubleQuotes(cb.mSsid)); } else if (!TextUtils.isEmpty(state.secondaryLabel)) {
} else if (!TextUtils.isEmpty(state.secondaryLabel)) { minimalContentDescription.append(",").append(state.secondaryLabel);
minimalContentDescription.append(",").append(state.secondaryLabel);
}
} }
state.stateDescription = minimalStateDescription.toString(); state.stateDescription = minimalStateDescription.toString();
state.contentDescription = minimalContentDescription.toString(); state.contentDescription = minimalContentDescription.toString();
state.dualLabelContentDescription = r.getString( state.dualLabelContentDescription = r.getString(

View File

@@ -40,7 +40,7 @@ import java.util.Objects;
public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallback, public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallback,
SecurityController.SecurityControllerCallback, Tunable { SecurityController.SecurityControllerCallback, Tunable {
private static final String TAG = "StatusBarSignalPolicy"; 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 mSlotAirplane;
private final String mSlotMobile; private final String mSlotMobile;