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

Commit 9b91c773 authored by Lee Shombert's avatar Lee Shombert Committed by Android (Google) Code Review
Browse files

Merge "Guard mThread in ProcessRecord" into main

parents 209ca69a 47aa8421
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -1443,17 +1443,32 @@ class ProcessRecord implements WindowProcessListener {

    void onProcessFrozen() {
        mProfile.onProcessFrozen();
        if (mThread != null) mThread.onProcessPaused();
        final ApplicationThreadDeferred t;
        synchronized (mService) {
            t = mThread;
        }
        // Release the lock before calling the notifier, in case that calls back into AM.
        if (t != null) t.onProcessPaused();
    }

    void onProcessUnfrozen() {
        if (mThread != null) mThread.onProcessUnpaused();
        final ApplicationThreadDeferred t;
        synchronized (mService) {
            t = mThread;
        }
        // Release the lock before calling the notifier, in case that calls back into AM.
        if (t != null) t.onProcessUnpaused();
        mProfile.onProcessUnfrozen();
        mServices.onProcessUnfrozen();
    }

    void onProcessFrozenCancelled() {
        if (mThread != null) mThread.onProcessPausedCancelled();
        final ApplicationThreadDeferred t;
        synchronized (mService) {
            t = mThread;
        }
        // Release the lock before calling the notifier, in case that calls back into AM.
        if (t != null) t.onProcessPausedCancelled();
        mServices.onProcessFrozenCancelled();
    }