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

Commit e4749a7f authored by Varun Shah's avatar Varun Shah Committed by Android (Google) Code Review
Browse files

Merge "Ensure total runtime for time-limited FGS is in uptime base." into main

parents 0f0f6fd6 0f8d0358
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -683,6 +683,7 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
        private long mLastFgsStartTime;
        @UptimeMillisLong
        private long mTimeLimitExceededAt = Long.MIN_VALUE;
        @UptimeMillisLong
        private long mTotalRuntime = 0;

        TimeLimitedFgsInfo(@UptimeMillisLong long startTime) {
@@ -705,9 +706,10 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
        }

        public void updateTotalRuntime() {
            mTotalRuntime += SystemClock.elapsedRealtime() - mLastFgsStartTime;
            mTotalRuntime += SystemClock.uptimeMillis() - mLastFgsStartTime;
        }

        @UptimeMillisLong
        public long getTotalRuntime() {
            return mTotalRuntime;
        }