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

Commit 63f24e9b authored by Chenjie Yu's avatar Chenjie Yu Committed by android-build-merger
Browse files

Merge "Improve efficiency for CpuTimePerUidFreq" into pi-dev

am: d4803600

Change-Id: Iad3b9ee4dcca61a3afd6c4211f7f352f6b572e83
parents 332dc381 d4803600
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -720,12 +720,14 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
        long elapsedNanos = SystemClock.elapsedRealtimeNanos();
        mKernelUidCpuFreqTimeReader.readAbsolute((uid, cpuFreqTimeMs) -> {
            for (int freqIndex = 0; freqIndex < cpuFreqTimeMs.length; ++freqIndex) {
                if(cpuFreqTimeMs[freqIndex] != 0) {
                    StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 3);
                    e.writeInt(uid);
                    e.writeInt(freqIndex);
                    e.writeLong(cpuFreqTimeMs[freqIndex]);
                    pulledData.add(e);
                }
            }
        });
    }