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
diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java
index 9de4139..69d9e64c 100644
--- a/src/com/android/settings/panel/PanelFragment.java
+++ b/src/com/android/settings/panel/PanelFragment.java
@@ -200,15 +200,17 @@
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());