Pass the IGraphicBufferAlloc to SurfaceTextureClient.

This change passes a reference to the IGraphicBufferAlloc binder object
to SurfaceTextureClient objects.  When STC objects are created they
query their associated ISurfaceTexture object for the
IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers.
Having the SurfaceTextureClient hold this reference prevents the
GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers
before the SurfaceTextureClient is done with them.

Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c
related-bug: 3362519
diff --git a/include/gui/ISurfaceTexture.h b/include/gui/ISurfaceTexture.h
index 77d37f1..168310c 100644
--- a/include/gui/ISurfaceTexture.h
+++ b/include/gui/ISurfaceTexture.h
@@ -72,6 +72,12 @@
 
     virtual status_t setCrop(const Rect& reg) = 0;
     virtual status_t setTransform(uint32_t transform) = 0;
+
+    // getAllocator retrieves the binder object that must be referenced as long
+    // as the GraphicBuffers dequeued from this ISurfaceTexture are referenced.
+    // Holding this binder reference prevents SurfaceFlinger from freeing the
+    // buffers before the client is done with them.
+    virtual sp<IBinder> getAllocator() = 0;
 };
 
 // ----------------------------------------------------------------------------