summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Xavier Ducrohet <xav@google.com> 2011-09-27 15:47:55 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-09-27 15:47:55 -0700
commit05aa1fef932c2f2cb22ac8d75fee4ac507a32a69 (patch)
tree2f3532bf7dcc45bcb67277a6a0bdb65b0fb1bde6
parentd4fb497cf4606abf61ec690ed971523ff9d05eac (diff)
parent043a6b1e5709c46cb8094766c792ec57d3fd97df (diff)
Merge "Don't use OpenGL ES 2.0 to render the wallpaper on the emulator. Bug #5352896"
-rw-r--r--packages/SystemUI/src/com/android/systemui/ImageWallpaper.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 492f3c245349..bf1ec257856f 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -26,6 +26,7 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Region.Op;
import android.opengl.GLUtils;
+import android.os.SystemProperties;
import android.renderscript.Matrix4f;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
@@ -56,6 +57,7 @@ public class ImageWallpaper extends WallpaperService {
private static final String TAG = "ImageWallpaper";
private static final String GL_LOG_TAG = "ImageWallpaperGL";
private static final boolean DEBUG = false;
+ private static final String PROPERTY_KERNEL_QEMU = "ro.kernel.qemu";
static final boolean FIXED_SIZED_SURFACE = true;
static final boolean USE_OPENGL = true;
@@ -71,12 +73,19 @@ public class ImageWallpaper extends WallpaperService {
//noinspection PointlessBooleanExpression,ConstantConditions
if (FIXED_SIZED_SURFACE && USE_OPENGL) {
- WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
- Display display = windowManager.getDefaultDisplay();
- mIsHwAccelerated = ActivityManager.isHighEndGfx(display);
+ if (!isEmulator()) {
+ WindowManager windowManager =
+ (WindowManager) getSystemService(Context.WINDOW_SERVICE);
+ Display display = windowManager.getDefaultDisplay();
+ mIsHwAccelerated = ActivityManager.isHighEndGfx(display);
+ }
}
}
+ private static boolean isEmulator() {
+ return "1".equals(SystemProperties.get(PROPERTY_KERNEL_QEMU, "0"));
+ }
+
public Engine onCreateEngine() {
return new DrawableEngine();
}