summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Yu <yunicorn@google.com> 2024-05-10 18:32:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-05-10 18:32:59 +0000
commite3ce3dde3ffee601ef166af93b07de3b389fd40d (patch)
tree9caeded3f2a3caf08f96ad2dbd19a7c91e5eae94
parent1ff73c56fa4cd77225f682d7973de4c52dd70355 (diff)
parent7595345c164acf6cfa75d63528446e89ffdb820d (diff)
Merge "Autofill Presentation Logs" into main
-rw-r--r--services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java19
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java1
2 files changed, 18 insertions, 2 deletions
diff --git a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
index 9c84b123a435..c4b461f869b0 100644
--- a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
+++ b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
@@ -564,6 +564,18 @@ public final class PresentationStatsEventLogger {
});
}
+ /** Sets focused_autofill_id using view id */
+ public void maybeSetFocusedId(AutofillId id) {
+ maybeSetFocusedId(id.getViewId());
+ }
+
+ /** Sets focused_autofill_id as long as mEventInternal is present */
+ public void maybeSetFocusedId(int id) {
+ mEventInternal.ifPresent(event -> {
+ event.mFocusedId = id;
+ });
+ }
+
public void logAndEndEvent() {
if (!mEventInternal.isPresent()) {
Slog.w(TAG, "Shouldn't be logging AutofillPresentationEventReported again for same "
@@ -608,7 +620,8 @@ public final class PresentationStatsEventLogger {
+ " mIsCredentialRequest=" + event.mIsCredentialRequest
+ " mWebviewRequestedCredential=" + event.mWebviewRequestedCredential
+ " mViewFillableTotalCount=" + event.mViewFillableTotalCount
- + " mViewFillFailureCount=" + event.mViewFillFailureCount);
+ + " mViewFillFailureCount=" + event.mViewFillFailureCount
+ + " mFocusedId=" + event.mFocusedId);
}
// TODO(b/234185326): Distinguish empty responses from other no presentation reasons.
@@ -651,7 +664,8 @@ public final class PresentationStatsEventLogger {
event.mIsCredentialRequest,
event.mWebviewRequestedCredential,
event.mViewFillableTotalCount,
- event.mViewFillFailureCount);
+ event.mViewFillFailureCount,
+ event.mFocusedId);
mEventInternal = Optional.empty();
}
@@ -689,6 +703,7 @@ public final class PresentationStatsEventLogger {
boolean mWebviewRequestedCredential = false;
int mViewFillableTotalCount = -1;
int mViewFillFailureCount = -1;
+ int mFocusedId = -1;
PresentationStatsEventInternal() {}
}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 8b13c4b762d5..03cf74fe0619 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -4669,6 +4669,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
mFieldClassificationIdSnapshot);
mPresentationStatsEventLogger.maybeSetAvailableCount(
response.getDatasets(), mCurrentViewId);
+ mPresentationStatsEventLogger.maybeSetFocusedId(mCurrentViewId);
}
@GuardedBy("mLock")