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:
olly 2017-10-25 04:32:27 -07:00 committed by Oliver Woodman
parent 7c18baa23f
commit 88b6df1d08

View File

@ -150,14 +150,9 @@ public final class DummySurface extends Surface {
*/
@TargetApi(24)
private static boolean enableSecureDummySurfaceV24(Context context) {
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;
}
if (Util.SDK_INT == 24 && "samsung".equals(Util.MANUFACTURER)) {
// Samsung devices running API level 24 are known to be broken [Internal: b/37197802].
if (Util.SDK_INT < 26 && "samsung".equals(Util.MANUFACTURER)) {
// Samsung devices running Nougat are known to be broken. See
// https://github.com/google/ExoPlayer/issues/3373 and [Internal: b/37197802].
return false;
}
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.
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;
}