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

Commit 9349424f authored by Jing Ji's avatar Jing Ji
Browse files

Update the memory trim level on memory pressure events

If the USE_MODERN_TRIM is enabled, we had skipped the updates
of the memory trim level, which is useful to the job scheduler.

Now fix this problem by moving the update ahead.

Bug: 300277099
Change-Id: I190e9598ee72efcb466548bab0210d51d7648cd5
Test: adb shell am memory-factor show
parent f00f4b39
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1205,6 +1205,8 @@ public class AppProfiler {
            trackerMemFactor = mService.mProcessStats.getMemFactorLocked();
        }

        mLastMemoryLevel = memFactor;
        mLastNumProcesses = mService.mProcessList.getLruSizeLOSP();
        if (mService.mConstants.USE_MODERN_TRIM) {
            // Modern trim is not sent based on lowmem state
            // Dispatch UI_HIDDEN to processes that need it
@@ -1235,8 +1237,6 @@ public class AppProfiler {
            return false;
        }

        mLastMemoryLevel = memFactor;
        mLastNumProcesses = mService.mProcessList.getLruSizeLOSP();
        if (memFactor != ADJ_MEM_FACTOR_NORMAL) {
            if (mLowRamStartTime == 0) {
                mLowRamStartTime = now;