Set the talkback focus to the header text when Stage is NeedToConfirm

Should set the talkback focus to the header text when the "Draw your
pattern again" page is shown.

Bug: 275728120
Test: 1. enable talk back
      2. Setup pattern lock
      3. In "Draw your pattern again" page, make sure the talkback focus
	 is set to the header view
Change-Id: If99a950488039840e8486ebb634f0070a9403916
This commit is contained in:
Shawn Lin
2023-05-05 16:21:32 +08:00
parent 6a2f6960ab
commit 4fef3fac2c

View File

@@ -798,7 +798,12 @@ public class ChooseLockPattern extends SettingsActivity {
// If the stage changed, announce the header for accessibility. This // If the stage changed, announce the header for accessibility. This
// is a no-op when accessibility is disabled. // is a no-op when accessibility is disabled.
if (previousStage != stage || announceAlways) { if (previousStage != stage || announceAlways) {
mHeaderText.announceForAccessibility(mHeaderText.getText()); if (stage == Stage.NeedToConfirm) {
// If the Stage is NeedToConfirm, move the a11y focus to the header.
mHeaderText.requestAccessibilityFocus();
} else {
mHeaderText.announceForAccessibility(mHeaderText.getText());
}
} }
} }