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

Commit be541db7 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Properly set input type on autofill compat mode." into pi-dev

am: 352da45b

Change-Id: I7b97497e1d4dfb755e4f49182e27251356d9c372
parents 2fa69cae 352da45b
Loading
Loading
Loading
Loading
+17 −14
Original line number Original line Diff line number Diff line
@@ -8536,24 +8536,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
            }
            structure.setHint(info.getHintText());
            structure.setHint(info.getHintText());
        }
        }
        if ((info.getText() != null || info.getError() != null)) {
        CharSequence text = info.getText();
            structure.setText(info.getText(), info.getTextSelectionStart(),
        boolean hasText = text != null || info.getError() != null;
                    info.getTextSelectionEnd());
        if (hasText) {
            structure.setText(text, info.getTextSelectionStart(), info.getTextSelectionEnd());
        }
        if (forAutofill) {
        if (forAutofill) {
            if (info.isEditable()) {
            if (info.isEditable()) {
                structure.setDataIsSensitive(true);
                structure.setDataIsSensitive(true);
                if (hasText) {
                    structure.setAutofillType(AUTOFILL_TYPE_TEXT);
                    structure.setAutofillType(AUTOFILL_TYPE_TEXT);
                    final AutofillValue autofillValue = AutofillValue.forText(structure.getText());
                    structure.setAutofillValue(AutofillValue.forText(text));
                    structure.setAutofillValue(autofillValue);
                }
                    if (info.isPassword()) {
                int inputType = info.getInputType();
                        structure.setInputType(InputType.TYPE_CLASS_TEXT
                if (inputType == 0 && info.isPassword()) {
                                | InputType.TYPE_TEXT_VARIATION_PASSWORD);
                    inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
                }
                }
                structure.setInputType(inputType);
            } else {
            } else {
                structure.setDataIsSensitive(false);
                structure.setDataIsSensitive(false);
            }
            }
        }
        }
        }
        final int NCHILDREN = info.getChildCount();
        final int NCHILDREN = info.getChildCount();
        if (NCHILDREN > 0) {
        if (NCHILDREN > 0) {
            structure.setChildCount(NCHILDREN);
            structure.setChildCount(NCHILDREN);