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

Commit c488ccb8 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "MemoryIntArray: dup in writeToParcel." into qt-dev am: 6429b70c am: 34ec95fb

am: 69c187b0

Change-Id: Icb0ab63aa1fa09bdf2f36f8c7dc99199a829e487
parents 408833db 69c187b0
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -175,12 +175,10 @@ public final class MemoryIntArray implements Parcelable, Closeable {

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
        ParcelFileDescriptor pfd = ParcelFileDescriptor.adoptFd(mFd);
        try {
            // Don't let writing to a parcel to close our fd - plz
            parcel.writeParcelable(pfd, flags & ~Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
        } finally {
            pfd.detachFd();
        try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromFd(mFd)) {
            parcel.writeParcelable(pfd, flags);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }