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

Commit d43735b3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add the process name to the kill reason when available" into main

parents 9a6c97c1 89f96134
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -3933,11 +3933,28 @@ public class ActivityManagerService extends IActivityManager.Stub
                                + packageName + ": " + e);
                    }
                    if (mUserController.isUserRunning(user, userRunningFlags)) {
                        String description;
                        if (reason == null) {
                            description = "from pid " + callingPid;
                            // Add the name of the process if it's available
                            final ProcessRecord callerApp;
                            synchronized (mPidsSelfLocked) {
                                callerApp = mPidsSelfLocked.get(callingPid);
                            }
                            if (callerApp != null) {
                                description += " (" + callerApp.processName + ")";
                            }
                        } else {
                            description = reason;
                        }
                        forceStopPackageLocked(packageName, UserHandle.getAppId(pkgUid),
                                false /* callerWillRestart */, false /* purgeCache */,
                                true /* doIt */, false /* evenPersistent */,
                                false /* uninstalling */, true /* packageStateStopped */, user,
                                reason == null ? ("from pid " + callingPid) : reason);
                                false /* uninstalling */, true /* packageStateStopped */,
                                user, description);
                        finishForceStopPackageLocked(packageName, pkgUid);
                    }
                }