summaryrefslogtreecommitdiffstats
path: root/policy/src/com
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-04-09 16:27:07 -0700
committerDianne Hackborn <hackbod@google.com>2012-04-09 16:27:07 -0700
commit077ee853171f0ad72209a59a80e526bd1387fc76 (patch)
tree35752d965082626ba84b41dda7537e3450d85bc5 /policy/src/com
parent283be258696d9043ced4003872e0cfe109c4de66 (diff)
downloadframeworks_base-077ee853171f0ad72209a59a80e526bd1387fc76.zip
frameworks_base-077ee853171f0ad72209a59a80e526bd1387fc76.tar.gz
frameworks_base-077ee853171f0ad72209a59a80e526bd1387fc76.tar.bz2
Fix issue #6309296: Framework returns Configuration.SCREENLAYOUT_SIZE_LARGE for Xoom
Change-Id: I5882e6f6ab249232b69bdc4b8e692716f2fe5efa
Diffstat (limited to 'policy/src/com')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java41
1 files changed, 27 insertions, 14 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 5697284..f3622ef 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1340,18 +1340,29 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation) {
- // Assumes that the navigation bar appears on the side of the display in landscape.
- if (mHasNavigationBar && fullWidth > fullHeight) {
- return fullWidth - mNavigationBarWidth;
+ if (mHasNavigationBar) {
+ // For a basic navigation bar, when we are in landscape mode we place
+ // the navigation bar to the side.
+ if (fullWidth > fullHeight) {
+ return fullWidth - mNavigationBarWidth;
+ }
}
return fullWidth;
}
public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation) {
- // Assumes the navigation bar appears on the bottom of the display in portrait.
- return fullHeight
- - (mHasSystemNavBar ? mNavigationBarHeight : 0)
- - ((mHasNavigationBar && fullWidth > fullHeight) ? 0 : mNavigationBarHeight);
+ if (mHasSystemNavBar) {
+ // For the system navigation bar, we always place it at the bottom.
+ return fullHeight - mNavigationBarHeight;
+ }
+ if (mHasNavigationBar) {
+ // For a basic navigation bar, when we are in portrait mode we place
+ // the navigation bar to the bottom.
+ if (fullWidth < fullHeight) {
+ return fullHeight - mNavigationBarHeight;
+ }
+ }
+ return fullHeight;
}
public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation) {
@@ -1359,13 +1370,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation) {
- // This is the same as getNonDecorDisplayHeight, unless the status bar
- // can hide. If the status bar can hide, we don't count that as part
- // of the decor; however for purposes of configurations, we do want to
- // exclude it since applications can't generally use that part of the
- // screen.
- return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation)
- - (mHasSystemNavBar ? 0 : mStatusBarHeight);
+ // If we don't have a system nav bar, then there is a separate status
+ // bar at the top of the display. We don't count that as part of the
+ // fixed decor, since it can hide; however, for purposes of configurations,
+ // we do want to exclude it since applications can't generally use that part
+ // of the screen.
+ if (!mHasSystemNavBar) {
+ return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation) - mStatusBarHeight;
+ }
+ return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation);
}
public boolean doesForceHide(WindowState win, WindowManager.LayoutParams attrs) {