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

Commit cd925408 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Add Binder support for Parcelable exceptions." am: 7ebfeb9d

am: fa418b2b

Change-Id: I59c64df526ae8ba0c07532f983a224b72b427060
parents 1fd4f885 fa418b2b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public:
        EX_NETWORK_MAIN_THREAD = -6,
        EX_UNSUPPORTED_OPERATION = -7,
        EX_SERVICE_SPECIFIC = -8,
        EX_PARCELABLE = -9,

        // This is special and Java specific; see Parcel.java.
        EX_HAS_REPLY_HEADER = -128,
+15 −4
Original line number Diff line number Diff line
@@ -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);
    }
    return status;
}