Fix bug with TalkBack not reading out SplitInstructionsView
This CL sets an accessibility title so that TalkBack and other tools will properly read out the instructions on SplitInstructionsView.
Fixes: 323461342
Flag: ACONFIG com.android.wm.shell.enable_split_contextual TRUNKFOOD
Test: TalkBack announces the instructions immediately when the view appears, and is not interrupted.
Change-Id: I1666f0c374d40b31d732d3cca529f03a7f2f7f28
diff --git a/quickstep/res/layout/split_instructions_view.xml b/quickstep/res/layout/split_instructions_view.xml
index 0bbbfd5..1115ff2 100644
--- a/quickstep/res/layout/split_instructions_view.xml
+++ b/quickstep/res/layout/split_instructions_view.xml
@@ -24,8 +24,7 @@
android:paddingTop="@dimen/split_instructions_vertical_padding"
android:paddingBottom="@dimen/split_instructions_vertical_padding"
android:elevation="@dimen/split_instructions_elevation"
- android:visibility="gone"
- android:importantForAccessibility="yes">
+ android:visibility="gone">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/split_instructions_text"
android:layout_height="wrap_content"
diff --git a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
index a11a913..d100fea 100644
--- a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java
@@ -130,6 +130,9 @@
cancelTextView.setOnClickListener((v) -> exitSplitSelection());
instructionTextView.setText(R.string.toast_contextual_split_select_app);
}
+
+ // Set accessibility title, will be announced by a11y tools.
+ instructionTextView.setAccessibilityPaneTitle(instructionTextView.getText());
}
private void exitSplitSelection() {