OSDN Git Service

jni: Adjust for libui gralloc flags change
authorChris Forbes <chrisforbes@google.com>
Thu, 20 Apr 2017 18:58:45 +0000 (11:58 -0700)
committerChris Forbes <chrisforbes@google.com>
Tue, 25 Apr 2017 02:16:51 +0000 (02:16 +0000)
Change-Id: I94b95fba5e6234a07d2beba1d6f487842399367f
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

core/jni/Android.mk
core/jni/android_hardware_HardwareBuffer.cpp

index 96285cd..ceb3cc8 100644 (file)
@@ -234,6 +234,7 @@ LOCAL_STATIC_LIBRARIES := \
     libseccomp_policy \
     libselinux \
     libcrypto \
+    libgrallocusage \
 
 LOCAL_SHARED_LIBRARIES := \
     libmemtrack \
index ed0ab60..4b31c91 100644 (file)
@@ -34,6 +34,7 @@
 #include <private/gui/ComposerService.h>
 
 #include <hardware/gralloc1.h>
+#include <grallocusage/GrallocUsageConversion.h>
 
 #include "core_jni_helpers.h"
 
@@ -85,7 +86,7 @@ static jlong android_hardware_HardwareBuffer_create(JNIEnv* env, jobject clazz,
             &producerUsage, &consumerUsage, usage, 0);
 
     sp<GraphicBuffer> buffer = new GraphicBuffer(width, height, pixelFormat, layers,
-            producerUsage, consumerUsage,
+            android_convertGralloc1To0Usage(producerUsage, consumerUsage),
             std::string("HardwareBuffer pid [") + std::to_string(getpid()) +"]");
     status_t error = buffer->initCheck();
     if (error < 0) {