Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94378201 authored by Vincent Wang's avatar Vincent Wang
Browse files

TalkBack doesn't announce the status messages in the "Set a pattern" flow in SUW

Bug: 418933882
Flag: EXEMPT bug fixing
Test: Check if the message is announced correctly
Change-Id: I0cc49030e898f5a3cd083706c6d781b3807e1a80
parent a628aa81
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.widget.TextView;

import androidx.fragment.app.Fragment;
@@ -791,7 +792,6 @@ public class ChooseLockPattern extends SettingsActivity {
            // the rest of the stuff varies enough that it is easier just to handle
            // on a case by case basis.
            mLockPatternView.setDisplayMode(DisplayMode.Correct);
            boolean announceAlways = false;

            switch (mUiStage) {
                case Introduction:
@@ -804,7 +804,6 @@ public class ChooseLockPattern extends SettingsActivity {
                case ConfirmWrong:
                    mLockPatternView.setDisplayMode(DisplayMode.Wrong);
                    postClearPatternRunnable();
                    announceAlways = true;
                    break;
                case FirstChoiceValid:
                    break;
@@ -815,14 +814,8 @@ public class ChooseLockPattern extends SettingsActivity {
                    break;
            }

            // If the stage changed, announce the header for accessibility. This
            // is a no-op when accessibility is disabled.
            if (previousStage != stage || announceAlways) {
                if (stage == Stage.NeedToConfirm) {
                    // If the Stage is NeedToConfirm, move the a11y focus to the header.
                    mHeaderText.requestAccessibilityFocus();
                }
            }
            mHeaderText.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);

        }

        protected void updateFooterLeftButton(Stage stage) {