diff options
7 files changed, 18 insertions, 74 deletions
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index ad3082e..0289407 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -71,9 +71,6 @@ interface IWindowManager void setOverscan(int displayId, int left, int top, int right, int bottom); - // Is the device configured to have a full system bar for larger screens? - boolean hasSystemNavBar(); - // These can only be called when holding the MANAGE_APP_TOKENS permission. void pauseKeyDispatching(IBinder token); void resumeKeyDispatching(IBinder token); diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 499075e..f8cb9c0 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -291,7 +291,7 @@ public class ViewConfiguration { if (!sHasPermanentMenuKeySet) { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); try { - sHasPermanentMenuKey = !wm.hasSystemNavBar() && !wm.hasNavigationBar(); + sHasPermanentMenuKey = !wm.hasNavigationBar(); sHasPermanentMenuKeySet = true; } catch (RemoteException ex) { sHasPermanentMenuKey = false; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index c735dd7..c26482b 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -578,12 +578,6 @@ public interface WindowManagerPolicy { public int getAboveUniverseLayer(); /** - * Return true if the policy desires a full unified system nav bar. Otherwise, - * it is a phone-style status bar with optional nav bar. - */ - public boolean hasSystemNavBar(); - - /** * Return the display width available after excluding any screen * decorations that can never be removed. That is, system bar or * button bar. diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 4930d59..56d0ec0 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -230,7 +230,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mHeadless; boolean mSafeMode; WindowState mStatusBar = null; - boolean mHasSystemNavBar; int mStatusBarHeight; WindowState mNavigationBar = null; boolean mHasNavigationBar = false; @@ -1046,43 +1045,22 @@ public class PhoneWindowManager implements WindowManagerPolicy { int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / density; if (shortSizeDp < 600) { - // 0-599dp: "phone" UI with a separate status & navigation bar - mHasSystemNavBar = false; + // Allow the navigation bar to move on small devices (phones). mNavigationBarCanMove = true; - } else if (shortSizeDp < 720) { - // 600+dp: "phone" UI with modifications for larger screens - mHasSystemNavBar = false; - mNavigationBarCanMove = false; - } - - if (!mHasSystemNavBar) { - mHasNavigationBar = mContext.getResources().getBoolean( - com.android.internal.R.bool.config_showNavigationBar); - // Allow a system property to override this. Used by the emulator. - // See also hasNavigationBar(). - String navBarOverride = SystemProperties.get("qemu.hw.mainkeys"); - if (! "".equals(navBarOverride)) { - if (navBarOverride.equals("1")) mHasNavigationBar = false; - else if (navBarOverride.equals("0")) mHasNavigationBar = true; - } - } else { + } + + mHasNavigationBar = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_showNavigationBar); + // Allow a system property to override this. Used by the emulator. + // See also hasNavigationBar(). + String navBarOverride = SystemProperties.get("qemu.hw.mainkeys"); + if ("1".equals(navBarOverride)) { mHasNavigationBar = false; + } else if ("0".equals(navBarOverride)) { + mHasNavigationBar = true; } - if (mHasSystemNavBar) { - // The system bar is always at the bottom. If you are watching - // a video in landscape, we don't need to hide it if we can still - // show a 16:9 aspect ratio with it. - int longSizeDp = longSize * DisplayMetrics.DENSITY_DEFAULT / density; - int barHeightDp = mNavigationBarHeightForRotation[mLandscapeRotation] - * DisplayMetrics.DENSITY_DEFAULT / density; - int aspect = ((shortSizeDp-barHeightDp) * 16) / longSizeDp; - // We have computed the aspect ratio with the bar height taken - // out to be 16:aspect. If this is less than 9, then hiding - // the navigation bar will provide more useful space for wide - // screen movies. - mCanHideNavigationBar = aspect < 9; - } else if (mHasNavigationBar) { + if (mHasNavigationBar) { // The navigation bar is at the right in landscape; it seems always // useful to hide it for showing a video. mCanHideNavigationBar = true; @@ -1496,10 +1474,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { return windowTypeToLayerLw(TYPE_SYSTEM_ERROR); } - public boolean hasSystemNavBar() { - return mHasSystemNavBar; - } - public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation) { if (mHasNavigationBar) { // For a basic navigation bar, when we are in landscape mode we place @@ -1512,10 +1486,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { } public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation) { - if (mHasSystemNavBar) { - // For the system navigation bar, we always place it at the bottom. - return fullHeight - mNavigationBarHeightForRotation[rotation]; - } if (mHasNavigationBar) { // For a basic navigation bar, when we are in portrait mode we place // the navigation bar to the bottom. @@ -1531,15 +1501,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { } public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation) { - // 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, + // 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); + return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation) - mStatusBarHeight; } @Override diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 079134b..92ce102 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -7782,11 +7782,6 @@ public class WindowManagerService extends IWindowManager.Stub } } - @Override - public boolean hasSystemNavBar() { - return mPolicy.hasSystemNavBar(); - } - // ------------------------------------------------------------- // Internals // ------------------------------------------------------------- diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java index a7b48bb..6343049 100644 --- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java +++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java @@ -49,15 +49,13 @@ public class IWindowManagerImpl implements IWindowManager { private final Configuration mConfig; private final DisplayMetrics mMetrics; private final int mRotation; - private final boolean mHasSystemNavBar; private final boolean mHasNavigationBar; public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation, - boolean hasSystemNavBar, boolean hasNavigationBar) { + boolean hasNavigationBar) { mConfig = config; mMetrics = metrics; mRotation = rotation; - mHasSystemNavBar = hasSystemNavBar; mHasNavigationBar = hasNavigationBar; } @@ -79,11 +77,6 @@ public class IWindowManagerImpl implements IWindowManager { return mHasNavigationBar; } - @Override - public boolean hasSystemNavBar() throws RemoteException { - return mHasSystemNavBar; - } - // ---- unused implementation of IWindowManager ---- @Override diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index c14af4a..6011fdb 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -192,11 +192,10 @@ public class RenderSessionImpl extends RenderAction<SessionParams> { findNavigationBar(resources, metrics); // FIXME: find those out, and possibly add them to the render params - boolean hasSystemNavBar = true; boolean hasNavigationBar = true; IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), metrics, Surface.ROTATION_0, - hasSystemNavBar, hasNavigationBar); + hasNavigationBar); WindowManagerGlobal_Delegate.setWindowManagerService(iwm); // build the inflater and parser. |