Fix link-type warning on GLJNI
An sdk app GLJNI uses a native:platform library libgljni, which causes a
link-type warning. Actually libutils is the only platform library used
by libgljni, and the warning can be eliminated by rewriting code not to
use libutils and setting LOCAL_SDK_VERSION.
Bug: 73907534
Test: mma -j does not show any link-type warnings
Merged-In: Ia7e02c343f4b18c70be15f6b1c9462ee4bdca733
Change-Id: Ia7e02c343f4b18c70be15f6b1c9462ee4bdca733
diff --git a/opengl/tests/gl_jni/Android.mk b/opengl/tests/gl_jni/Android.mk
index 570ae2b..d64dfcf 100644
--- a/opengl/tests/gl_jni/Android.mk
+++ b/opengl/tests/gl_jni/Android.mk
@@ -37,13 +37,14 @@
gl_code.cpp
LOCAL_SHARED_LIBRARIES := \
- libutils \
liblog \
libEGL \
libGLESv1_CM
LOCAL_MODULE := libgljni
+LOCAL_SDK_VERSION := current
+
LOCAL_ARM_MODE := arm
diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp
index 3aa8adb..88f3228 100644
--- a/opengl/tests/gl_jni/jni/gl_code.cpp
+++ b/opengl/tests/gl_jni/jni/gl_code.cpp
@@ -2,7 +2,12 @@
#include <jni.h>
#define LOG_TAG "GLJNI gl_code.cpp"
-#include <utils/Log.h>
+#include <android/log.h>
+
+#define ALOG(priority, tag, ...) ((void)__android_log_print(ANDROID_##priority, tag, __VA_ARGS__))
+
+#define ALOGI(...) ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)
+#define ALOGE(...) ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)
#include <GLES/gl.h>