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

Commit c602bd53 authored by Sunny Shao's avatar Sunny Shao
Browse files

Fix the huge value of the ACTION_DASHBOARD_VISIBLE_TIME

- We only record the elapsed time once after user invoked writeElapsedTimeMetric.

Fixes: 147722985
Test: manual test

Change-Id: I11d713538d895bc4ee5551b924f4d85ac66e64f9
parent b85c3a8f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -87,9 +87,11 @@ public class VisibilityLoggerMixin implements LifecycleObserver, OnAttach {
        if (mMetricsFeature == null || mMetricsCategory == METRICS_CATEGORY_UNKNOWN) {
            return;
        }
        if (mCreationTimestamp != 0L) {
            final int elapse = (int) (SystemClock.elapsedRealtime() - mCreationTimestamp);
            mMetricsFeature.action(METRICS_CATEGORY_UNKNOWN, action, mMetricsCategory, key, elapse);
        }
    }

    /**
     * Sets source metrics category for this logger. Source is the caller that opened this UI.