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

Commit 1fa819b3 authored by Maxim Bogatov's avatar Maxim Bogatov
Browse files

Let TextView clear accessibility selection index

b/22101633

Change-Id: I861cb705d78b2ed1cf0fab0dab36df3fac7d8256
parent 9206d6a0
Loading
Loading
Loading
Loading
+21 −25
Original line number Diff line number Diff line
@@ -8830,12 +8830,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
                    | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
                    | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
            info.addAction(AccessibilityNodeInfo.ACTION_SET_SELECTION);
        }

        if (isFocused()) {
            if (canSelectText()) {
                info.addAction(AccessibilityNodeInfo.ACTION_SET_SELECTION);
            }
            if (canCopy()) {
                info.addAction(AccessibilityNodeInfo.ACTION_COPY);
            }
@@ -8919,7 +8917,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                }
            } return false;
            case AccessibilityNodeInfo.ACTION_SET_SELECTION: {
                if (isFocused() && canSelectText()) {
                ensureIterableTextForAccessibilitySelectable();
                CharSequence text = getIterableTextForAccessibility();
                if (text == null) {
@@ -8944,7 +8941,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        return true;
                    }
                }
                }
            } return false;
            case AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY:
            case AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY: {