diff options
| author | Dmitri Plotnikov <dplotnikov@google.com> | 2020-03-05 14:48:44 -0800 |
|---|---|---|
| committer | Dmitri Plotnikov <dplotnikov@google.com> | 2020-03-06 10:23:02 -0800 |
| commit | 1258084de2b9aa47ad9b65ae076bce0333f2b188 (patch) | |
| tree | d199f7456a07b714b289a2e598ddf4fbd68be1d7 /core/java/android/os/BinderProxy.java | |
| parent | 8d6ec5d31cf434e5d25025fdc00c0698b292107d (diff) | |
Introduce thread-local allowBlocking flag
Test: see instructions in http://ag/7911739
Fixes: 146675384
Change-Id: I478f2a8c4e4d8d563e5e78f6e103a62fe120191f
Diffstat (limited to 'core/java/android/os/BinderProxy.java')
| -rw-r--r-- | core/java/android/os/BinderProxy.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/os/BinderProxy.java b/core/java/android/os/BinderProxy.java index be307ab4737d..dd3f9fdc3ec0 100644 --- a/core/java/android/os/BinderProxy.java +++ b/core/java/android/os/BinderProxy.java @@ -479,16 +479,21 @@ public final class BinderProxy implements IBinder { public boolean transact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { Binder.checkParcel(this, code, data, "Unreasonably large binder buffer"); - if (mWarnOnBlocking && ((flags & FLAG_ONEWAY) == 0)) { + if (mWarnOnBlocking && ((flags & FLAG_ONEWAY) == 0) + && Binder.sWarnOnBlockingOnCurrentThread.get()) { + // For now, avoid spamming the log by disabling after we've logged // about this interface at least once mWarnOnBlocking = false; + 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", + 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", + Log.w(Binder.TAG, + "Outgoing transactions from this process must be FLAG_ONEWAY", new Throwable()); } } |
