Merge "Read leftover parcel data when a parceled Surface is found in the cache."

This commit is contained in:
Mathias Agopian
2011-08-10 19:45:33 -07:00
committed by Android (Google) Code Review

View File

@@ -277,6 +277,11 @@ sp<Surface> Surface::readFromParcel(const Parcel& data) {
if (surface == 0) {
surface = new Surface(data, binder);
sCachedSurfaces.add(binder, surface);
} else {
// The Surface was found in the cache, but we still should clear any
// remaining data from the parcel.
data.readStrongBinder(); // ISurfaceTexture
data.readInt32(); // identity
}
if (surface->mSurface == NULL && surface->getISurfaceTexture() == NULL) {
surface = 0;