Loading core/java/android/app/IActivityManager.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -278,8 +278,7 @@ interface IActivityManager { boolean isImmersive(in IBinder token); void setImmersive(in IBinder token, boolean immersive); boolean isTopActivityImmersive(); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message, boolean force); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message); String getProviderMimeType(in Uri uri, int userId); IBinder newUriPermissionOwner(in String name); void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, Loading services/core/java/com/android/server/am/ActiveServices.java +1 −10 Original line number Diff line number Diff line Loading @@ -787,15 +787,6 @@ public final class ActiveServices { } } void killMisbehavingService(ServiceRecord r, int appUid, int appPid, String localPackageName) { synchronized (mAm) { stopServiceLocked(r); mAm.crashApplication(appUid, appPid, localPackageName, -1, "Bad notification for startForeground", true /*force*/); } } IBinder peekServiceLocked(Intent service, String resolvedType, String callingPackage) { ServiceLookupResult r = retrieveServiceLocked(service, resolvedType, callingPackage, Binder.getCallingPid(), Binder.getCallingUid(), Loading Loading @@ -3664,7 +3655,7 @@ public final class ActiveServices { void serviceForegroundCrash(ProcessRecord app, CharSequence serviceRecord) { mAm.crashApplication(app.uid, app.pid, app.info.packageName, app.userId, "Context.startForegroundService() did not then call Service.startForeground(): " + serviceRecord, false /*force*/); + serviceRecord); } void scheduleServiceTimeoutLocked(ProcessRecord proc) { Loading services/core/java/com/android/server/am/ActivityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -5763,7 +5763,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void crashApplication(int uid, int initialPid, String packageName, int userId, String message, boolean force) { String message) { if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: crashApplication() from pid=" Loading @@ -5775,8 +5775,7 @@ public class ActivityManagerService extends IActivityManager.Stub } synchronized(this) { mAppErrors.scheduleAppCrashLocked(uid, initialPid, packageName, userId, message, force); mAppErrors.scheduleAppCrashLocked(uid, initialPid, packageName, userId, message); } } services/core/java/com/android/server/am/ActivityManagerShellCommand.java +1 −1 Original line number Diff line number Diff line Loading @@ -990,7 +990,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } catch (NumberFormatException e) { packageName = arg; } mInterface.crashApplication(-1, pid, packageName, userId, "shell-induced crash", false); mInterface.crashApplication(-1, pid, packageName, userId, "shell-induced crash"); return 0; } Loading services/core/java/com/android/server/am/AppErrors.java +7 −19 Original line number Diff line number Diff line Loading @@ -314,24 +314,20 @@ class AppErrors { } void killAppAtUserRequestLocked(ProcessRecord app, Dialog fromDialog) { app.crashing = false; app.crashingReport = null; app.notResponding = false; app.notRespondingReport = null; if (app.anrDialog == fromDialog) { app.anrDialog = null; } if (app.waitDialog == fromDialog) { app.waitDialog = null; } killAppImmediateLocked(app, "user-terminated", "user request after error"); } private void killAppImmediateLocked(ProcessRecord app, String reason, String killReason) { app.crashing = false; app.crashingReport = null; app.notResponding = false; app.notRespondingReport = null; if (app.pid > 0 && app.pid != MY_PID) { handleAppCrashLocked(app, reason, handleAppCrashLocked(app, "user-terminated" /*reason*/, null /*shortMsg*/, null /*longMsg*/, null /*stackTrace*/, null /*data*/); app.kill(killReason, true); app.kill("user request after error", true); } } Loading @@ -345,7 +341,7 @@ class AppErrors { * @param message */ void scheduleAppCrashLocked(int uid, int initialPid, String packageName, int userId, String message, boolean force) { String message) { ProcessRecord proc = null; // Figure out which process to kill. We don't trust that initialPid Loading Loading @@ -378,14 +374,6 @@ class AppErrors { } proc.scheduleCrash(message); if (force) { // If the app is responsive, the scheduled crash will happen as expected // and then the delayed summary kill will be a no-op. final ProcessRecord p = proc; mService.mHandler.postDelayed( () -> killAppImmediateLocked(p, "forced", "killed for invalid state"), 5000L); } } /** Loading Loading
core/java/android/app/IActivityManager.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -278,8 +278,7 @@ interface IActivityManager { boolean isImmersive(in IBinder token); void setImmersive(in IBinder token, boolean immersive); boolean isTopActivityImmersive(); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message, boolean force); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message); String getProviderMimeType(in Uri uri, int userId); IBinder newUriPermissionOwner(in String name); void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, Loading
services/core/java/com/android/server/am/ActiveServices.java +1 −10 Original line number Diff line number Diff line Loading @@ -787,15 +787,6 @@ public final class ActiveServices { } } void killMisbehavingService(ServiceRecord r, int appUid, int appPid, String localPackageName) { synchronized (mAm) { stopServiceLocked(r); mAm.crashApplication(appUid, appPid, localPackageName, -1, "Bad notification for startForeground", true /*force*/); } } IBinder peekServiceLocked(Intent service, String resolvedType, String callingPackage) { ServiceLookupResult r = retrieveServiceLocked(service, resolvedType, callingPackage, Binder.getCallingPid(), Binder.getCallingUid(), Loading Loading @@ -3664,7 +3655,7 @@ public final class ActiveServices { void serviceForegroundCrash(ProcessRecord app, CharSequence serviceRecord) { mAm.crashApplication(app.uid, app.pid, app.info.packageName, app.userId, "Context.startForegroundService() did not then call Service.startForeground(): " + serviceRecord, false /*force*/); + serviceRecord); } void scheduleServiceTimeoutLocked(ProcessRecord proc) { Loading
services/core/java/com/android/server/am/ActivityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -5763,7 +5763,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void crashApplication(int uid, int initialPid, String packageName, int userId, String message, boolean force) { String message) { if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: crashApplication() from pid=" Loading @@ -5775,8 +5775,7 @@ public class ActivityManagerService extends IActivityManager.Stub } synchronized(this) { mAppErrors.scheduleAppCrashLocked(uid, initialPid, packageName, userId, message, force); mAppErrors.scheduleAppCrashLocked(uid, initialPid, packageName, userId, message); } }
services/core/java/com/android/server/am/ActivityManagerShellCommand.java +1 −1 Original line number Diff line number Diff line Loading @@ -990,7 +990,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } catch (NumberFormatException e) { packageName = arg; } mInterface.crashApplication(-1, pid, packageName, userId, "shell-induced crash", false); mInterface.crashApplication(-1, pid, packageName, userId, "shell-induced crash"); return 0; } Loading
services/core/java/com/android/server/am/AppErrors.java +7 −19 Original line number Diff line number Diff line Loading @@ -314,24 +314,20 @@ class AppErrors { } void killAppAtUserRequestLocked(ProcessRecord app, Dialog fromDialog) { app.crashing = false; app.crashingReport = null; app.notResponding = false; app.notRespondingReport = null; if (app.anrDialog == fromDialog) { app.anrDialog = null; } if (app.waitDialog == fromDialog) { app.waitDialog = null; } killAppImmediateLocked(app, "user-terminated", "user request after error"); } private void killAppImmediateLocked(ProcessRecord app, String reason, String killReason) { app.crashing = false; app.crashingReport = null; app.notResponding = false; app.notRespondingReport = null; if (app.pid > 0 && app.pid != MY_PID) { handleAppCrashLocked(app, reason, handleAppCrashLocked(app, "user-terminated" /*reason*/, null /*shortMsg*/, null /*longMsg*/, null /*stackTrace*/, null /*data*/); app.kill(killReason, true); app.kill("user request after error", true); } } Loading @@ -345,7 +341,7 @@ class AppErrors { * @param message */ void scheduleAppCrashLocked(int uid, int initialPid, String packageName, int userId, String message, boolean force) { String message) { ProcessRecord proc = null; // Figure out which process to kill. We don't trust that initialPid Loading Loading @@ -378,14 +374,6 @@ class AppErrors { } proc.scheduleCrash(message); if (force) { // If the app is responsive, the scheduled crash will happen as expected // and then the delayed summary kill will be a no-op. final ProcessRecord p = proc; mService.mHandler.postDelayed( () -> killAppImmediateLocked(p, "forced", "killed for invalid state"), 5000L); } } /** Loading