Fix Talkback annoucement for Media Output panel.

The sound panel and media panel are using the same window, so when it
transit from the sound panel to media panel, no window-change event will
be sent. Therefore, Talkback won't be able to re-focus the panel header
which lead to the lack of the announcement.

Fix this by adding setAccessibilityPanelTitle() to trigger Talkback.

Fixes: 140459762
Test: rebuild and test talkback on the media output panel.
Change-Id: I1442434315374dbbfe1d47ca8638180577c93168
This commit is contained in:
Yi-Ling Chuang
2020-05-21 18:43:29 +08:00
parent 1e0789355e
commit 350affcdfa

View File

@@ -200,15 +200,17 @@ public class PanelFragment extends Fragment {
loadAllSlices();
final IconCompat icon = mPanel.getIcon();
final CharSequence title = mPanel.getTitle();
if (icon == null) {
mTitleView.setVisibility(View.VISIBLE);
mPanelHeader.setVisibility(View.GONE);
mTitleView.setText(mPanel.getTitle());
mTitleView.setText(title);
} else {
mTitleView.setVisibility(View.GONE);
mPanelHeader.setVisibility(View.VISIBLE);
mPanelHeader.setAccessibilityPaneTitle(title);
mTitleIcon.setImageIcon(icon.toIcon(getContext()));
mHeaderTitle.setText(mPanel.getTitle());
mHeaderTitle.setText(title);
mHeaderSubtitle.setText(mPanel.getSubTitle());
if (mPanel.getHeaderIconIntent() != null) {
mTitleIcon.setOnClickListener(getHeaderIconListener());