diff options
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java | 2 | ||||
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/Session.java | 43 |
2 files changed, 35 insertions, 10 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java index fd8ab9683831..e1291e5f75ec 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java @@ -451,7 +451,7 @@ final class AutofillManagerServiceImpl final Session.SaveResult saveResult = session.showSaveLocked(); - session.logContextCommitted(saveResult.getNoSaveUiReason(), commitReason); + session.logContextCommittedLocked(saveResult.getNoSaveUiReason(), commitReason); if (saveResult.isLogSaveShown()) { session.logSaveUiShown(); diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 2ff23ee17bfd..b89e0d8c72df 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -3086,6 +3086,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState * when necessary. */ public void logContextCommitted() { + if (sVerbose) { + Slog.v(TAG, "logContextCommitted (" + id + "): commit_reason:" + COMMIT_REASON_UNKNOWN + + " no_save_reason:" + Event.NO_SAVE_UI_REASON_NONE); + } mHandler.sendMessage(obtainMessage(Session::handleLogContextCommitted, this, Event.NO_SAVE_UI_REASON_NONE, COMMIT_REASON_UNKNOWN)); @@ -3094,16 +3098,26 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState /** * Generates a {@link android.service.autofill.FillEventHistory.Event#TYPE_CONTEXT_COMMITTED} - * when necessary. + * when necessary. Note that it could be called before save UI is shown and the session is + * committed. * * @param saveDialogNotShowReason The reason why a save dialog was not shown. * @param commitReason The reason why context is committed. */ - public void logContextCommitted(@NoSaveReason int saveDialogNotShowReason, + + @GuardedBy("mLock") + public void logContextCommittedLocked(@NoSaveReason int saveDialogNotShowReason, @AutofillCommitReason int commitReason) { + if (sVerbose) { + Slog.v(TAG, "logContextCommittedLocked (" + id + "): commit_reason:" + commitReason + + " no_save_reason:" + saveDialogNotShowReason); + } mHandler.sendMessage(obtainMessage(Session::handleLogContextCommitted, this, saveDialogNotShowReason, commitReason)); - logAllEvents(commitReason); + + mSessionCommittedEventLogger.maybeSetCommitReason(commitReason); + mSessionCommittedEventLogger.maybeSetRequestCount(mRequestCount); + mSaveEventLogger.maybeSetSaveUiNotShownReason(NO_SAVE_REASON_NONE); } private void handleLogContextCommitted(@NoSaveReason int saveDialogNotShowReason, @@ -3159,6 +3173,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @Nullable ArrayList<FieldClassification> detectedFieldClassifications, @NoSaveReason int saveDialogNotShowReason, @AutofillCommitReason int commitReason) { + if (sVerbose) { + Slog.v(TAG, "logContextCommittedLocked (" + id + "): commit_reason:" + commitReason + + " no_save_reason:" + saveDialogNotShowReason); + } final FillResponse lastResponse = getLastResponseLocked("logContextCommited(%s)"); if (lastResponse == null) return; @@ -3335,7 +3353,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState changedFieldIds, changedDatasetIds, manuallyFilledFieldIds, manuallyFilledDatasetIds, detectedFieldIds, detectedFieldClassifications, mComponentName, mCompatMode, saveDialogNotShowReason); - logAllEvents(commitReason); + mSessionCommittedEventLogger.maybeSetCommitReason(commitReason); + mSessionCommittedEventLogger.maybeSetRequestCount(mRequestCount); + mSaveEventLogger.maybeSetSaveUiNotShownReason(saveDialogNotShowReason); } /** @@ -3776,11 +3796,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } - if (sDebug) { - Slog.d(TAG, "Good news, everyone! All checks passed, show save UI for " - + id + "!"); - } - final IAutoFillManagerClient client = getClient(); mPendingSaveUi = new PendingUi(new Binder(), id, client); @@ -3812,6 +3827,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } mSessionFlags.mShowingSaveUi = true; + if (sDebug) { + Slog.d(TAG, "Good news, everyone! All checks passed, show save UI for " + + id + "!"); + } return new SaveResult(/* logSaveShown= */ true, /* removeSession= */ false, Event.NO_SAVE_UI_REASON_NONE); } @@ -6386,6 +6405,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @GuardedBy("mLock") private void logAllEvents(@AutofillCommitReason int val) { + if (sVerbose) { + Slog.v(TAG, "logAllEvents(" + id + "): commitReason: " + val); + } mSessionCommittedEventLogger.maybeSetCommitReason(val); mSessionCommittedEventLogger.maybeSetRequestCount(mRequestCount); mSessionCommittedEventLogger.maybeSetSessionDurationMillis( @@ -6411,6 +6433,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @GuardedBy("mLock") RemoteFillService destroyLocked() { // Log unlogged events. + if (sVerbose) { + Slog.v(TAG, "destroyLocked for session: " + id); + } logAllEvents(COMMIT_REASON_SESSION_DESTROYED); if (mDestroyed) { |