diff options
| author | Andreas Gampe <agampe@google.com> | 2019-06-21 14:05:31 -0700 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2019-06-21 14:05:31 -0700 |
| commit | 4fc0de746f8ccd795d23e681f52d16eb70bee93a (patch) | |
| tree | 28d03535341a3cf7def8d9cafb826803a4f4da8a /core/java | |
| parent | 7efc7748bae99e454ab7eb01bd15ce845a2ba0fe (diff) | |
| parent | 89e543fe54d22d6bf4ca9f989c7ab3cd21398922 (diff) | |
Merge changes Ie70d0155,I0692a91d,I8c5041a4 am: 4507201da5 am: 70ad27cfb5 am: e4a6ca7231
am: 89e543fe54
Change-Id: I2ac4405b4dc67edbda8dd94b877b4c7724d34509
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/os/RuntimeInit.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java index eac150dbd320..1de2e7272f4d 100644 --- a/core/java/com/android/internal/os/RuntimeInit.java +++ b/core/java/com/android/internal/os/RuntimeInit.java @@ -64,6 +64,19 @@ public class RuntimeInit { return Log.printlns(Log.LOG_ID_CRASH, Log.ERROR, tag, msg, tr); } + public static void logUncaught(String threadName, String processName, int pid, Throwable e) { + StringBuilder message = new StringBuilder(); + // The "FATAL EXCEPTION" string is still used on Android even though + // apps can set a custom UncaughtExceptionHandler that renders uncaught + // exceptions non-fatal. + message.append("FATAL EXCEPTION: ").append(threadName).append("\n"); + if (processName != null) { + message.append("Process: ").append(processName).append(", "); + } + message.append("PID: ").append(pid); + Clog_e(TAG, message.toString(), e); + } + /** * Logs a message when a thread encounters an uncaught exception. By * default, {@link KillApplicationHandler} will terminate this process later, @@ -85,17 +98,7 @@ public class RuntimeInit { if (mApplicationObject == null && (Process.SYSTEM_UID == Process.myUid())) { Clog_e(TAG, "*** FATAL EXCEPTION IN SYSTEM PROCESS: " + t.getName(), e); } else { - StringBuilder message = new StringBuilder(); - // The "FATAL EXCEPTION" string is still used on Android even though - // apps can set a custom UncaughtExceptionHandler that renders uncaught - // exceptions non-fatal. - message.append("FATAL EXCEPTION: ").append(t.getName()).append("\n"); - final String processName = ActivityThread.currentProcessName(); - if (processName != null) { - message.append("Process: ").append(processName).append(", "); - } - message.append("PID: ").append(Process.myPid()); - Clog_e(TAG, message.toString(), e); + logUncaught(t.getName(), ActivityThread.currentProcessName(), Process.myPid(), e); } } } |
