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

Commit 7407963c authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Surface: Allow nullable IGBPs when unparceling a Surface

We will write a null IGBP, so we shouldn't error out when reading one;
leave semantics of that to higher-level code.

Test: No camera crash after lots of front-back camera switches
Bug: 31373143
Change-Id: I5f7cf7489aca721057c5731e3a79cf6f8f260774
parent d0974d78
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1393,14 +1393,18 @@ status_t Surface::readFromParcel(const Parcel* parcel, bool nameAlreadyRead) {
        int isSingleBuffered;
        res = parcel->readInt32(&isSingleBuffered);
        if (res != OK) {
            ALOGE("Can't read isSingleBuffered");
            return res;
        }
    }

    sp<IBinder> binder;

    res = parcel->readStrongBinder(&binder);
    if (res != OK) return res;
    res = parcel->readNullableStrongBinder(&binder);
    if (res != OK) {
        ALOGE("%s: Can't read strong binder", __FUNCTION__);
        return res;
    }

    graphicBufferProducer = interface_cast<IGraphicBufferProducer>(binder);