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

Commit 1c1626ec authored by Felipe Leme's avatar Felipe Leme
Browse files

Don't show AUTOFILL menu when text is selected.

Fixes: 62271937
Test: manual verification
Test: existing CtsAutoFillServiceTestCases tests pass

Change-Id: I80902cb38633e41f50044f413b1b86904a60261e
parent 6d46bc2e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -3842,11 +3842,12 @@ public class Editor {
            }

            if (mTextView.canRequestAutofill()) {
                final int mode = mTextView.getText().length() <= 0
                        ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
                final String selected = mTextView.getSelectedText();
                if (selected == null || selected.isEmpty()) {
                    menu.add(Menu.NONE, TextView.ID_AUTOFILL, MENU_ITEM_ORDER_AUTOFILL,
                            com.android.internal.R.string.autofill)
                        .setShowAsAction(mode);
                            .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
                }
            }

            if (mTextView.canPasteAsPlainText()) {