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

Merge commit 'eacf0ecd00f77718ac4570077d729e33b6c320f4' into gingerbread-plus-aosp

* commit 'eacf0ecd00f77718ac4570077d729e33b6c320f4':
  Fix StrictMode for Binder.dump()
This commit is contained in:
Brad Fitzpatrick
2010-07-26 19:46:45 -07:00
committed by Android Git Automerger

View File

@@ -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();
}
}