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

Commit 0d93bec8 authored by Jing Ji's avatar Jing Ji
Browse files

Revert "Wait for the previous app process died before restarting it"

This reverts commit f135a423.

Reason for revert: The previous fix would relinquish the global AM lock and result race conditions

Change-Id: Ic56b97cd2bf1ec0c80d012bda719649be7e61ec8
parent f135a423
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3783,7 +3783,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    @GuardedBy("this")
    void waitForProcKillLocked(final ProcessRecord app, final String formatString,
    private void waitForProcKillLocked(final ProcessRecord app, final String formatString,
            final long startTime) {
        app.mAppDiedCallback = () -> {
            synchronized (ActivityManagerService.this) {
+5 −4
Original line number Diff line number Diff line
@@ -1421,7 +1421,7 @@ public final class ProcessList {
        if (app.pendingStart) {
            return true;
        }
        long startTime = SystemClock.uptimeMillis();
        long startTime = SystemClock.elapsedRealtime();
        if (app.pid > 0 && app.pid != ActivityManagerService.MY_PID) {
            checkSlow(startTime, "startProcess: removing from pids map");
            mService.mPidsSelfLocked.remove(app);
@@ -1856,7 +1856,7 @@ public final class ProcessList {
            boolean knownToBeDead, int intentFlags, HostingRecord hostingRecord,
            boolean allowWhileBooting, boolean isolated, int isolatedUid, boolean keepIfLarge,
            String abiOverride, String entryPoint, String[] entryPointArgs, Runnable crashHandler) {
        long startTime = SystemClock.uptimeMillis();
        long startTime = SystemClock.elapsedRealtime();
        ProcessRecord app;
        if (!isolated) {
            app = getProcessRecordLocked(processName, info.uid, keepIfLarge);
@@ -1917,9 +1917,10 @@ public final class ProcessList {
            // An application record is attached to a previous process,
            // clean it up now.
            if (DEBUG_PROCESSES) Slog.v(TAG_PROCESSES, "App died: " + app);
            checkSlow(startTime, "startProcess: bad proc running, killing");
            ProcessList.killProcessGroup(app.uid, app.pid);
            mService.waitForProcKillLocked(app, "startProcess: bad proc running, killing: %s",
                    startTime);
            mService.handleAppDiedLocked(app, true, true);
            checkSlow(startTime, "startProcess: done killing old proc");
        }

        if (app == null) {