summaryrefslogtreecommitdiff
path: root/core/java/android/os/Debug.java
diff options
context:
space:
mode:
authorsongjinshi <songjinshi@xiaomi.com>2016-12-16 17:48:21 +0800
committerJosh Gao <jmgao@google.com>2017-02-07 19:17:45 +0000
commite02e3ea7f97fe9554a9ff1464a2875b7d07a19bf (patch)
treed5c948c690bcca1b8e5bc52a2775ac5f12c0f892 /core/java/android/os/Debug.java
parente724f82b3d74d41a334106a780ab3917c958eb9c (diff)
[Debug]: Add timeout for dumpNativeBacktraceToFile.
If the debuggerd be blocked, the watchdog and activitymanager thread will be blocked when the ANR or watchdog occurs,so we needed to add timeout for dumpNativeBacktraceToFile. Change-Id: Iab1a64328e70257025d860638d93a4fb8eaaeea2 Signed-off-by: songjinshi <songjinshi@xiaomi.com>
Diffstat (limited to 'core/java/android/os/Debug.java')
-rw-r--r--core/java/android/os/Debug.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index 210ddb6cd397..e05bd89079af 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -2219,11 +2219,13 @@ public final class Debug
}
/**
- * Have the stack traces of the given native process dumped to the
- * specified file. Will be appended to the file.
+ * Append the stack traces of a given native process to a specified file.
+ * @param pid pid to dump.
+ * @param file path of file to append dump to.
+ * @param timeoutSecs time to wait in seconds, or 0 to wait forever.
* @hide
*/
- public static native void dumpNativeBacktraceToFile(int pid, String file);
+ public static native void dumpNativeBacktraceToFileTimeout(int pid, String file, int timeoutSecs);
/**
* Get description of unreachable native memory.