Skip to content

Commit

Permalink
Aligning native Parcel implementation to Java.
Browse files Browse the repository at this point in the history
The Java implementation of writing the RPC response header
calculates the length of the header including the 4 bytes
specifying the header length but the native implementation
excludes the 4 bytes specifying the length from the header
length.
The native implementation has been aligned to the Java impl.

Change-Id: I325bf272a63152d8fded4cf4e51a906b5a9bfe19
  • Loading branch information
Magnus Strandberg authored and Whitehawkx committed Jun 20, 2012
1 parent 89bb3fb commit 47528ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/binder/Parcel.cpp
Expand Up @@ -1060,10 +1060,11 @@ int32_t Parcel::readExceptionCode() const
{
int32_t exception_code = readAligned<int32_t>();
if (exception_code == EX_HAS_REPLY_HEADER) {
int32_t header_start = dataPosition();
int32_t header_size = readAligned<int32_t>();
// Skip over fat responses headers. Not used (or propagated) in
// native code
setDataPosition(dataPosition() + header_size);
setDataPosition(header_start + header_size);
// And fat response headers are currently only used when there are no
// exceptions, so return no error:
return 0;
Expand Down

0 comments on commit 47528ee

Please sign in to comment.