summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Simranjit Kohli <simranjit@google.com> 2024-09-11 12:12:00 -0700
committer Simranjit Kohli <simranjit@google.com> 2024-09-16 11:35:03 -0700
commite9037dab72e15f281ece3d0146ba166b2000e439 (patch)
treee98768adbb31c76cda655e53d71018e19ae9e9be
parentd032a9c8d402a40facc32afc6e5567118258a1c8 (diff)
[Relayout logging]: Allow relayout logs to be logged
Currently, session side doesn't recieve information about updated autofill ids. As such, we don't have information about eligible datatests for the new autofill id. This will be addressed in future when we address save for relayout cases. Meanwhile, we allow relayout logs to be logged. Test: m; statsd_testdrive 469 Flag: EXEMPT bugfix Bug: 365801998 Change-Id: I22c722c85259f4776b87763bdbebb5b1d752541b
-rw-r--r--services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
index 2c261fe668fb..bd1b0ea99e17 100644
--- a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
+++ b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
@@ -732,6 +732,7 @@ public final class PresentationStatsEventLogger {
// These autofill id's are being refilled, so they had failed previously.
// Note that these autofillIds correspond to the new autofill ids after relayout.
event.mFailedAutofillIds = new ArraySet<>(autofillIds);
+ setHasRelayoutLog();
});
}
@@ -753,6 +754,7 @@ public final class PresentationStatsEventLogger {
int failureCount = ids.size();
if (isRefill) {
event.mViewFailedOnRefillCount = failureCount;
+ setHasRelayoutLog();
} else {
event.mViewFillFailureCount = failureCount;
event.mViewFailedPriorToRefillCount = failureCount;
@@ -834,6 +836,19 @@ public final class PresentationStatsEventLogger {
}
/**
+ * Set the log contains relayout metrics.
+ * This is being added as a temporary measure to add logging.
+ * In future, when we map Session's old view states to the new autofill id's as part of fixing
+ * save for relayout cases, we no longer would need this. But till then, this is needed to set
+ * autofill logs for relayout cases.
+ */
+ private void setHasRelayoutLog() {
+ mEventInternal.ifPresent(event -> {
+ event.mHasRelayoutLog = true;
+ });
+ }
+
+ /**
* Finish and log the event.
*/
public void logAndEndEvent(String caller) {
@@ -844,8 +859,10 @@ public final class PresentationStatsEventLogger {
}
PresentationStatsEventInternal event = mEventInternal.get();
- boolean ignoreLogging = !event.mIsDatasetAvailable;
-
+ boolean ignoreLogging = !event.mIsDatasetAvailable
+ && !event.mHasRelayoutLog
+ && !(event.mFixExpireResponseDuringAuthCount > 0)
+ && !(event.mNotifyViewEnteredIgnoredDuringAuthCount > 0);
if (sVerbose) {
Slog.v(TAG, "(" + caller + ") "
+ (ignoreLogging ? "IGNORING - following event won't be logged: " : "")
@@ -1032,8 +1049,9 @@ public final class PresentationStatsEventLogger {
ArraySet<AutofillId> mFailedAutofillIds = new ArraySet<>();
ArraySet<AutofillId> mAlreadyFilledAutofillIds = new ArraySet<>();
- // Not logged - used for internal logic
+ // Following are not logged and used only for internal logic
boolean shouldResetShownCount = false;
+ boolean mHasRelayoutLog = false;
PresentationStatsEventInternal() {}
}