mirror of
https://github.com/androidx/media.git
synced 2025-05-04 14:10:40 +08:00
Disable secure DummySurface on Samsung devices on API level 25
Issue: #3373 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173381588
This commit is contained in:
parent
7c18baa23f
commit
88b6df1d08
@ -150,14 +150,9 @@ public final class DummySurface extends Surface {
|
|||||||
*/
|
*/
|
||||||
@TargetApi(24)
|
@TargetApi(24)
|
||||||
private static boolean enableSecureDummySurfaceV24(Context context) {
|
private static boolean enableSecureDummySurfaceV24(Context context) {
|
||||||
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
if (Util.SDK_INT < 26 && "samsung".equals(Util.MANUFACTURER)) {
|
||||||
String eglExtensions = EGL14.eglQueryString(display, EGL10.EGL_EXTENSIONS);
|
// Samsung devices running Nougat are known to be broken. See
|
||||||
if (eglExtensions == null || !eglExtensions.contains("EGL_EXT_protected_content")) {
|
// https://github.com/google/ExoPlayer/issues/3373 and [Internal: b/37197802].
|
||||||
// EGL_EXT_protected_content is required to enable secure dummy surfaces.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (Util.SDK_INT == 24 && "samsung".equals(Util.MANUFACTURER)) {
|
|
||||||
// Samsung devices running API level 24 are known to be broken [Internal: b/37197802].
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Util.SDK_INT < 26 && !context.getPackageManager().hasSystemFeature(
|
if (Util.SDK_INT < 26 && !context.getPackageManager().hasSystemFeature(
|
||||||
@ -165,6 +160,12 @@ public final class DummySurface extends Surface {
|
|||||||
// Pre API level 26 devices were not well tested unless they supported VR mode.
|
// Pre API level 26 devices were not well tested unless they supported VR mode.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
|
String eglExtensions = EGL14.eglQueryString(display, EGL10.EGL_EXTENSIONS);
|
||||||
|
if (eglExtensions == null || !eglExtensions.contains("EGL_EXT_protected_content")) {
|
||||||
|
// EGL_EXT_protected_content is required to enable secure dummy surfaces.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user