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

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

Merge "Moved logContextCommitted() logic to the handler..."

parents 0a1421d9 c0f8195b
Loading
Loading
Loading
Loading
+35 −37
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ final class AutofillManagerServiceImpl {
            return;
        }

        session.logContextCommittedLocked();
        session.logContextCommitted();

        final boolean finished = session.showSaveLocked();
        if (sVerbose) Slog.v(TAG, "finishSessionLocked(): session finished on save? " + finished);
@@ -713,7 +713,7 @@ final class AutofillManagerServiceImpl {
    /**
     * Updates the last fill response when an autofill context is committed.
     */
    void logContextCommitted(int sessionId, @Nullable Bundle clientState,
    void logContextCommittedLocked(int sessionId, @Nullable Bundle clientState,
            @Nullable ArrayList<String> selectedDatasets,
            @Nullable ArraySet<String> ignoredDatasets,
            @Nullable ArrayList<AutofillId> changedFieldIds,
@@ -723,7 +723,6 @@ final class AutofillManagerServiceImpl {
            @Nullable ArrayList<AutofillId> detectedFieldIdsList,
            @Nullable ArrayList<FieldClassification> detectedFieldClassificationsList,
            @NonNull String appPackageName) {
        synchronized (mLock) {
        if (isValidEventLocked("logDatasetNotSelected()", sessionId)) {
            AutofillId[] detectedFieldsIds = null;
            FieldClassification[] detectedFieldClassifications = null;
@@ -762,7 +761,6 @@ final class AutofillManagerServiceImpl {
                    detectedFieldsIds, detectedFieldClassifications));
        }
    }
    }

    /**
     * Gets the fill event history.
+14 −3
Original line number Diff line number Diff line
@@ -906,7 +906,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
     * Generates a {@link android.service.autofill.FillEventHistory.Event#TYPE_CONTEXT_COMMITTED}
     * when necessary.
     */
    public void logContextCommittedLocked() {
    public void logContextCommitted() {
        mHandlerCaller.getHandler().post(() -> {
            synchronized (mLock) {
                logContextCommittedLocked();
            }
        });
    }

    private void logContextCommittedLocked() {
        final FillResponse lastResponse = getLastResponseLocked("logContextCommited()");
        if (lastResponse == null) return;

@@ -1115,7 +1123,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            }
        }

        mService.logContextCommitted(id, mClientState, mSelectedDatasetIds, ignoredDatasets,
        mService.logContextCommittedLocked(id, mClientState, mSelectedDatasetIds, ignoredDatasets,
                changedFieldIds, changedDatasetIds,
                manuallyFilledFieldIds, manuallyFilledDatasetIds,
                detectedFieldIds, detectedFieldClassifications, mComponentName.getPackageName());
@@ -1359,7 +1367,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                }

                if (sDebug) Slog.d(TAG, "Good news, everyone! All checks passed, show save UI!");
                mService.logSaveShown(id, mClientState);

                // Use handler so logContextCommitted() is logged first
                mHandlerCaller.getHandler().post(() -> mService.logSaveShown(id, mClientState));

                final IAutoFillManagerClient client = getClient();
                mPendingSaveUi = new PendingUi(mActivityToken, id, client);
                getUiForShowing().showSaveUi(mService.getServiceLabel(), mService.getServiceIcon(),