summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shaowei Shen <shaoweishen@google.com> 2022-04-19 01:39:38 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-04-19 01:39:38 +0000
commit44b000a2257ddbb0e0041143e5e48ea8a4f7984b (patch)
tree0f359cce75e216781496871b40f0d80ac9532370
parent5b19566d7aa74fab44ca44737b41ba989bbb8b67 (diff)
parent529a00790219362dfd89dbb17c4a44b40e976b98 (diff)
Merge "DO NOT MERGE: Downbranch merge conflict [Output Switcher] Update property for A11y bugs" into tm-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
index 73ab66e8471b..ddcba3ae65ae 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
@@ -119,6 +119,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
mStatusIcon.setVisibility(View.GONE);
mEndTouchArea.setVisibility(View.GONE);
mContainerLayout.setOnClickListener(null);
+ mContainerLayout.setContentDescription(null);
mTitleText.setTextColor(mController.getColorItemContent());
mSubTitleText.setTextColor(mController.getColorItemContent());
mTwoLineTitleText.setTextColor(mController.getColorItemContent());
@@ -169,6 +170,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
setSingleLineLayout(getItemTitle(device), true /* bFocused */,
true /* showSeekBar */,
false /* showProgressBar */, false /* showStatus */);
+ setUpContentDescriptionForActiveDevice(device);
mCheckBox.setOnCheckedChangeListener(null);
mCheckBox.setVisibility(View.VISIBLE);
mCheckBox.setChecked(true);
@@ -188,6 +190,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
true /* showSeekBar */,
false /* showProgressBar */, true /* showStatus */);
initSeekbar(device);
+ setUpContentDescriptionForActiveDevice(device);
mCurrentActivePosition = position;
} else if (isDeviceIncluded(mController.getSelectableMediaDevice(), device)) {
mCheckBox.setOnCheckedChangeListener(null);
@@ -254,5 +257,14 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
notifyDataSetChanged();
}
}
+
+ private void setUpContentDescriptionForActiveDevice(MediaDevice device) {
+ mContainerLayout.setClickable(false);
+ mContainerLayout.setContentDescription(
+ mContext.getString(device.getDeviceType()
+ == MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE
+ ? R.string.accessibility_bluetooth_name
+ : R.string.accessibility_cast_name, device.getName()));
+ }
}
}