Rename single buffer mode to shared buffer mode

Change-Id: Id43d0737d9367981644e498942ebc0077d61038c
(cherry picked from commit 3559fbf93801e2c0d9d8fb246fb9b867a361b464)
diff --git a/include/gui/BufferItem.h b/include/gui/BufferItem.h
index 6f45181..f45d852 100644
--- a/include/gui/BufferItem.h
+++ b/include/gui/BufferItem.h
@@ -121,10 +121,10 @@
 
     // Indicates that the consumer should acquire the next frame as soon as it
     // can and not wait for a frame to become available. This is only relevant
-    // in single buffer mode.
+    // in shared buffer mode.
     bool mAutoRefresh;
 
-    // Indicates that this buffer was queued by the producer. When in single
+    // Indicates that this buffer was queued by the producer. When in shared
     // buffer mode acquire() can return a BufferItem that wasn't in the queue.
     bool mQueuedBuffer;
 
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index 1b950ab..d232dbb 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -291,21 +291,21 @@
     // enqueue buffers without blocking.
     bool mAsyncMode;
 
-    // mSingleBufferMode indicates whether or not single buffer mode is enabled.
-    bool mSingleBufferMode;
+    // mSharedBufferMode indicates whether or not shared buffer mode is enabled.
+    bool mSharedBufferMode;
 
-    // When single buffer mode is enabled, this indicates whether the consumer
+    // When shared buffer mode is enabled, this indicates whether the consumer
     // should acquire buffers even if BufferQueue doesn't indicate that they are
     // available.
     bool mAutoRefresh;
 
-    // When single buffer mode is enabled, this tracks which slot contains the
+    // When shared buffer mode is enabled, this tracks which slot contains the
     // shared buffer.
-    int mSingleBufferSlot;
+    int mSharedBufferSlot;
 
-    // Cached data about the shared buffer in single buffer mode
-    struct SingleBufferCache {
-        SingleBufferCache(Rect _crop, uint32_t _transform, int _scalingMode,
+    // Cached data about the shared buffer in shared buffer mode
+    struct SharedBufferCache {
+        SharedBufferCache(Rect _crop, uint32_t _transform, int _scalingMode,
                 android_dataspace _dataspace)
         : crop(_crop),
           transform(_transform),
@@ -317,7 +317,7 @@
         uint32_t transform;
         uint32_t scalingMode;
         android_dataspace dataspace;
-    } mSingleBufferCache;
+    } mSharedBufferCache;
 
 }; // class BufferQueueCore
 
diff --git a/include/gui/BufferQueueProducer.h b/include/gui/BufferQueueProducer.h
index 312f323..691487d 100644
--- a/include/gui/BufferQueueProducer.h
+++ b/include/gui/BufferQueueProducer.h
@@ -173,8 +173,8 @@
     // See IGraphicBufferProducer::getNextFrameNumber
     virtual uint64_t getNextFrameNumber() const override;
 
-    // See IGraphicBufferProducer::setSingleBufferMode
-    virtual status_t setSingleBufferMode(bool singleBufferMode) override;
+    // See IGraphicBufferProducer::setSharedBufferMode
+    virtual status_t setSharedBufferMode(bool sharedBufferMode) override;
 
     // See IGraphicBufferProducer::setAutoRefresh
     virtual status_t setAutoRefresh(bool autoRefresh) override;
diff --git a/include/gui/BufferSlot.h b/include/gui/BufferSlot.h
index 943fa82..57704b1 100644
--- a/include/gui/BufferSlot.h
+++ b/include/gui/BufferSlot.h
@@ -79,7 +79,7 @@
     // transitions to FREE when releaseBuffer (or detachBuffer) is called. A
     // detached buffer can also enter the ACQUIRED state via attachBuffer.
     //
-    // SHARED indicates that this buffer is being used in single-buffer
+    // SHARED indicates that this buffer is being used in shared buffer
     // mode. It can be in any combination of the other states at the same time,
     // except for FREE (since that excludes being in any other state). It can
     // also be dequeued, queued, or acquired multiple times.
diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h
index fee7c63..32bf988 100644
--- a/include/gui/IGraphicBufferProducer.h
+++ b/include/gui/IGraphicBufferProducer.h
@@ -524,17 +524,17 @@
     // Returns the number of the next frame which will be dequeued.
     virtual uint64_t getNextFrameNumber() const = 0;
 
-    // Used to enable/disable single buffer mode.
+    // Used to enable/disable shared buffer mode.
     //
-    // When single buffer mode is enabled the first buffer that is queued or
+    // When shared buffer mode is enabled the first buffer that is queued or
     // dequeued will be cached and returned to all subsequent calls to
     // dequeueBuffer and acquireBuffer. This allows the producer and consumer to
     // simultaneously access the same buffer.
-    virtual status_t setSingleBufferMode(bool singleBufferMode) = 0;
+    virtual status_t setSharedBufferMode(bool sharedBufferMode) = 0;
 
     // Used to enable/disable auto-refresh.
     //
-    // Auto refresh has no effect outside of single buffer mode. In single
+    // Auto refresh has no effect outside of shared buffer mode. In shared
     // buffer mode, when enabled, it indicates to the consumer that it should
     // attempt to acquire buffers even if it is not aware of any being
     // available.
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index 9f51cdd..5d1d7bf 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -169,7 +169,7 @@
     int dispatchSetSidebandStream(va_list args);
     int dispatchSetBuffersDataSpace(va_list args);
     int dispatchSetSurfaceDamage(va_list args);
-    int dispatchSetSingleBufferMode(va_list args);
+    int dispatchSetSharedBufferMode(va_list args);
     int dispatchSetAutoRefresh(va_list args);
 
 protected:
@@ -199,7 +199,7 @@
 public:
     virtual int setMaxDequeuedBufferCount(int maxDequeuedBuffers);
     virtual int setAsyncMode(bool async);
-    virtual int setSingleBufferMode(bool singleBufferMode);
+    virtual int setSharedBufferMode(bool sharedBufferMode);
     virtual int setAutoRefresh(bool autoRefresh);
     virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
     virtual int unlockAndPost();
@@ -337,10 +337,10 @@
     uint32_t mGenerationNumber;
 
     // Caches the values that have been passed to the producer.
-    bool mSingleBufferMode;
+    bool mSharedBufferMode;
     bool mAutoRefresh;
 
-    // If in single buffer mode and auto refresh is enabled, store the shared
+    // If in shared buffer mode and auto refresh is enabled, store the shared
     // buffer slot and return it for all calls to queue/dequeue without going
     // over Binder.
     int mSharedBufferSlot;