From 214be42ea690ee99e1b404844afbe2c138447b59 Mon Sep 17 00:00:00 2001 From: riddle_hsu Date: Thu, 31 Jul 2014 00:15:05 +0800 Subject: [ActivityManager] Prevent coredump file may not complete for testing. Cherry-pick from aosp to lmp-dev Sympton: During testing, skip kill native crash process manually because it will continue to die by default. Root Cause: Large process may take some time to do coredump.In auto test, crash process will be killed immediately that results incomplete coredump file. Solution: If the tester (IActivityController) will handle app crash event, Do not kill native crashed process if the rom is debuggable. Change-Id: Ia360af147d694125d440e5ba2f958c4759a50494 Conflicts: services/java/com/android/server/am/ActivityManagerService.java --- .../com/android/server/am/ActivityManagerService.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index cfdf7cfd6db0..1ae0bbcf3ae8 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; } -- cgit v1.2.3-59-g8ed1b