Merge changes from topic "b116618418"
am: 002fa789e6
Change-Id: I60b0e19bad15682fbfbc7f67c402baee7fb91f19
diff --git a/base/Status.cpp b/base/Status.cpp
index 7161bc0..5a4c918 100644
--- a/base/Status.cpp
+++ b/base/Status.cpp
@@ -82,11 +82,17 @@
}
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 char *message) {
+ if (exceptionCode == EX_TRANSACTION_FAILED) {
+ return Status(exceptionCode, FAILED_TRANSACTION, message);
+ }
return Status(exceptionCode, OK, message);
}
@@ -107,7 +113,7 @@
void Status::setException(int32_t ex, const char *message) {
mException = ex;
- mErrorCode = NO_ERROR; // an exception, not a transaction failure.
+ mErrorCode = ex == EX_TRANSACTION_FAILED ? FAILED_TRANSACTION : NO_ERROR;
mMessage = message;
}
diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp
index b9d2d19..caf7cf8 100644
--- a/transport/HidlBinderSupport.cpp
+++ b/transport/HidlBinderSupport.cpp
@@ -223,8 +223,7 @@
// Something really bad has happened, and we're not going to even
// try returning rich error data.
if (s.exceptionCode() == Status::EX_TRANSACTION_FAILED) {
- status_t status = s.transactionError();
- return status == OK ? FAILED_TRANSACTION : status;
+ return s.transactionError();
}
status_t status = parcel->writeInt32(s.exceptionCode());