From 7e377b4c03b99d59edb919298574ca7a7053ac66 Mon Sep 17 00:00:00 2001 From: kallt_kaffe Date: Thu, 26 Jan 2012 13:03:52 +0100 Subject: Rotation animation, fix for devices with ro.sf.hwrotation set to something other than 0. Tested on ZTE V9 which has ro.sf.hwrotation set to 270. See http://review.cyanogenmod.com/#change,11974 for more info about the animation and the issues experienced on rotated displays. Change-Id: Ia0d08434d6c1fd8ee6aab46c2c53950e2298436d --- services/java/com/android/server/ScreenRotationAnimation.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java index 1cc6a2a..4290b89 100644 --- a/services/java/com/android/server/ScreenRotationAnimation.java +++ b/services/java/com/android/server/ScreenRotationAnimation.java @@ -68,8 +68,9 @@ class ScreenRotationAnimation { Bitmap screenshot = Surface.screenshot(0, 0); if (screenshot != null) { - // Screenshot does NOT include rotation! - mSnapshotRotation = 0; + // Screenshot does NOT include rotation but we need to consider ro.sf.hwrotation! + mSnapshotRotation = ( + (4 - android.os.SystemProperties.getInt("ro.sf.hwrotation",0) / 90) % 4); mWidth = screenshot.getWidth(); mHeight = screenshot.getHeight(); } else { -- cgit v1.1