Merge "Clear reply before writing exception."

This commit is contained in:
Jeff Sharkey
2011-12-15 11:51:32 -08:00
committed by Android (Google) Code Review

View File

@@ -337,13 +337,16 @@ public class Binder implements IBinder {
try {
res = onTransact(code, data, reply, flags);
} catch (RemoteException e) {
reply.setDataPosition(0);
reply.writeException(e);
res = true;
} catch (RuntimeException e) {
reply.setDataPosition(0);
reply.writeException(e);
res = true;
} catch (OutOfMemoryError e) {
RuntimeException re = new RuntimeException("Out of memory", e);
reply.setDataPosition(0);
reply.writeException(re);
res = true;
}