diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-18 18:22:17 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2019-12-25 17:07:28 +0100 |
commit | 0554c2b84130c2b557a663c9c4ea1328f8f953f8 (patch) | |
tree | e5b1e3463b207ad2e606f917e7fcf93438863440 | |
parent | c6a475dc6553dfc6836e716360f835ff8a22f68f (diff) | |
download | frameworks_base-0554c2b84130c2b557a663c9c4ea1328f8f953f8.tar.gz frameworks_base-0554c2b84130c2b557a663c9c4ea1328f8f953f8.tar.bz2 frameworks_base-0554c2b84130c2b557a663c9c4ea1328f8f953f8.zip |
check not only if we are in an emulator, but also if the device has only software rendering
Change-Id: I276865d9a7995ae99488fc9044cfdd64529fd81a
-rw-r--r-- | core/jni/android_view_DisplayListCanvas.cpp | 11 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/ImageWallpaper.java | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp index ef1e4abdf14..fedb37d8a38 100644 --- a/core/jni/android_view_DisplayListCanvas.cpp +++ b/core/jni/android_view_DisplayListCanvas.cpp @@ -222,14 +222,19 @@ 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) { - // not in the emulator + char software_rendering[PROPERTY_VALUE_MAX]; + + property_get("ro.softwaregl", software_rendering, "0"); + + if (property_get("ro.kernel.qemu", prop, NULL) == 0 && !atoi(software_rendering)) { + // not in the emulator and device has hardware acceleration return JNI_TRUE; } + // In the emulator this property will be set to 1 when hardware GLES is // enabled, 0 otherwise. On old emulator versions it will be undefined. property_get("ro.kernel.qemu.gles", prop, "0"); - return atoi(prop) == 1 ? JNI_TRUE : JNI_FALSE; + return (atoi(prop) == 1 && !atoi(software_rendering)) ? JNI_TRUE : JNI_FALSE; } // ---------------------------------------------------------------------------- diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 5a6f3c99fb4..02d5de8f0eb 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -60,6 +60,7 @@ public class ImageWallpaper extends WallpaperService { private static final String GL_LOG_TAG = "ImageWallpaperGL"; private static final boolean DEBUG = false; private static final String PROPERTY_KERNEL_QEMU = "ro.kernel.qemu"; + private static final String PROPERTY_RENDERING_SOFTWARE = "ro.softwaregl"; static final boolean FIXED_SIZED_SURFACE = true; static final boolean USE_OPENGL = true; @@ -77,7 +78,7 @@ public class ImageWallpaper extends WallpaperService { //noinspection PointlessBooleanExpression,ConstantConditions if (FIXED_SIZED_SURFACE && USE_OPENGL) { - if (!isEmulator()) { + if (!isEmulator() && !needsSoftwareRendering()) { mIsHwAccelerated = ActivityManager.isHighEndGfx(); } } @@ -94,6 +95,10 @@ public class ImageWallpaper extends WallpaperService { return "1".equals(SystemProperties.get(PROPERTY_KERNEL_QEMU, "0")); } + private static boolean needsSoftwareRendering() { + return "1".equals(SystemProperties.get(PROPERTY_RENDERING_SOFTWARE, "0")); + } + @Override public Engine onCreateEngine() { mEngine = new DrawableEngine(); |