diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index cfdf7cfd6db04..1ae0bbcf3ae89 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -10966,11 +10966,17 @@ public final class ActivityManagerService extends ActivityManagerNative int uid = r != null ? r.info.uid : Binder.getCallingUid(); if (!mController.appCrashed(name, pid, shortMsg, longMsg, timeMillis, crashInfo.stackTrace)) { - Slog.w(TAG, "Force-killing crashed app " + name - + " at watcher's request"); - Process.killProcess(pid); - if (r != null) { - Process.killProcessGroup(uid, pid); + if ("1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")) + && "Native crash".equals(crashInfo.exceptionClassName)) { + Slog.w(TAG, "Skip killing native crashed app " + name + + "(" + pid + ") during testing"); + } else { + Slog.w(TAG, "Force-killing crashed app " + name + + " at watcher's request"); + Process.killProcess(pid); + if (r != null) { + Process.killProcessGroup(uid, pid); + } } return; }