am b5daea8a: am eacf0ecd: Merge "Fix StrictMode for Binder.dump()" into gingerbread

Merge commit 'b5daea8a9f98a7c04377e3f5ad6742add1b925d5'

* commit 'b5daea8a9f98a7c04377e3f5ad6742add1b925d5':
  Fix StrictMode for Binder.dump()
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 @@
                     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 @@
 
     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();
         }
     }