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

Commit 1eabad19 authored by Jing Ji's avatar Jing Ji
Browse files

Allocate the frozen app duration array with the LRU size

Bug: 281356186
Test: adb shell cmd stats pull-source 10189
Change-Id: Ica2ec04a8a6b9f3ba421f6dd6f512791cc22c1c7
parent ab363773
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -500,10 +500,11 @@ public class AppProfiler {
                mLatestFrozenTimestamp = 0L;
                mTotalFrozenDurations = 0L;
                mNumOfFrozenApps = 0;
                final int lruSize = mService.mProcessList.getLruSizeLOSP();
                if (mCachedAppFrozenDurations == null
                        || mCachedAppFrozenDurations.length < mCachedAppHighWatermark) {
                        || mCachedAppFrozenDurations.length < lruSize) {
                    mCachedAppFrozenDurations = new long[Math.max(
                            mCachedAppHighWatermark, mService.mConstants.CUR_MAX_CACHED_PROCESSES)];
                            lruSize, mService.mConstants.CUR_MAX_CACHED_PROCESSES)];
                }
                mService.mProcessList.forEachLruProcessesLOSP(true, app -> {
                    if (app.mOptRecord.isFrozen()) {