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

Commit 3765e0aa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Merge "When fork() fails, clean up data structures." into nyc-dev am:...

Merge "Merge "When fork() fails, clean up data structures." into nyc-dev am: f10640ad am: 01e97ab8" into nyc-mr1-dev-plus-aosp
am: 69f17e70

* commit '69f17e70':
  When fork() fails, clean up data structures.

Change-Id: I7820d4431877949e53543c929991b8175b951159
parents fc7aaba8 69f17e70
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -3724,13 +3724,16 @@ public final class ActivityManagerService extends ActivityManagerNative
            }
            checkTime(startTime, "startProcess: done updating pids map");
        } catch (RuntimeException e) {
            // XXX do better error recovery.
            app.setPid(0);
            mBatteryStatsService.noteProcessFinish(app.processName, app.info.uid);
            if (app.isolated) {
                mBatteryStatsService.removeIsolatedUid(app.uid, app.info.uid);
            }
            Slog.e(TAG, "Failure starting process " + app.processName, e);
            // Something went very wrong while trying to start this process; one
            // common case is when the package is frozen due to an active
            // upgrade. To recover, clean up any active bookkeeping related to
            // starting this process. (We already invoked this method once when
            // the package was initially frozen through KILL_APPLICATION_MSG, so
            // it doesn't hurt to use it again.)
            forceStopPackageLocked(app.info.packageName, UserHandle.getAppId(app.uid), false,
                    false, true, false, false, UserHandle.getUserId(app.userId), "start failure");
        }
    }