diff options
| author | 2022-04-12 11:23:19 +0000 | |
|---|---|---|
| committer | 2022-04-15 09:05:49 +0000 | |
| commit | 529a00790219362dfd89dbb17c4a44b40e976b98 (patch) | |
| tree | a0deff87b12f38c2c735fa102ccd3aabf00426e3 | |
| parent | e48d49582110a79401d6ecaae157534053a979e4 (diff) | |
DO NOT MERGE: Downbranch merge conflict [Output Switcher] Update property for A11y bugs
Bug: 221168724
Bug: 221178970
Bug: 221173456
Test: Verified on device
Change-Id: Ia8861101863b67af15a24b15014f820a59b0e4fb
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java | 12 |
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())); + } } } |