SF: Force refresh when in single buffer mode

- Add a boolean to BufferItem to track whether single buffer mode is
  enabled. When it is, force SurfaceFlinger to acquire a new buffer
  and refresh on every vsync.

Bug 24940410

Change-Id: Iea67330c416b6fb14500865f98c67f1c12f23197
diff --git a/include/gui/BufferItem.h b/include/gui/BufferItem.h
index 504ac64..370f5d5 100644
--- a/include/gui/BufferItem.h
+++ b/include/gui/BufferItem.h
@@ -118,6 +118,13 @@
     // Describes the portion of the surface that has been modified since the
     // previous frame
     Region mSurfaceDamage;
+
+    // Indicates that the BufferQueue is in single buffer mode
+    bool mSingleBufferMode;
+
+    // Indicates that this buffer was queued by the producer. When in single
+    // buffer mode acquire() can return a BufferItem that wasn't in the queue.
+    bool mQueuedBuffer;
 };
 
 } // namespace android