summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-10-11 10:12:04 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-11 10:12:04 -0700
commitd07eabd6b32097ac3129c4c1ed17099ab366e46f (patch)
treeb872f1fb8263eddb72e9f91dba487545a4d8bcc7
parentf19734044518bd9cd585c47a0133bcff14b1b5d3 (diff)
parent18ae8b92ce0df3d9764a1fdd38e1cf0cb0594f2f (diff)
downloadnative-d07eabd6b32097ac3129c4c1ed17099ab366e46f.tar.gz
Merge "libbinder: no 'okay' EX_TRANSACTION_FAILED"
am: 18ae8b92ce Change-Id: If6e16cfcfe5d432107e6817f511b28e57e2989b4
-rw-r--r--libs/binder/Status.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp
index e318a7fa09..a3f87557ab 100644
--- a/libs/binder/Status.cpp
+++ b/libs/binder/Status.cpp
@@ -24,11 +24,17 @@ Status Status::ok() {
}
Status Status::fromExceptionCode(int32_t exceptionCode) {
+ if (exceptionCode == EX_TRANSACTION_FAILED) {
+ return Status(exceptionCode, FAILED_TRANSACTION);
+ }
return Status(exceptionCode, OK);
}
Status Status::fromExceptionCode(int32_t exceptionCode,
const String8& message) {
+ if (exceptionCode == EX_TRANSACTION_FAILED) {
+ return Status(exceptionCode, FAILED_TRANSACTION, message);
+ }
return Status(exceptionCode, OK, message);
}
@@ -136,7 +142,7 @@ status_t Status::writeToParcel(Parcel* parcel) const {
// Something really bad has happened, and we're not going to even
// try returning rich error data.
if (mException == EX_TRANSACTION_FAILED) {
- return mErrorCode == OK ? FAILED_TRANSACTION : mErrorCode;
+ return mErrorCode;
}
status_t status = parcel->writeInt32(mException);
@@ -158,7 +164,7 @@ status_t Status::writeToParcel(Parcel* parcel) const {
void Status::setException(int32_t ex, const String8& message) {
mException = ex;
- mErrorCode = NO_ERROR; // an exception, not a transaction failure.
+ mErrorCode = ex == EX_TRANSACTION_FAILED ? FAILED_TRANSACTION : NO_ERROR;
mMessage.setTo(message);
}