Include important native processes in watchdog stacks.

Helps us track down deadlocks involving native service processes.

Bug: 6615693
Change-Id: I580047550772e29586195a8cf440141574e3f40c
diff --git a/services/java/com/android/server/Watchdog.java b/services/java/com/android/server/Watchdog.java
index 728fb26..c239382 100644
--- a/services/java/com/android/server/Watchdog.java
+++ b/services/java/com/android/server/Watchdog.java
@@ -67,6 +67,12 @@
 
     static final String REBOOT_ACTION = "com.android.service.Watchdog.REBOOT";
 
+    static final String[] NATIVE_STACKS_OF_INTEREST = new String[] {
+        "/system/bin/mediaserver",
+        "/system/bin/sdcard",
+        "/system/bin/surfaceflinger"
+    };
+
     static Watchdog sWatchdog;
 
     /* This handler will be used to post message back onto the main thread */
@@ -414,7 +420,8 @@
                     // trace and wait another half.
                     ArrayList<Integer> pids = new ArrayList<Integer>();
                     pids.add(Process.myPid());
-                    ActivityManagerService.dumpStackTraces(true, pids, null, null);
+                    ActivityManagerService.dumpStackTraces(true, pids, null, null,
+                            NATIVE_STACKS_OF_INTEREST);
                     waitedHalf = true;
                     continue;
                 }
@@ -434,7 +441,7 @@
             // Pass !waitedHalf so that just in case we somehow wind up here without having
             // dumped the halfway stacks, we properly re-initialize the trace file.
             final File stack = ActivityManagerService.dumpStackTraces(
-                    !waitedHalf, pids, null, null);
+                    !waitedHalf, pids, null, null, NATIVE_STACKS_OF_INTEREST);
 
             // Give some extra time to make sure the stack traces get written.
             // The system's been hanging for a minute, another second or two won't hurt much.