summaryrefslogtreecommitdiff
path: root/libs/gui/Surface.cpp
diff options
context:
space:
mode:
author Eino-Ville Talvala <etalvala@google.com> 2016-09-22 15:04:04 -0700
committer Eino-Ville Talvala <etalvala@google.com> 2016-09-22 15:15:21 -0700
commit7407963cd42385ddb73d2acd1be72858d34bf242 (patch)
tree42b9f8e9943b077d2e5cc5baefd31ff77e97021d /libs/gui/Surface.cpp
parentd0974d780827ddc75a8ff41ae1e922c226f65f68 (diff)
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
Diffstat (limited to 'libs/gui/Surface.cpp')
-rw-r--r--libs/gui/Surface.cpp8
1 files changed, 6 insertions, 2 deletions
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<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);