diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-05-26 00:55:58 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-05-26 10:46:19 -0700 |
commit | 81e56d535c853d73ff537357da5b935f51cb779d (patch) | |
tree | b0d69765bbefecbdeeadebc24b7e57f902af84b9 /services | |
parent | 42f8094c066209a65b09d53611ef5c93daba4c51 (diff) | |
download | frameworks_base-81e56d535c853d73ff537357da5b935f51cb779d.zip frameworks_base-81e56d535c853d73ff537357da5b935f51cb779d.tar.gz frameworks_base-81e56d535c853d73ff537357da5b935f51cb779d.tar.bz2 |
Rework how we decide whether to use system or status bar.
The PhoneWindowManager is now responsible for determing this,
since it needs to do this before we can generate the configuration
since we need to take into account the system bar size we will use.
Also the Display should now report the screen height without
including the system bar.
Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 31977e4..9c98296 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -408,6 +408,8 @@ public class WindowManagerService extends IWindowManager.Stub int mBaseDisplayHeight = 0; int mCurDisplayWidth = 0; int mCurDisplayHeight = 0; + int mAppDisplayWidth = 0; + int mAppDisplayHeight = 0; int mRotation = 0; int mRequestedRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; @@ -1433,8 +1435,8 @@ public class WindowManagerService extends IWindowManager.Stub int adjustWallpaperWindowsLocked() { int changed = 0; - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; // First find top-most window that has asked to be on top of the // wallpaper; all wallpapers go behind it. @@ -1852,8 +1854,8 @@ public class WindowManagerService extends IWindowManager.Stub } boolean updateWallpaperOffsetLocked(WindowState changingTarget, boolean sync) { - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; boolean changed = false; @@ -1893,8 +1895,8 @@ public class WindowManagerService extends IWindowManager.Stub void updateWallpaperVisibilityLocked() { final boolean visible = isWallpaperVisible(mWallpaperTarget); - final int dw = mCurDisplayWidth; - final int dh = mCurDisplayHeight; + final int dw = mAppDisplayWidth; + final int dh = mAppDisplayHeight; int curTokenIndex = mWallpaperTokens.size(); while (curTokenIndex > 0) { @@ -2701,7 +2703,7 @@ public class WindowManagerService extends IWindowManager.Stub configChanged = updateOrientationFromAppTokensLocked(false); performLayoutAndPlaceSurfacesLocked(); if (displayed && win.mIsWallpaper) { - updateWallpaperOffsetLocked(win, mCurDisplayWidth, mCurDisplayHeight, false); + updateWallpaperOffsetLocked(win, mAppDisplayWidth, mAppDisplayHeight, false); } if (win.mAppToken != null) { win.mAppToken.updateReportedVisibilityLocked(); @@ -4779,8 +4781,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { long ident = Binder.clearCallingIdentity(); - dw = mPolicy.getNonDecorDisplayWidth(mRotation, mCurDisplayWidth); - dh = mPolicy.getNonDecorDisplayHeight(mRotation, mCurDisplayHeight); + dw = mAppDisplayWidth; + dh = mAppDisplayHeight; int aboveAppLayer = mPolicy.windowTypeToLayerLw( WindowManager.LayoutParams.TYPE_APPLICATION) * TYPE_LAYER_MULTIPLIER @@ -5555,10 +5557,10 @@ public class WindowManagerService extends IWindowManager.Stub // Override display width and height with what we are computing, // to be sure they remain consistent. - dm.widthPixels = dm.realWidthPixels = mPolicy.getNonDecorDisplayWidth( - mRotation, dw); - dm.heightPixels = dm.realHeightPixels = mPolicy.getNonDecorDisplayHeight( - mRotation, dh); + dm.widthPixels = dm.unscaledWidthPixels = mAppDisplayWidth + = mPolicy.getNonDecorDisplayWidth(mRotation, dw); + dm.heightPixels = dm.unscaledHeightPixels = mAppDisplayHeight + = mPolicy.getNonDecorDisplayHeight(mRotation, dh); mCompatibleScreenScale = CompatibilityInfo.updateCompatibleScreenFrame( dm, mCompatibleScreenFrame, null); @@ -5986,8 +5988,8 @@ public class WindowManagerService extends IWindowManager.Stub mInitialDisplayWidth = mInitialDisplayHeight; mInitialDisplayHeight = tmp; } - mBaseDisplayWidth = mCurDisplayWidth = mInitialDisplayWidth; - mBaseDisplayHeight = mCurDisplayHeight = mInitialDisplayHeight; + mBaseDisplayWidth = mCurDisplayWidth = mAppDisplayWidth = mInitialDisplayWidth; + mBaseDisplayHeight = mCurDisplayHeight = mAppDisplayHeight = mInitialDisplayHeight; mInputManager.setDisplaySize(0, mDisplay.getRawWidth(), mDisplay.getRawHeight()); mPolicy.setInitialDisplaySize(mInitialDisplayWidth, mInitialDisplayHeight); } @@ -6489,8 +6491,8 @@ public class WindowManagerService extends IWindowManager.Stub public void getDisplaySize(Point size) { synchronized(mWindowMap) { - size.x = mCurDisplayWidth; - size.y = mCurDisplayHeight; + size.x = mAppDisplayWidth; + size.y = mAppDisplayHeight; } } @@ -6622,6 +6624,10 @@ public class WindowManagerService extends IWindowManager.Stub } } + public boolean canStatusBarHide() { + return mPolicy.canStatusBarHide(); + } + // ------------------------------------------------------------- // Internals // ------------------------------------------------------------- @@ -6986,9 +6992,8 @@ public class WindowManagerService extends IWindowManager.Stub final long currentTime = SystemClock.uptimeMillis(); final int dw = mCurDisplayWidth; final int dh = mCurDisplayHeight; - - final int innerDw = mPolicy.getNonDecorDisplayWidth(mRotation, dw); - final int innerDh = mPolicy.getNonDecorDisplayHeight(mRotation, dh); + final int innerDw = mAppDisplayWidth; + final int innerDh = mAppDisplayHeight; int i; @@ -8960,6 +8965,8 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(mBaseDisplayWidth); pw.print("x"); pw.print(mBaseDisplayHeight); pw.print(" cur="); pw.print(mCurDisplayWidth); pw.print("x"); pw.print(mCurDisplayHeight); + pw.print(" app="); + pw.print(mAppDisplayWidth); pw.print("x"); pw.print(mAppDisplayHeight); pw.print(" real="); pw.print(mDisplay.getRealWidth()); pw.print("x"); pw.print(mDisplay.getRealHeight()); pw.print(" raw="); pw.print(mDisplay.getRawWidth()); |