diff options
| author | 2022-06-30 16:15:46 -0700 | |
|---|---|---|
| committer | 2022-07-07 03:04:36 +0000 | |
| commit | 7d7ee57b4dbbe4723c19cf5308eee10d6c6cf2a6 (patch) | |
| tree | ff797a563f0f07ecf4dd0b8a9d94aacbf941432f | |
| parent | 4e647a7f497c0998a2b525f3a58d7f9e701f4e26 (diff) | |
Don't freeze apps in the power exemption allow list.
Set the "should not freeze" flag in oom adjuster if the app
is in the power exemption allow list, as it doesn't make sense
to freeze such kind of apps. There is an existing call to
update the oom adj when the power exemption list changes.
Bug: 237178259
Bug: 231253560
Test: Manual - see b/237178259#comment20
Test: atest CachedAppOptimizerTest
Change-Id: I5fd1e623f60680b34096f0e58a088f72bf1089cb
(cherry picked from commit 60e35ca3df2a91923b62f3533bda1f10b671e46b)
Merged-In: I5fd1e623f60680b34096f0e58a088f72bf1089cb
| -rw-r--r-- | services/core/java/com/android/server/am/OomAdjuster.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java index e7fcc5989467..f7fbbe4ebead 100644 --- a/services/core/java/com/android/server/am/OomAdjuster.java +++ b/services/core/java/com/android/server/am/OomAdjuster.java @@ -1482,7 +1482,9 @@ public class OomAdjuster { if (!cycleReEval) { // Don't reset this flag when doing cycles re-evaluation. state.setNoKillOnBgRestrictedAndIdle(false); - app.mOptRecord.setShouldNotFreeze(false); + // If this UID is currently allowlisted, it should not be frozen. + final UidRecord uidRec = app.getUidRecord(); + app.mOptRecord.setShouldNotFreeze(uidRec != null && uidRec.isCurAllowListed()); } final int appUid = app.info.uid; |