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

Commit 47824b93 authored by Justin Ghan's avatar Justin Ghan
Browse files

Prevent TextView refocus on escape key press

Bug: 329598550
Bug: 312921137
Test: atest android.widget.cts.TextViewTest
Change-Id: Ied159ac0b514a9815e7ac1e5d3328bbfa243e547
parent 54552737
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8474,8 +8474,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);