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

Commit 8f5e0002 authored by Tim Murray's avatar Tim Murray Committed by Marco Ballesio
Browse files

CachedAppOptimizer: don't take AM lock when freezer is not enabled

Freezing and unfreezing don't reqiure the AM lock when freezer is not
enabled.

Test: boot, no lock contention on unfreezeTemporarily
Bug: 161866124

Change-Id: Ic650456aa8938db38b368042ce3f42fa43e7a130
Merged-In: Ic650456aa8938db38b368042ce3f42fa43e7a130
parent 43ad2093
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -722,6 +722,7 @@ public final class CachedAppOptimizer {

    // This will ensure app will be out of the freezer for at least FREEZE_TIMEOUT_MS
    void unfreezeTemporarily(ProcessRecord app) {
        if (mUseFreezer) {
            synchronized (mAm) {
                if (app.frozen) {
                    unfreezeAppLocked(app);
@@ -729,6 +730,7 @@ public final class CachedAppOptimizer {
                }
            }
        }
    }

    @GuardedBy("mAm")
    void freezeAppAsync(ProcessRecord app) {