From 1ba24574b2debd3ca012adbbd77f12bed4f2d266 Mon Sep 17 00:00:00 2001 From: Magnus Strandberg Date: Tue, 3 May 2011 15:44:00 +0200 Subject: [PATCH] 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 --- libs/binder/Parcel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index dea14bb97..4c15913a7 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1055,10 +1055,11 @@ int32_t Parcel::readExceptionCode() const { int32_t exception_code = readAligned(); if (exception_code == EX_HAS_REPLY_HEADER) { + int32_t header_start = dataPosition(); int32_t header_size = readAligned(); // 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;