diff options
| author | Dianne Hackborn <hackbod@google.com> | 2012-10-30 10:45:49 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-30 10:45:49 -0700 |
| commit | 44251a70edba3e950aab1f706e1ff34e2fa4dfae (patch) | |
| tree | 28283913afce21a6c0b826c24334f3629cb4a34c /core/java | |
| parent | 13a6df91d9016063057aed07d21c8135f22f7f18 (diff) | |
| parent | ef03a7f441cf0cbef5a5f7fafb58a7d5aea7ef52 (diff) | |
| download | frameworks_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.java | 17 |
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} */ |
