From 910a0681226f5f4f39084d2369bee04f3408eeea Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Sat, 5 Feb 2011 00:34:46 +0100 Subject: [PATCH] WindowManagerService: Disable screen rotation animation under emulation. Since there is no support for hardware GLES acceleration under emulation, we disable the screen rotation animation when we detect that we are in the emulator. Note that ideally, we should only disable it when we detect that GLES is implemented in software. However, I don't think there is an easy way to test for this inside of the WindowManagerService. Change-Id: Ic17719f7d0b14640bacb3b33b7b1a196006982ee --- .../java/com/android/server/WindowManagerService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 169c6d87d063e..542ccf9a3b44a 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -285,6 +285,8 @@ public class WindowManagerService extends IWindowManager.Stub final IBatteryStats mBatteryStats; + private static final boolean mInEmulator = SystemProperties.get("ro.kernel.qemu").equals("1"); + /** * All currently active sessions with clients. */ @@ -5186,7 +5188,9 @@ public class WindowManagerService extends IWindowManager.Stub public void setRotationUnchecked(int rotation, boolean alwaysSendConfiguration, int animFlags) { if(DEBUG_ORIENTATION) Slog.v(TAG, - "alwaysSendConfiguration set to "+alwaysSendConfiguration); + "setRotationUnchecked(rotation=" + rotation + + " alwaysSendConfiguration=" + alwaysSendConfiguration + + " animFlags=" + animFlags); long origId = Binder.clearCallingIdentity(); boolean changed; @@ -5257,7 +5261,9 @@ public class WindowManagerService extends IWindowManager.Stub Slog.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mInputManager.setDisplayOrientation(0, rotation); if (mDisplayEnabled) { - if (CUSTOM_SCREEN_ROTATION) { + // NOTE: We disable the rotation in the emulator because + // it doesn't support hardware OpenGL emulation yet. + if (CUSTOM_SCREEN_ROTATION && !mInEmulator) { Surface.freezeDisplay(0); if (!inTransaction) { if (SHOW_TRANSACTIONS) Slog.i(TAG,