Ensure to switch to unprotected context if display is not secure.
Previously we only consider the switch when the display is secure,
however, it is possible that the primary display uses protected context
but virtual display is not secure and hence RenderEngine won't switch
back to unprotected context. This patch enforce the switch when display
is not secure.
Bug: b/169393573
Test: No flashing when recording Youtube DRM
Test: atest libcompositionengine_test
Change-Id: Ieeda99a92e8d78f7418f7a1e0da9938bcd4753d5
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 04dceae..b420109 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -897,6 +897,8 @@
needsProtected == renderEngine.isProtected()) {
mRenderSurface->setProtected(needsProtected);
}
+ } else if (!outputState.isSecure && renderEngine.isProtected()) {
+ renderEngine.useProtectedContext(false);
}
base::unique_fd fd;