summaryrefslogtreecommitdiffstats
path: root/core/java/android/util/Log.java
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-06-09 10:51:43 -0700
committerChristopher Ferris <cferris@google.com>2015-06-09 10:51:43 -0700
commit2d073ba83c570466a7f77d1cd9193ab4a60eaee4 (patch)
tree3df600c3b1c712f3fb948ddbd72900732e50e596 /core/java/android/util/Log.java
parent5e4c382d15968c757fb9c5783cbd420156ea8ad2 (diff)
downloadframeworks_base-2d073ba83c570466a7f77d1cd9193ab4a60eaee4.zip
frameworks_base-2d073ba83c570466a7f77d1cd9193ab4a60eaee4.tar.gz
frameworks_base-2d073ba83c570466a7f77d1cd9193ab4a60eaee4.tar.bz2
Change wtf errors from ASSERT to ERROR.
Calling println_native with the value of ASSERT will set the abort message. Unfortunately, there are numerous cases where one thread aborts, but before that thread can communicate with debuggerd, another thread calls wtf, which overwrites the abort message from the original failing thread. Fix this by changing this to an error level log message. Bug: 21490722 Change-Id: I9500e2e63eea96722602fdd46c86939c001a7c65
Diffstat (limited to 'core/java/android/util/Log.java')
-rw-r--r--core/java/android/util/Log.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/util/Log.java b/core/java/android/util/Log.java
index 121485a..fe41932 100644
--- a/core/java/android/util/Log.java
+++ b/core/java/android/util/Log.java
@@ -289,7 +289,10 @@ public final class Log {
static int wtf(int logId, String tag, String msg, Throwable tr, boolean localStack,
boolean system) {
TerribleFailure what = new TerribleFailure(msg, tr);
- int bytes = println_native(logId, ASSERT, tag, msg + '\n'
+ // Only mark this as ERROR, do not use ASSERT since that should be
+ // reserved for cases where the system is guaranteed to abort.
+ // The onTerribleFailure call does not always cause a crash.
+ int bytes = println_native(logId, ERROR, tag, msg + '\n'
+ getStackTraceString(localStack ? what : tr));
sWtfHandler.onTerribleFailure(tag, what, system);
return bytes;