summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-18 15:07:48 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-18 15:07:48 -0700
commit8f7c271ac9daa35708246bf279f71db5ff103b58 (patch)
treee8639805a5a8d532a879abb5565946cc80a9686f /services
parenta429d5df1aa59d817d694b96a07351224cc5d146 (diff)
downloadframeworks_base-8f7c271ac9daa35708246bf279f71db5ff103b58.zip
frameworks_base-8f7c271ac9daa35708246bf279f71db5ff103b58.tar.gz
frameworks_base-8f7c271ac9daa35708246bf279f71db5ff103b58.tar.bz2
Fix fake display size when rotated.
Change-Id: Ic8a1dbe32cf0cb3c5cdc9b9294b98e810558f875
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 26d89cd..607c60a 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -6498,8 +6498,22 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (mBaseDisplayWidth < mInitialDisplayWidth
|| mBaseDisplayHeight < mInitialDisplayHeight) {
- Rect outer = new Rect(0, 0, mInitialDisplayWidth, mInitialDisplayHeight);
- Rect inner = new Rect(0, 0, mBaseDisplayWidth, mBaseDisplayHeight);
+ int initW, initH, baseW, baseH;
+ final boolean rotated = (mRotation == Surface.ROTATION_90
+ || mRotation == Surface.ROTATION_270);
+ if (rotated) {
+ initW = mInitialDisplayHeight;
+ initH = mInitialDisplayWidth;
+ baseW = mBaseDisplayHeight;
+ baseH = mBaseDisplayWidth;
+ } else {
+ initW = mInitialDisplayWidth;
+ initH = mInitialDisplayHeight;
+ baseW = mBaseDisplayWidth;
+ baseH = mBaseDisplayHeight;
+ }
+ Rect outer = new Rect(0, 0, initW, initH);
+ Rect inner = new Rect(0, 0, baseW, baseH);
try {
mBlackFrame = new BlackFrame(mFxSession, outer, inner, MASK_LAYER);
} catch (Surface.OutOfResourcesException e) {