summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/gui/Android.mk6
-rw-r--r--libs/gui/GLConsumer.cpp3
2 files changed, 8 insertions, 1 deletions
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 635020e718..6e92a471ee 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -93,6 +93,12 @@ ifeq ($(TARGET_BOARD_PLATFORM), tegra3)
LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
endif
+ifeq ($(BOARD_ENABLE_GPU_PROTECTED_CONTENT),true)
+ LOCAL_CFLAGS += -DENABLE_GPU_PROTECTED_CONTENT=true
+else
+ LOCAL_CFLAGS += -DENABLE_GPU_PROTECTED_CONTENT=false
+endif
+
include $(BUILD_SHARED_LIBRARY)
ifeq (,$(ONE_SHOT_MAKEFILE))
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index ac8bc6eee7..7a1ad46875 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -135,7 +135,8 @@ static bool hasEglProtectedContentImpl() {
bool atEnd = (cropExtLen+1) < extsLen &&
!strcmp(" " PROT_CONTENT_EXT_STR, exts + extsLen - (cropExtLen+1));
bool inMiddle = strstr(exts, " " PROT_CONTENT_EXT_STR " ");
- return equal || atStart || atEnd || inMiddle;
+ return ENABLE_GPU_PROTECTED_CONTENT &&
+ (equal || atStart || atEnd || inMiddle);
}
static bool hasEglProtectedContent() {