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

Commit 9193fa1c authored by qinyige1's avatar qinyige1
Browse files

[AMS] Fix race condition in ProcessList.

ProcessList.noteAppKill should be called with lock but
AppErrors.crashApplicationInner doesn't. So fix it.

Bug: 215575163
Test: Manual
Change-Id: I594256a8989f6bf79ac0b12ff5069cc895872b22
parent fef33579
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -575,6 +575,7 @@ class AppErrors {
            mPackageWatchdog.onPackageFailure(r.getPackageListWithVersionCode(),
                    PackageWatchdog.FAILURE_REASON_APP_CRASH);

            synchronized (mService) {
                mService.mProcessList.noteAppKill(r, (crashInfo != null
                          && "Native crash".equals(crashInfo.exceptionClassName))
                          ? ApplicationExitInfo.REASON_CRASH_NATIVE
@@ -582,6 +583,7 @@ class AppErrors {
                          ApplicationExitInfo.SUBREASON_UNKNOWN,
                        "crash");
            }
        }

        final int relaunchReason = r != null
                ? r.getWindowProcessController().computeRelaunchReason() : RELAUNCH_REASON_NONE;