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/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0345baf..63b77af 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -667,6 +667,9 @@
renderengine::RenderEngine::USE_COLOR_MANAGEMENT : 0);
renderEngineFeature |= (useContextPriority ?
renderengine::RenderEngine::USE_HIGH_PRIORITY_CONTEXT : 0);
+ renderEngineFeature |=
+ (enable_protected_contents(false) ? renderengine::RenderEngine::ENABLE_PROTECTED_CONTEXT
+ : 0);
// TODO(b/77156734): We need to stop casting and use HAL types when possible.
// Sending maxFrameBufferAcquiredBuffers as the cache size is tightly tuned to single-display.