summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-07-25 11:59:10 +0200
committerRobert Foss <robert.foss@collabora.com>2017-08-08 10:21:24 +0200
commit1afdc3f44380fd5fde6352317743e9059da6e22d (patch)
tree4b57ef9699674f37cc724d4498677b3c08ed6231
parent8d169987be803870029633537c89676e1bf55c6f (diff)
downloadandroid-frameworks-base-1afdc3f44380fd5fde6352317743e9059da6e22d.tar.gz
android-frameworks-base-1afdc3f44380fd5fde6352317743e9059da6e22d.tar.xz
canvas: Improved Qemu property checking for hardware acceleration
Check not only if the "ro.kernel.qemu" property is set, but also interpret it being set to "0" as this not being a qemu environment. Signed-off-by: Robert Foss <robert.foss@collabora.com>
-rw-r--r--core/jni/android_view_DisplayListCanvas.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp
index d6f9db5..a5a6867 100644
--- a/core/jni/android_view_DisplayListCanvas.cpp
+++ b/core/jni/android_view_DisplayListCanvas.cpp
@@ -204,7 +204,9 @@ static void android_view_DisplayListCanvas_drawLayer(JNIEnv* env, jobject clazz,
static jboolean android_view_DisplayListCanvas_isAvailable(JNIEnv* env, jobject clazz) {
char prop[PROPERTY_VALUE_MAX];
- if (property_get("ro.kernel.qemu", prop, NULL) == 0) {
+ int prop_len = property_get("ro.kernel.qemu", prop, NULL);
+
+ if (prop_len == 0 || atoi(prop) == 0) {
// not in the emulator
return JNI_TRUE;
}