diff options
| author | 2015-11-18 16:30:45 +0000 | |
|---|---|---|
| committer | 2015-11-18 16:30:45 +0000 | |
| commit | a62a2d7629cf4ff7681912ee488585652e09b63a (patch) | |
| tree | 8c40eb918fef36cb3b06375cbf8574d2b25d9b60 /libs/binder/Parcel.cpp | |
| parent | d0711b42b757bcc4ffc2ad8a9989cf728d4bb034 (diff) | |
| parent | d3521982942874f4149ebc686be581d0ff857734 (diff) | |
Merge "libbinder: Add binder::Status type" am: babed3ea52
am: d352198294
* commit 'd3521982942874f4149ebc686be581d0ff857734':
libbinder: Add binder::Status type
Diffstat (limited to 'libs/binder/Parcel.cpp')
| -rw-r--r-- | libs/binder/Parcel.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index e2dddf0886..1b41eae631 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -23,6 +23,7 @@ #include <binder/Binder.h> #include <binder/BpBinder.h> #include <binder/ProcessState.h> +#include <binder/Status.h> #include <binder/TextOutput.h> #include <errno.h> @@ -69,9 +70,6 @@ static size_t pad_size(size_t s) { // Note: must be kept in sync with android/os/StrictMode.java's PENALTY_GATHER #define STRICT_MODE_PENALTY_GATHER (0x40 << 16) -// 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 @@ -1232,7 +1230,8 @@ restart_write: status_t Parcel::writeNoException() { - return writeInt32(0); + binder::Status status; + return status.writeToParcel(this); } void Parcel::remove(size_t /*start*/, size_t /*amt*/) @@ -1645,18 +1644,9 @@ wp<IBinder> Parcel::readWeakBinder() const 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(header_start + header_size); - // And fat response headers are currently only used when there are no - // exceptions, so return no error: - return 0; - } - return exception_code; + binder::Status status; + status.readFromParcel(*this); + return status.exceptionCode(); } native_handle* Parcel::readNativeHandle() const |