summaryrefslogtreecommitdiffstats
path: root/libs/binder
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-07-15 23:05:39 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-07-15 23:05:39 -0700
commite9f1a6478fb0f6457fe085eddaa66e3f23081c00 (patch)
tree0d739593a5d416f0fff779cae9867bd4664a25b1 /libs/binder
parent721c4162c3ad46d55ac09bf68f5922bb683d36f7 (diff)
parent64bdb3c980c6e47be4f456af5d6060416deffa0a (diff)
downloadframeworks_native-e9f1a6478fb0f6457fe085eddaa66e3f23081c00.zip
frameworks_native-e9f1a6478fb0f6457fe085eddaa66e3f23081c00.tar.gz
frameworks_native-e9f1a6478fb0f6457fe085eddaa66e3f23081c00.tar.bz2
am 3e5e21d4: am 1772c34e: Merge "StrictMode: gather and return violating stacks in Binder replies" into gingerbread
Merge commit '3e5e21d4dc74751e64d17379c5563ece39a7e35d' * commit '3e5e21d4dc74751e64d17379c5563ece39a7e35d': StrictMode: gather and return violating stacks in Binder replies
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/Parcel.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index bed893a..60babad 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -51,6 +51,9 @@
// Note: must be kept in sync with android/os/StrictMode.java's PENALTY_GATHER
#define STRICT_MODE_PENALTY_GATHER 0x100
+// Note: must be kept in sync with android/os/Parcel.java's EX_HAS_REPLY_HEADER
+#define EX_HAS_REPLY_HEADER -128
+
// XXX This can be made public if we want to provide
// support for typed data.
struct small_flat_data
@@ -959,7 +962,15 @@ wp<IBinder> Parcel::readWeakBinder() const
int32_t Parcel::readExceptionCode() const
{
int32_t exception_code = readAligned<int32_t>();
- // TODO: skip over the response header here, once that's in.
+ if (exception_code == EX_HAS_REPLY_HEADER) {
+ int32_t header_size = readAligned<int32_t>();
+ // Skip over fat responses headers. Not used (or propagated) in
+ // native code
+ setDataPosition(dataPosition() + header_size);
+ // And fat response headers are currently only used when there are no
+ // exceptions, so return no error:
+ return 0;
+ }
return exception_code;
}