All consumers now take an IGraphicBufferConsumer instead of a BufferQueue

this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
diff --git a/include/gui/ConsumerBase.h b/include/gui/ConsumerBase.h
index daad757..fb21185 100644
--- a/include/gui/ConsumerBase.h
+++ b/include/gui/ConsumerBase.h
@@ -66,10 +66,6 @@
     // log messages.
     void setName(const String8& name);
 
-    // getBufferQueue returns the BufferQueue object to which this
-    // ConsumerBase is connected.
-    sp<BufferQueue> getBufferQueue() const;
-
     // dump writes the current state to a string. Child classes should add
     // their state to the dump by overriding the dumpLocked method, which is
     // called by these methods after locking the mutex.
@@ -85,12 +81,11 @@
     void operator=(const ConsumerBase&);
 
 protected:
-
     // ConsumerBase constructs a new ConsumerBase object to consume image
-    // buffers from the given BufferQueue.
+    // buffers from the given IGraphicBufferConsumer.
     // The controlledByApp flag indicates that this consumer is under the application's
     // control.
-    ConsumerBase(const sp<BufferQueue> &bufferQueue, bool controlledByApp = false);
+    ConsumerBase(const sp<IGraphicBufferConsumer>& consumer, bool controlledByApp = false);
 
     // onLastStrongRef gets called by RefBase just before the dtor of the most
     // derived class.  It is used to clean up the buffers so that ConsumerBase
@@ -104,7 +99,7 @@
     // from the derived class.
     virtual void onLastStrongRef(const void* id);
 
-    // Implementation of the BufferQueue::ConsumerListener interface.  These
+    // Implementation of the IConsumerListener interface.  These
     // calls are used to notify the ConsumerBase of asynchronous events in the
     // BufferQueue.  These methods should not need to be overridden by derived
     // classes, but if they are overridden the ConsumerBase implementation
@@ -155,7 +150,7 @@
     // initialization that must take place the first time a buffer is assigned
     // to a slot.  If it is overridden the derived class's implementation must
     // call ConsumerBase::acquireBufferLocked.
-    virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item,
+    virtual status_t acquireBufferLocked(IGraphicBufferConsumer::BufferItem *item,
         nsecs_t presentWhen);
 
     // releaseBufferLocked relinquishes control over a buffer, returning that
@@ -226,7 +221,7 @@
 
     // The ConsumerBase has-a BufferQueue and is responsible for creating this object
     // if none is supplied
-    sp<BufferQueue> mBufferQueue;
+    sp<IGraphicBufferConsumer> mConsumer;
 
     // mMutex is the mutex used to prevent concurrent access to the member
     // variables of ConsumerBase objects. It must be locked whenever the