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

Commit 7be469ad authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Fixed missing auto-fill save callbacks on TextView."

parents 5840f423 0257c8a5
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -5219,6 +5219,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        if (needEditableForNotification) {
            sendAfterTextChanged((Editable) text);
        } else {
            // Always notify AutoFillManager - it will return right away if auto-fill is disabled.
            notifyAutoFillManagerAfterTextChanged();
        }

        // SelectionModifierCursorController depends on textCanBeSelected, which depends on text
@@ -9111,15 +9114,19 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }

        // Always notify AutoFillManager - it will return right away if auto-fill is disabled.
        notifyAutoFillManagerAfterTextChanged();

        hideErrorIfUnchanged();
    }

    private void notifyAutoFillManagerAfterTextChanged() {
        final AutoFillManager afm = mContext.getSystemService(AutoFillManager.class);
        if (afm != null) {
            if (DEBUG_AUTOFILL) {
                Log.v(LOG_TAG, "sendAfterTextChanged(): notify AFM for text=" + text);
                Log.v(LOG_TAG, "sendAfterTextChanged(): notify AFM for text=" + mText);
            }
            afm.valueChanged(TextView.this);
        }

        hideErrorIfUnchanged();
    }

    void updateAfterEdit() {
+1 −1
Original line number Diff line number Diff line
@@ -726,7 +726,7 @@ final class AutoFillManagerServiceImpl {
                        Slog.d(TAG, "finishSessionLocked(): found a change on " + id + ": "
                                + state.mAutoFillValue);
                    }
                    mUi.showSaveUi();
                    getUiForShowing().showSaveUi();
                    return;
                }
            }
+5 −3
Original line number Diff line number Diff line
@@ -75,9 +75,11 @@ final class AutoFillUI {

    void setCallbackLocked(AutoFillUiCallback callback, IBinder activityToken) {
        mHandler.post(() -> {
            if (callback != mCallback && activityToken != mActivityToken) {
                hideAllUiThread();
                mCallback = callback;
                mActivityToken = activityToken;
            }
        });
    }