summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-10-30 10:45:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-30 10:45:49 -0700
commit44251a70edba3e950aab1f706e1ff34e2fa4dfae (patch)
tree28283913afce21a6c0b826c24334f3629cb4a34c /core/java
parent13a6df91d9016063057aed07d21c8135f22f7f18 (diff)
parentef03a7f441cf0cbef5a5f7fafb58a7d5aea7ef52 (diff)
downloadframeworks_base-44251a70edba3e950aab1f706e1ff34e2fa4dfae.zip
frameworks_base-44251a70edba3e950aab1f706e1ff34e2fa4dfae.tar.gz
frameworks_base-44251a70edba3e950aab1f706e1ff34e2fa4dfae.tar.bz2
Merge "Work on issue #7343200: Fails to show wallpaper in the background..." into jb-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/Debug.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index c08bfeb..e50c948 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -1363,6 +1363,23 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
}
/**
+ * Like {@link #getCallers(int)}, but each location is append to the string
+ * as a new line with <var>linePrefix</var> in front of it.
+ * @param depth the number of levels to return, starting with the immediate caller.
+ * @param linePrefix prefix to put in front of each location.
+ * @return a string describing the call stack.
+ * {@hide}
+ */
+ public static String getCallers(final int depth, String linePrefix) {
+ final StackTraceElement[] callStack = Thread.currentThread().getStackTrace();
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < depth; i++) {
+ sb.append(linePrefix).append(getCaller(callStack, i)).append("\n");
+ }
+ return sb.toString();
+ }
+
+ /**
* @return a String describing the immediate caller of the calling function.
* {@hide}
*/