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
This commit is contained in:
Yuichiro Hanada
2020-02-07 15:00:46 +09:00
parent 8a48bc0b1f
commit ed54866ba6

View File

@@ -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;
}
}