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

Commit 2a9e5ad8 authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

Remove LRU spam prevention, as it's breaking the LRU.

Return early to disable the LRU spam prevention implemented in
ProcessList.updateClientActivitiesOrderingLSP when the flag is
enabled, as it's breaking the LRU by spreading processes.

Bug: 421872956
Test: atest CtsAppTestCases:ServiceTest#testLruWhenSwitchingBetweenAppsInFreeFormWindows
Flag: com.android.server.am.remove_lru_spam_prevention
Change-Id: I577f7de9ed478cef618f62c6bdf9b182bd606e58
parent ee5f0cfe
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3805,6 +3805,13 @@ public final class ProcessList {
            }

        }

        if (Flags.removeLruSpamPrevention()) {
            // Return early to disable the LRU spam prevention implemented below, as it's breaking
            // the LRU by spreading processes.
            return;
        }

        // To keep it from spamming the LRU list (by making a bunch of clients),
        // we will distribute other entries owned by it to be in-between other apps.
        int i = endIndex;
+8 −0
Original line number Diff line number Diff line
@@ -137,6 +137,14 @@ flag {
    bug: "378580264"
}

flag {
    name: "remove_lru_spam_prevention"
    namespace: "backstage_power"
    is_fixed_read_only: true
    description: "Remove LRU spam prevention, as it's breaking the LRU"
    bug: "421872956"
}

flag {
    name: "cpu_time_capability_based_freeze_policy"
    namespace: "backstage_power"