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

Commit 3df957ec authored by Jing Ji's avatar Jing Ji Committed by Android (Google) Code Review
Browse files

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

parents 5416a721 f135a423
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3784,7 +3784,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    @GuardedBy("this")
    private void waitForProcKillLocked(final ProcessRecord app, final String formatString,
    void waitForProcKillLocked(final ProcessRecord app, final String formatString,
            final long startTime) {
        app.mAppDiedCallback = () -> {
            synchronized (ActivityManagerService.this) {
+4 −5
Original line number Diff line number Diff line
@@ -1421,7 +1421,7 @@ public final class ProcessList {
        if (app.pendingStart) {
            return true;
        }
        long startTime = SystemClock.elapsedRealtime();
        long startTime = SystemClock.uptimeMillis();
        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.elapsedRealtime();
        long startTime = SystemClock.uptimeMillis();
        ProcessRecord app;
        if (!isolated) {
            app = getProcessRecordLocked(processName, info.uid, keepIfLarge);
@@ -1917,10 +1917,9 @@ 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.handleAppDiedLocked(app, true, true);
            checkSlow(startTime, "startProcess: done killing old proc");
            mService.waitForProcKillLocked(app, "startProcess: bad proc running, killing: %s",
                    startTime);
        }

        if (app == null) {