Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc99b990 authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "libbinder: no 'okay' EX_TRANSACTION_FAILED" am: 18ae8b92 am: d07eabd6

am: 612146ed

Change-Id: Ie32655c7468f546f58e9b38b0a36216b412dcd24
parents e10cdb19 612146ed
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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);
}