From bc0009d48df58305d3330e9716f4ebbca1e36d3d Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 8 Sep 2011 16:19:50 -0700 Subject: Throw an exception if a both nav and system bars are configured It was possible for a device to be configured to use a navigation bar (by setting config_showNavigationBar to true in a config.xml file) and to use a system bar (by being a tablet device of sufficient size). The display metrics would be set up for both, but the SystemUI would ignore the navigation bar, leading to conflict in what would be displayed and how much room there was on the display. This change throws an exception, causing SystemUI to fail, when this conflict is detected. Change-Id: Ib5c19d50ff9444bc33fd53d3dcfa016adc4872ef --- .../src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index b4c480bd39a8..f716f4763483 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -436,6 +436,13 @@ 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"); + } + mBarContents = (ViewGroup) sb.findViewById(R.id.bar_contents); // layout transitions for the status bar's contents mBarContentsLayoutTransition = new LayoutTransition(); -- cgit v1.2.3-59-g8ed1b