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

Commit 7cd48e4a 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

am: 63f24e9b

Change-Id: I916d3c33c022c22805d4ae2e9f7e508515b26fcf
parents 6db21c1e 63f24e9b
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);
                }
            }
        });
    }