From 9e0017e9748e6cd1ed681f4d3aa9b888a02bfa3c Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Wed, 22 May 2024 19:02:44 +0000 Subject: Allow child layers to unset trusted overlay state 2/2 Test: presubmit Bug: 339701674 Change-Id: I1a94b5e5dc1fa64a9e1eb3330b5c5b03af8d2b16 --- libs/gui/SurfaceComposerClient.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 7aaaebbc8e..e0f1b03e26 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -2175,6 +2175,13 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAutoR SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrustedOverlay( const sp& sc, bool isTrustedOverlay) { + return setTrustedOverlay(sc, + isTrustedOverlay ? gui::TrustedOverlay::ENABLED + : gui::TrustedOverlay::UNSET); +} + +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrustedOverlay( + const sp& sc, gui::TrustedOverlay trustedOverlay) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; @@ -2182,7 +2189,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrust } s->what |= layer_state_t::eTrustedOverlayChanged; - s->isTrustedOverlay = isTrustedOverlay; + s->trustedOverlay = trustedOverlay; return *this; } -- cgit v1.2.3-59-g8ed1b