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

Commit e7f4f029 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Consume the first sample of KernelUidCpuTimeReader

If the system_server crashes, when it starts back up
it will assume that the entries in kernelUidCpuTimeReader
are all fresh and we will end up double counting cpu time
and power.

Bug:29163081
Change-Id: I73e693199c170229af57efd610950e90263ac9bc
parent 00681d0e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ public class KernelUidCpuTimeReader {
                    powerMaUs = 0;
                }

                if (callback != null) {
                // Only report if there is a callback and if this is not the first read.
                if (callback != null && mLastTimeReadUs != 0) {
                    long userTimeDeltaUs = userTimeUs;
                    long systemTimeDeltaUs = systemTimeUs;
                    long powerDeltaMaUs = powerMaUs;