From 51e51feb3c68f9c1da6b43d69bb0ae13dc2c4144 Mon Sep 17 00:00:00 2001 From: Dmitri Plotnikov Date: Thu, 12 Dec 2019 12:37:27 -0800 Subject: [PATCH] Log outgoing blocking binder calls in system server as WTF Test: boot the system, see log entries like this: 4030 E Binder : Outgoing transactions from this process must be FLAG_ONEWAY Change-Id: Ie1b3c76ec08aecc706a5edc5a6d2b4b946895ed9 --- core/java/android/os/BinderProxy.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/BinderProxy.java b/core/java/android/os/BinderProxy.java index ee95fcee1f7a2..b0c2546e0300c 100644 --- a/core/java/android/os/BinderProxy.java +++ b/core/java/android/os/BinderProxy.java @@ -479,8 +479,14 @@ public final class BinderProxy implements IBinder { // For now, avoid spamming the log by disabling after we've logged // about this interface at least once mWarnOnBlocking = false; - Log.w(Binder.TAG, "Outgoing transactions from this process must be FLAG_ONEWAY", - new Throwable()); + if (Build.IS_USERDEBUG) { + // Log this as a WTF on userdebug builds. + Log.wtf(Binder.TAG, "Outgoing transactions from this process must be FLAG_ONEWAY", + new Throwable()); + } else { + Log.w(Binder.TAG, "Outgoing transactions from this process must be FLAG_ONEWAY", + new Throwable()); + } } final boolean tracingEnabled = Binder.isTracingEnabled();