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

Commit ed54866b authored by Yuichiro Hanada's avatar Yuichiro Hanada
Browse files

Fix TextView.shouldAdvanceFocusOnTab().

EditorInfo.TYPE_TEXT_FLAG_{IME_,}MULTI_LINE are outside of
EditorInfo.TYPE_MASK_VARIATION.
It causes shouldAdvanceFocusOnTab return true always.

Bug: 37066224
Test: manual - Tab key on multiline text input inserts a tab character.
Test: atest TextViewTest#testKeyNavigation
Change-Id: I913cda40206d1c39e6844ff1be38e069488df4f4
parent 8a48bc0b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8282,9 +8282,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        if (getKeyListener() != null && !mSingleLine && mEditor != null
                && (mEditor.mInputType & EditorInfo.TYPE_MASK_CLASS)
                        == EditorInfo.TYPE_CLASS_TEXT) {
            int variation = mEditor.mInputType & EditorInfo.TYPE_MASK_VARIATION;
            if (variation == EditorInfo.TYPE_TEXT_FLAG_IME_MULTI_LINE
                    || variation == EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) {
            int multilineFlags = EditorInfo.TYPE_TEXT_FLAG_IME_MULTI_LINE
                    | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
            if ((mEditor.mInputType & multilineFlags) != 0) {
                return false;
            }
        }