Add SurfaceControl::disconnect() to disconnect currently connected API
bug: 27295820
Change-Id: I6f51338bc15e018ed7899172653599ab6254c8c9
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index d10ba2f..acc8c4b 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -67,8 +67,13 @@
// consumer can run asynchronously.
enum { MAX_MAX_ACQUIRED_BUFFERS = BufferQueueDefs::NUM_BUFFER_SLOTS - 2 };
- // The default API number used to indicate that no producer is connected
- enum { NO_CONNECTED_API = 0 };
+ enum {
+ // The API number used to indicate the currently connected producer
+ CURRENTLY_CONNECTED_API = -1,
+
+ // The API number used to indicate that no producer is connected
+ NO_CONNECTED_API = 0,
+ };
typedef Vector<BufferItem> Fifo;
diff --git a/include/gui/SurfaceControl.h b/include/gui/SurfaceControl.h
index 993a92f..76ce68d 100644
--- a/include/gui/SurfaceControl.h
+++ b/include/gui/SurfaceControl.h
@@ -57,6 +57,9 @@
// release surface data from java
void clear();
+ // disconnect any api that's connected
+ void disconnect();
+
status_t setLayerStack(uint32_t layerStack);
status_t setLayer(uint32_t layer);
status_t setPosition(float x, float y);