Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84e825a8 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Add hasNavigationBar() to the window manager." into ics-mr0

parents 62ade220 0c4ccff3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -224,4 +224,9 @@ interface IWindowManager
     * Block until the given window has been drawn to the screen.
     */
    void waitForWindowDrawn(IBinder token, in IRemoteCallback callback);

    /**
     * Device has a software navigation bar (separate from the status bar).
     */
    boolean hasNavigationBar();
}
+1 −2
Original line number Diff line number Diff line
@@ -292,8 +292,7 @@ public class ViewConfiguration {
        if (!sHasPermanentMenuKeySet) {
            IWindowManager wm = Display.getWindowManager();
            try {
                sHasPermanentMenuKey = wm.canStatusBarHide() && !res.getBoolean(
                        com.android.internal.R.bool.config_showNavigationBar);
                sHasPermanentMenuKey = wm.canStatusBarHide() && !wm.hasNavigationBar();
                sHasPermanentMenuKeySet = true;
            } catch (RemoteException ex) {
                sHasPermanentMenuKey = false;
+5 −0
Original line number Diff line number Diff line
@@ -1009,6 +1009,11 @@ public interface WindowManagerPolicy {
     */
    public int adjustSystemUiVisibilityLw(int visibility);

    /**
     * Specifies whether there is an on-screen navigation bar separate from the status bar.
     */
    public boolean hasNavigationBar();

    /**
     * Print the WindowManagerPolicy's state into the given stream.
     *
+3 −3
Original line number Diff line number Diff line
@@ -297,15 +297,15 @@ public class PhoneStatusBar extends StatusBar {
        mStatusBarView = sb;

        try {
            boolean showNav = res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
            boolean showNav = mWindowManager.hasNavigationBar();
            if (showNav) {
                mNavigationBarView = 
                    (NavigationBarView) View.inflate(context, R.layout.navigation_bar, null);

                mNavigationBarView.setDisabledFlags(mDisabled);
            }
        } catch (Resources.NotFoundException ex) {
            // no nav bar for you
        } catch (RemoteException ex) {
            // no window manager? good luck with that
        }

        // figure out which pixel-format to use for the status bar.
+8 −5
Original line number Diff line number Diff line
@@ -444,11 +444,14 @@ public class TabletStatusBar extends StatusBar implements

        sb.setHandler(mHandler);

        // Sanity-check that someone hasn't set up the config wrong and asked for a navigation bar
        // on a tablet that has only the system bar
        if (mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_showNavigationBar)) {
            throw new RuntimeException("Tablet device cannot show navigation bar and system bar");
        try {
            // Sanity-check that someone hasn't set up the config wrong and asked for a navigation
            // bar on a tablet that has only the system bar
            if (mWindowManager.hasNavigationBar()) {
                throw new RuntimeException(
                        "Tablet device cannot show navigation bar and system bar");
            }
        } catch (RemoteException ex) {
        }

        mBarContents = (ViewGroup) sb.findViewById(R.id.bar_contents);
Loading