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

Commit 0566a6b4 authored by Justin Ghan's avatar Justin Ghan Committed by Android Build Coastguard Worker
Browse files

Prevent TextView refocus on escape key press

Bug: 329598550
Bug: 312921137
Test: atest android.widget.cts.TextViewTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:47824b93f3f67b11dffceaa2d00712f2f7f25d6c)
Merged-In: Ied159ac0b514a9815e7ac1e5d3328bbfa243e547
Change-Id: Ied159ac0b514a9815e7ac1e5d3328bbfa243e547
parent 7900676d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8430,8 +8430,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *            hierarchy
     * @param refocus when propagate is true, specifies whether to request the
     *            root view place new focus
     * @hide
     */
    void clearFocusInternal(View focused, boolean propagate, boolean refocus) {
    public void clearFocusInternal(View focused, boolean propagate, boolean refocus) {
        if ((mPrivateFlags & PFLAG_FOCUSED) != 0) {
            mPrivateFlags &= ~PFLAG_FOCUSED;
            clearParentsWantFocus();
+1 −1
Original line number Diff line number Diff line
@@ -9733,7 +9733,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        return KEY_EVENT_HANDLED;
                    }
                    if (hasFocus()) {
                        clearFocus();
                        clearFocusInternal(null, /* propagate */ true, /* refocus */ false);
                        InputMethodManager imm = getInputMethodManager();
                        if (imm != null) {
                            imm.hideSoftInputFromView(this, 0);