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

Commit 53ab993c authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Log errors reading input channel from parcel."

parents 138fd806 02cafc9f
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -186,9 +186,21 @@ static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject
        bool isInitialized = parcel->readInt32();
        if (isInitialized) {
            String8 name = parcel->readString8();
            int32_t ashmemFd = dup(parcel->readFileDescriptor());
            int32_t receivePipeFd = dup(parcel->readFileDescriptor());
            int32_t sendPipeFd = dup(parcel->readFileDescriptor());
            int32_t parcelAshmemFd = parcel->readFileDescriptor();
            int32_t ashmemFd = dup(parcelAshmemFd);
            if (ashmemFd < 0) {
                LOGE("Error %d dup ashmem fd %d.", errno, parcelAshmemFd);
            }
            int32_t parcelReceivePipeFd = parcel->readFileDescriptor();
            int32_t receivePipeFd = dup(parcelReceivePipeFd);
            if (receivePipeFd < 0) {
                LOGE("Error %d dup receive pipe fd %d.", errno, parcelReceivePipeFd);
            }
            int32_t parcelSendPipeFd = parcel->readFileDescriptor();
            int32_t sendPipeFd = dup(parcelSendPipeFd);
            if (sendPipeFd < 0) {
                LOGE("Error %d dup send pipe fd %d.", errno, parcelSendPipeFd);
            }
            if (ashmemFd < 0 || receivePipeFd < 0 || sendPipeFd < 0) {
                if (ashmemFd >= 0) ::close(ashmemFd);
                if (receivePipeFd >= 0) ::close(receivePipeFd);