From 8062b9534f3d922bd3a5e55f6b0b94c843bf796d Mon Sep 17 00:00:00 2001 From: riddle_hsu Date: Thu, 31 Jul 2014 00:15:05 +0800 Subject: [PATCH] [ActivityManager] Prevent coredump file may not complete for testing. 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 --- .../android/server/am/ActivityManagerService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100755 => 100644 services/java/com/android/server/am/ActivityManagerService.java diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java old mode 100755 new mode 100644 index ae9807048ac79..0751c2b3e816f --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -10083,9 +10083,15 @@ public final class ActivityManagerService extends ActivityManagerNative int pid = r != null ? r.pid : Binder.getCallingPid(); 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 ("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); + } return; } } catch (RemoteException e) {