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

Commit bc0009d4 authored by Chet Haase's avatar Chet Haase
Browse files

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
parent 4ee36669
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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();