diff --git a/include/gui/Surface.h b/include/gui/Surface.h index 4300a0fff..a48e7e45a 100644 --- a/include/gui/Surface.h +++ b/include/gui/Surface.h @@ -57,6 +57,10 @@ public: static status_t writeToParcel(const sp& surface, Parcel* parcel); static sp readFromParcel(const Parcel& data); + bool isValid(const sp& surface) const { + return surface != NULL && surface->getIGraphicBufferProducer() != NULL; + } + // FIXME: temporary for source compatibility... sp getISurfaceTexture() const { return getIGraphicBufferProducer();