Loading core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -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(); } core/java/android/view/ViewConfiguration.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading core/java/android/view/WindowManagerPolicy.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. * Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −3 Original line number Diff line number Diff line Loading @@ -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. Loading packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +8 −5 Original line number Diff line number Diff line Loading @@ -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 Loading
core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -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(); }
core/java/android/view/ViewConfiguration.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
core/java/android/view/WindowManagerPolicy.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. * Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −3 Original line number Diff line number Diff line Loading @@ -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. Loading
packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +8 −5 Original line number Diff line number Diff line Loading @@ -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