Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a12899eb authored by Craig Donner's avatar Craig Donner Committed by android-build-merger
Browse files

Merge "Minor changes needed to support EXT_protected_content." into nyc-dev

am: 08a26ee1

* commit '08a26ee1':
  Minor changes needed to support EXT_protected_content.

Change-Id: I5813c2288298a7c66456dbd847c0d7aa8b06f9d4
parents 7d7a075e 08a26ee1
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@

// ----------------------------------------------------------------------------

#define EGL_QCOM_PROTECTED_CONTENT 0x32E0
#define EGL_PROTECTED_CONTENT_EXT 0x32C0

namespace android {

@@ -64,19 +64,12 @@ static bool isProtectedContext() {
    EGLDisplay dpy = eglGetCurrentDisplay();
    EGLContext ctx = eglGetCurrentContext();

    if (dpy == EGL_NO_DISPLAY) {
        ALOGI("isProtectedSurface: invalid current EGLDisplay");
        return false;
    }

    if (ctx == EGL_NO_CONTEXT) {
        ALOGI("isProtectedSurface: invalid current EGLContext");
    if (dpy == EGL_NO_DISPLAY || ctx == EGL_NO_CONTEXT) {
        return false;
    }

    EGLint isProtected = EGL_FALSE;
    // TODO: Change the enum value below when an extension is ratified.
    eglQueryContext(dpy, ctx, EGL_QCOM_PROTECTED_CONTENT, &isProtected);
    eglQueryContext(dpy, ctx, EGL_PROTECTED_CONTENT_EXT, &isProtected);

    return isProtected;
}