summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
authorTom Giordano <tomgiordano83@gmail.com>2012-01-24 22:51:01 +1100
committerSteve Kondik <shade@chemlab.org>2012-01-28 16:02:19 -0800
commitba55296d7575871aeac4b37d7c28fff59fd26c35 (patch)
treec763be33886b6667092dfeb5e06fadd5ee8b173e /packages/SystemUI/src/com/android
parent1f7ebf20b8d0166836fc9841c33a08b3ec75e982 (diff)
downloadframeworks_base-ba55296d7575871aeac4b37d7c28fff59fd26c35.zip
frameworks_base-ba55296d7575871aeac4b37d7c28fff59fd26c35.tar.gz
frameworks_base-ba55296d7575871aeac4b37d7c28fff59fd26c35.tar.bz2
framework: fix screenshot and rotation aimation for devices with abnormal hw rotation
Change-Id: I42694931cb1a754aa6c7652c0a96304ef1f88492
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 2232995..fdc8d02 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -348,7 +348,10 @@ class GlobalScreenshot {
// only in the natural orientation of the device :!)
mDisplay.getRealMetrics(mDisplayMetrics);
float[] dims = {mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels};
- float degrees = getDegreesForRotation(mDisplay.getRotation());
+ int rot = mDisplay.getRotation();
+ // Allow for abnormal hardware orientation
+ rot = (rot + (android.os.SystemProperties.getInt("ro.sf.hwrotation",0) / 90 )) % 4;
+ float degrees = getDegreesForRotation(rot);
boolean requiresRotation = (degrees > 0);
if (requiresRotation) {
// Get the dimensions of the device in its native orientation