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

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

Merge "Autofill should clear the UI filter when a value is updated to null." into pi-dev

am: 298fabe6

Change-Id: If3707768e76f82ef562aaba7e5086d1c882e618c
parents 9c119c93 298fabe6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -79,9 +79,8 @@ public class AutofillPopupWindow extends PopupWindow {
    public AutofillPopupWindow(@NonNull IAutofillWindowPresenter presenter) {
        mWindowPresenter = new WindowPresenter(presenter);

        // Here is a bit of voodoo - we want to show the window as system
        // controlled one so it covers app windows, but at the same time it has to be
        // an application type (so it's contained inside the application area).
        // We want to show the window as system controlled one so it covers app windows, but it has
        // to be an application type (so it's contained inside the application area).
        // Hence, we set it to the application type with the highest z-order, which currently
        // is TYPE_APPLICATION_ABOVE_SUB_PANEL.
        setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL);
+15 −6
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

/**
@@ -1971,8 +1972,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    return;
                }

                if (value != null && !value.equals(viewState.getCurrentValue())) {
                    if (value.isEmpty()
                if (!Objects.equals(value, viewState.getCurrentValue())) {
                    if ((value == null || value.isEmpty())
                            && viewState.getCurrentValue() != null
                            && viewState.getCurrentValue().isText()
                            && viewState.getCurrentValue().getTextValue() != null
@@ -1993,18 +1994,26 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    // Must check if this update was caused by autofilling the view, in which
                    // case we just update the value, but not the UI.
                    final AutofillValue filledValue = viewState.getAutofilledValue();
                    if (value.equals(filledValue)) {
                    if (filledValue != null && filledValue.equals(value)) {
                        if (sVerbose) {
                            Slog.v(TAG, "ignoring autofilled change on id " + id);
                        }
                        return;
                    }
                    // Update the internal state...
                    viewState.setState(ViewState.STATE_CHANGED);

                    //..and the UI
                    if (value.isText()) {
                        getUiForShowing().filterFillUi(value.getTextValue().toString(), this);
                    final String filterText;
                    if (value == null || !value.isText()) {
                        filterText = null;
                    } else {
                        getUiForShowing().filterFillUi(null, this);
                        final CharSequence text = value.getTextValue();
                        // Text should never be null, but it doesn't hurt to check to avoid a
                        // system crash...
                        filterText = (text == null) ? null : text.toString();
                    }
                    getUiForShowing().filterFillUi(filterText, this);
                }
                break;
            case ACTION_VIEW_ENTERED: