summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2017-01-20 22:49:47 +0000
committer android-build-merger <android-build-merger@google.com> 2017-01-20 22:49:47 +0000
commitfa418b2b158cfc4c718ffbd8a64006ed9addbad4 (patch)
tree6111df8735210129e16386c50ff588042b07c809 /libs
parent8b6f035960898ecde4d28279ea3fc8f6171d93de (diff)
parent7ebfeb9d1c345b362a59973c9b12c1f045e8433a (diff)
Merge "Add Binder support for Parcelable exceptions."
am: 7ebfeb9d1c Change-Id: Ia9fe213e51fef0fe2b000ed188b943079f9c9535
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/Status.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp
index 8466863865..006f7f94e9 100644
--- a/libs/binder/Status.cpp
+++ b/libs/binder/Status.cpp
@@ -104,6 +104,16 @@ status_t Status::readFromParcel(const Parcel& parcel) {
if (mException == EX_SERVICE_SPECIFIC) {
status = parcel.readInt32(&mErrorCode);
+ } else if (mException == EX_PARCELABLE) {
+ // Skip over the blob of Parcelable data
+ const int32_t header_start = parcel.dataPosition();
+ int32_t header_size;
+ status = parcel.readInt32(&header_size);
+ if (status != OK) {
+ setFromStatusT(status);
+ return status;
+ }
+ parcel.setDataPosition(header_start + header_size);
}
if (status != OK) {
setFromStatusT(status);
@@ -127,11 +137,12 @@ status_t Status::writeToParcel(Parcel* parcel) const {
return status;
}
status = parcel->writeString16(String16(mMessage));
- if (mException != EX_SERVICE_SPECIFIC) {
- // We have no more information to write.
- return status;
+ if (mException == EX_SERVICE_SPECIFIC) {
+ status = parcel->writeInt32(mErrorCode);
+ } else if (mException == EX_PARCELABLE) {
+ // Sending Parcelable blobs currently not supported
+ status = parcel->writeInt32(0);
}
- status = parcel->writeInt32(mErrorCode);
return status;
}