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

Commit e9037dab authored by Simranjit Kohli's avatar Simranjit Kohli
Browse files

[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
parent d032a9c8
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -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;
@@ -833,6 +835,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.
     */
@@ -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() {}
    }