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
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 b4c480b..f716f47 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 @@
 
         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();