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

Commit 3304b47c authored by Tim Yu's avatar Tim Yu Committed by Android (Google) Code Review
Browse files

Merge "Autofill Fix FillResponse trigger reason" into main

parents 23e0e813 0b669968
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -53,8 +53,10 @@ import static android.view.autofill.AutofillManager.FLAG_SMART_SUGGESTION_SYSTEM
import static android.view.autofill.AutofillManager.getSmartSuggestionModeToString;
import static android.view.autofill.AutofillManager.getSmartSuggestionModeToString;


import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_EXPLICITLY_REQUESTED;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_NORMAL_TRIGGER;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_NORMAL_TRIGGER;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_PRE_TRIGGER;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_PRE_TRIGGER;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_RETRIGGER;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_SERVED_FROM_CACHED_RESPONSE;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_SERVED_FROM_CACHED_RESPONSE;
import static com.android.server.autofill.FillResponseEventLogger.AVAILABLE_COUNT_WHEN_FILL_REQUEST_FAILED_OR_TIMEOUT;
import static com.android.server.autofill.FillResponseEventLogger.AVAILABLE_COUNT_WHEN_FILL_REQUEST_FAILED_OR_TIMEOUT;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_AUTOFILL_PROVIDER;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_AUTOFILL_PROVIDER;
@@ -543,6 +545,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    synchronized (mLock) {
                    synchronized (mLock) {
                        int requestId = intent.getIntExtra(EXTRA_REQUEST_ID, 0);
                        int requestId = intent.getIntExtra(EXTRA_REQUEST_ID, 0);
                        FillResponse response = intent.getParcelableExtra(EXTRA_FILL_RESPONSE, android.service.autofill.FillResponse.class);
                        FillResponse response = intent.getParcelableExtra(EXTRA_FILL_RESPONSE, android.service.autofill.FillResponse.class);
                        mFillRequestEventLogger.maybeSetRequestTriggerReason(
                                TRIGGER_REASON_RETRIGGER);
                        mAssistReceiver.processDelayedFillLocked(requestId, response);
                        mAssistReceiver.processDelayedFillLocked(requestId, response);
                    }
                    }
                }
                }
@@ -1268,7 +1272,13 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        if(mPreviouslyFillDialogPotentiallyStarted) {
        if(mPreviouslyFillDialogPotentiallyStarted) {
            mFillRequestEventLogger.maybeSetRequestTriggerReason(TRIGGER_REASON_PRE_TRIGGER);
            mFillRequestEventLogger.maybeSetRequestTriggerReason(TRIGGER_REASON_PRE_TRIGGER);
        } else {
        } else {
            mFillRequestEventLogger.maybeSetRequestTriggerReason(TRIGGER_REASON_NORMAL_TRIGGER);
            if ((flags & FLAG_MANUAL_REQUEST) != 0) {
                mFillRequestEventLogger.maybeSetRequestTriggerReason(
                        TRIGGER_REASON_EXPLICITLY_REQUESTED);
            } else {
                mFillRequestEventLogger.maybeSetRequestTriggerReason(
                        TRIGGER_REASON_NORMAL_TRIGGER);
            }
        }
        }
        if (existingResponse != null) {
        if (existingResponse != null) {
            setViewStatesLocked(
            setViewStatesLocked(