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

Commit a8c0e350 authored by Jing Ji's avatar Jing Ji Committed by Automerger Merge Worker
Browse files

Merge "Fix potential race condition due to missing lock" am: 8787386e am: af33aac2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1864979

Change-Id: I81530ff1530b8ef5a2a11c47c7a5ab963a865397
parents 67b73c4b af33aac2
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -4906,7 +4906,9 @@ public final class ActiveServices {
            sr.setProcess(null, null, 0, null);
            sr.setProcess(null, null, 0, null);
            sr.isolatedProc = null;
            sr.isolatedProc = null;
            sr.executeNesting = 0;
            sr.executeNesting = 0;
            synchronized (mAm.mProcessStats.mLock) {
                sr.forceClearTracker();
                sr.forceClearTracker();
            }
            if (mDestroyingServices.remove(sr)) {
            if (mDestroyingServices.remove(sr)) {
                if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
                if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
            }
            }
@@ -5056,7 +5058,9 @@ public final class ActiveServices {
            i--;
            i--;
            ServiceRecord sr = mDestroyingServices.get(i);
            ServiceRecord sr = mDestroyingServices.get(i);
            if (sr.app == app) {
            if (sr.app == app) {
                synchronized (mAm.mProcessStats.mLock) {
                    sr.forceClearTracker();
                    sr.forceClearTracker();
                }
                mDestroyingServices.remove(i);
                mDestroyingServices.remove(i);
                if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
                if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
            }
            }