diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-26 17:47:45 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-26 17:47:45 -0700 |
commit | eb75888e6479317151c2ed44d47bd28ef567a4c7 (patch) | |
tree | a1ee2d1250d2308dd8cac1c63d825784d36507c0 /core | |
parent | 00de721859ca291d0e212a6970f0bd8b3a2f8428 (diff) | |
download | frameworks_base-eb75888e6479317151c2ed44d47bd28ef567a4c7.zip frameworks_base-eb75888e6479317151c2ed44d47bd28ef567a4c7.tar.gz frameworks_base-eb75888e6479317151c2ed44d47bd28ef567a4c7.tar.bz2 |
Fix StrictMode for Binder.dump()
Change-Id: I378f5e3d6512d06b46248b9bb6d9c727e3f6bf1d
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/os/Binder.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java index 59b8274..f8260ca 100644 --- a/core/java/android/os/Binder.java +++ b/core/java/android/os/Binder.java @@ -226,9 +226,16 @@ public class Binder implements IBinder { try { fd.close(); } catch (IOException e) { + // swallowed, not propagated back to the caller } } } + // Write the StrictMode header. + if (reply != null) { + reply.writeNoException(); + } else { + StrictMode.clearGatheredViolations(); + } return true; } return false; @@ -341,12 +348,15 @@ final class BinderProxy implements IBinder { public void dump(FileDescriptor fd, String[] args) throws RemoteException { Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); data.writeFileDescriptor(fd); data.writeStringArray(args); try { - transact(DUMP_TRANSACTION, data, null, 0); + transact(DUMP_TRANSACTION, data, reply, 0); + reply.readException(); } finally { data.recycle(); + reply.recycle(); } } |