summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/LayerFE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/LayerFE.cpp')
-rw-r--r--services/surfaceflinger/LayerFE.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/services/surfaceflinger/LayerFE.cpp b/services/surfaceflinger/LayerFE.cpp
index f25619a6c0..2dbcb841ac 100644
--- a/services/surfaceflinger/LayerFE.cpp
+++ b/services/surfaceflinger/LayerFE.cpp
@@ -208,9 +208,15 @@ void LayerFE::prepareBufferStateClientComposition(
// activeBuffer, then we need to return LayerSettings.
return;
}
- const bool blackOutLayer =
- (mSnapshot->hasProtectedContent && !targetSettings.supportsProtectedContent) ||
- ((mSnapshot->isSecure || mSnapshot->hasProtectedContent) && !targetSettings.isSecure);
+ bool blackOutLayer;
+ if (FlagManager::getInstance().display_protected()) {
+ blackOutLayer = (mSnapshot->hasProtectedContent && !targetSettings.isProtected) ||
+ (mSnapshot->isSecure && !targetSettings.isSecure);
+ } else {
+ blackOutLayer = (mSnapshot->hasProtectedContent && !targetSettings.isProtected) ||
+ ((mSnapshot->isSecure || mSnapshot->hasProtectedContent) &&
+ !targetSettings.isSecure);
+ }
const bool bufferCanBeUsedAsHwTexture =
mSnapshot->externalTexture->getUsage() & GraphicBuffer::USAGE_HW_TEXTURE;
if (blackOutLayer || !bufferCanBeUsedAsHwTexture) {