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

Commit e8d4e999 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "No status bar for external display"

parents fa1c305d fc64c830
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ public class DisplayPolicy {
    private volatile int mDockMode = Intent.EXTRA_DOCK_STATE_UNDOCKED;
    private volatile boolean mHdmiPlugged;

    private volatile boolean mHasStatusBar;
    private volatile boolean mHasNavigationBar;
    // Can the navigation bar ever move to the side?
    private volatile boolean mNavigationBarCanMove;
@@ -523,6 +524,7 @@ public class DisplayPolicy {
        mNavigationBarCanMove = width != height && shortSizeDp < 600;

        if (mDisplayContent.isDefaultDisplay) {
            mHasStatusBar = true;
            mHasNavigationBar = mContext.getResources().getBoolean(R.bool.config_showNavigationBar);

            // Allow a system property to override this. Used by the emulator.
@@ -534,6 +536,7 @@ public class DisplayPolicy {
                mHasNavigationBar = true;
            }
        } else {
            mHasStatusBar = false;
            mHasNavigationBar = mDisplayContent.getDisplay().supportsSystemDecorations();
        }
    }
@@ -589,6 +592,10 @@ public class DisplayPolicy {
        return mHasNavigationBar;
    }

    public boolean hasStatusBar() {
        return mHasStatusBar;
    }

    public boolean navigationBarCanMove() {
        return mNavigationBarCanMove;
    }
@@ -2493,12 +2500,19 @@ public class DisplayPolicy {
        final int landscapeRotation = displayRotation.getLandscapeRotation();
        final int seascapeRotation = displayRotation.getSeascapeRotation();

        if (hasStatusBar()) {
            mStatusBarHeightForRotation[portraitRotation] =
                    mStatusBarHeightForRotation[upsideDownRotation] =
                            res.getDimensionPixelSize(R.dimen.status_bar_height_portrait);
            mStatusBarHeightForRotation[landscapeRotation] =
                    mStatusBarHeightForRotation[seascapeRotation] =
                            res.getDimensionPixelSize(R.dimen.status_bar_height_landscape);
        } else {
            mStatusBarHeightForRotation[portraitRotation] =
                    mStatusBarHeightForRotation[upsideDownRotation] =
                            mStatusBarHeightForRotation[landscapeRotation] =
                                    mStatusBarHeightForRotation[seascapeRotation] = 0;
        }

        // Height of the navigation bar when presented horizontally at bottom
        mNavigationBarHeightForRotationDefault[portraitRotation] =
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class DisplayPolicyTestsBase extends WindowTestsBase {
        resources.addOverride(R.dimen.navigation_bar_width, NAV_BAR_HEIGHT);
        when(mDisplayPolicy.getSystemUiContext()).thenReturn(context);
        when(mDisplayPolicy.hasNavigationBar()).thenReturn(true);
        when(mDisplayPolicy.hasStatusBar()).thenReturn(true);

        final int shortSizeDp =
                Math.min(DISPLAY_WIDTH, DISPLAY_HEIGHT) * DENSITY_DEFAULT / DISPLAY_DENSITY;