Skip to content

Commit 86b14cd

Browse files
Magnus Strandbergjredestig
authored andcommitted
Aligning native Parcel implementation to Java.
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
1 parent 0748a56 commit 86b14cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libs/binder/Parcel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,11 @@ int32_t Parcel::readExceptionCode() const
10471047
{
10481048
int32_t exception_code = readAligned<int32_t>();
10491049
if (exception_code == EX_HAS_REPLY_HEADER) {
1050+
int32_t header_start = dataPosition();
10501051
int32_t header_size = readAligned<int32_t>();
10511052
// Skip over fat responses headers. Not used (or propagated) in
10521053
// native code
1053-
setDataPosition(dataPosition() + header_size);
1054+
setDataPosition(header_start + header_size);
10541055
// And fat response headers are currently only used when there are no
10551056
// exceptions, so return no error:
10561057
return 0;

0 commit comments

Comments
 (0)