From 7407963cd42385ddb73d2acd1be72858d34bf242 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 22 Sep 2016 15:04:04 -0700 Subject: 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 --- libs/gui/Surface.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index ab223ffd4b..a0a742c13f 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -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 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(binder); -- cgit v1.2.3-59-g8ed1b