SurfaceTexture: setConsumerIsProtected
When in a protected context, SurfaceTexture should call
setConsumerIsProtected Instead of setting consumer usage bits to
indicate the producer that the consumer can handle protected content.
Bug: 35726763
Test: videoplayer-nodrm-protected.apk and videoplayer-drm-protected.apk
both works.
Change-Id: I0028c040e727691e1e42226c0b66de075fe5515d
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index 14bad0f..9242b70 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -286,9 +286,7 @@
createProcessUniqueId()));
// If the current context is protected, inform the producer.
- if (isProtectedContext()) {
- consumer->setConsumerUsageBits(GRALLOC_USAGE_PROTECTED);
- }
+ consumer->setConsumerIsProtected(isProtectedContext());
SurfaceTexture_setSurfaceTexture(env, thiz, surfaceTexture);
SurfaceTexture_setProducer(env, thiz, producer);