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
This commit is contained in:
Adam Lesinski
2016-06-08 14:19:09 -07:00
parent 00681d0e78
commit e7f4f0297f

View File

@@ -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;