Add ISurfaceComposer::destroyDisplay
Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
index 0606aff..5c3c99c 100644
--- a/include/gui/ISurfaceComposer.h
+++ b/include/gui/ISurfaceComposer.h
@@ -70,12 +70,17 @@
/* return an IDisplayEventConnection */
virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0;
- /* create a display
+ /* create a virtual display
* requires ACCESS_SURFACE_FLINGER permission.
*/
virtual sp<IBinder> createDisplay(const String8& displayName,
bool secure) = 0;
+ /* destroy a virtual display
+ * requires ACCESS_SURFACE_FLINGER permission.
+ */
+ virtual void destroyDisplay(const sp<IBinder>& display) = 0;
+
/* get the token for the existing default displays. possible values
* for id are eDisplayIdMain and eDisplayIdHdmi.
*/
@@ -130,6 +135,7 @@
CREATE_GRAPHIC_BUFFER_ALLOC,
CREATE_DISPLAY_EVENT_CONNECTION,
CREATE_DISPLAY,
+ DESTROY_DISPLAY,
GET_BUILT_IN_DISPLAY,
SET_TRANSACTION_STATE,
AUTHENTICATE_SURFACE,
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 643d7cf..e982bcd 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -48,7 +48,7 @@
class SurfaceComposerClient : public RefBase
{
friend class Composer;
-public:
+public:
SurfaceComposerClient();
virtual ~SurfaceComposerClient();
@@ -57,7 +57,7 @@
// Return the connection of this client
sp<IBinder> connection() const;
-
+
// Forcibly remove connection before all references have gone away.
void dispose();
@@ -86,9 +86,12 @@
uint32_t flags = 0 // usage flags
);
- //! Create a display
+ //! Create a virtual display
static sp<IBinder> createDisplay(const String8& displayName, bool secure);
+ //! Destroy a virtual display
+ static void destroyDisplay(const sp<IBinder>& display);
+
//! Get the token for the existing default displays.
//! Possible values for id are eDisplayIdMain and eDisplayIdHdmi.
static sp<IBinder> getBuiltInDisplay(int32_t id);