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

Commit 4f7df47e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Require onCheckIsTextEditor() for IME_FLAG_NAVIGATE_{NEXT,PREVIOUS}"

parents 88c8c7bb 4bd98255
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -8751,6 +8751,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        return mEditor != null && mEditor.mInputType != EditorInfo.TYPE_NULL;
    }
    private boolean hasEditorInFocusSearchDirection(@FocusRealDirection int direction) {
        final View nextView = focusSearch(direction);
        return nextView != null && nextView.onCheckIsTextEditor();
    }
    @Override
    public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
        if (onCheckIsTextEditor() && isEnabled()) {
@@ -8767,10 +8772,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                outAttrs.imeOptions = EditorInfo.IME_NULL;
                outAttrs.hintLocales = null;
            }
            if (focusSearch(FOCUS_DOWN) != null) {
            if (hasEditorInFocusSearchDirection(FOCUS_DOWN)) {
                outAttrs.imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_NEXT;
            }
            if (focusSearch(FOCUS_UP) != null) {
            if (hasEditorInFocusSearchDirection(FOCUS_UP)) {
                outAttrs.imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
            }
            if ((outAttrs.imeOptions & EditorInfo.IME_MASK_ACTION)