Use sysprops to control the creation of protected context.
Previously we create protected context as long as the extension exsists,
however, a lot of devices that get upgraded to Q won't have such support even
if they have this extension, and thus we add a new configuration to allow OEMs
to configure their devices based on hardware capabilities. If the property is
configured as false, then we won't create protected context.
BUG: 35315015
Test: Verify with Youtube and ExoPlayer with protected contents.
Change-Id: I3cc11081ea9457c35f2380d4361be47a03438746
diff --git a/libs/renderengine/gl/GLESRenderEngine.cpp b/libs/renderengine/gl/GLESRenderEngine.cpp
index d0127b8..b595904 100644
--- a/libs/renderengine/gl/GLESRenderEngine.cpp
+++ b/libs/renderengine/gl/GLESRenderEngine.cpp
@@ -248,7 +248,8 @@
bool useContextPriority = extensions.hasContextPriority() &&
(featureFlags & RenderEngine::USE_HIGH_PRIORITY_CONTEXT);
EGLContext protectedContext = EGL_NO_CONTEXT;
- if (extensions.hasProtectedContent()) {
+ if ((featureFlags & RenderEngine::ENABLE_PROTECTED_CONTEXT) &&
+ extensions.hasProtectedContent()) {
protectedContext = createEglContext(display, config, nullptr, useContextPriority,
Protection::PROTECTED);
ALOGE_IF(protectedContext == EGL_NO_CONTEXT, "Can't create protected context");