Loading core/java/com/android/internal/policy/DecorView.java +4 −3 Original line number Diff line number Diff line Loading @@ -1160,16 +1160,17 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind // Note: We don't need to check for IN_SCREEN or INSET_DECOR because unlike the status bar, // these flags wouldn't make the window draw behind the navigation bar, unless // LAYOUT_HIDE_NAVIGATION was set. boolean hideNavigation = (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0; boolean forceConsumingNavBar = (mForceWindowDrawsBarBackgrounds && (attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) || mLastShouldAlwaysConsumeSystemBars; && !hideNavigation) || (mLastShouldAlwaysConsumeSystemBars && hideNavigation); boolean consumingNavBar = ((attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0 && (sysUiVisibility & SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) && !hideNavigation) || forceConsumingNavBar; // If we didn't request fullscreen layout, but we still got it because of the Loading core/res/res/values/config.xml +2 −1 Original line number Diff line number Diff line Loading @@ -3280,6 +3280,7 @@ 0 - Nav bar is always opaque when either the freeform stack or docked stack is visible. 1 - Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. 2 - Nav bar is never forced opaque. --> <integer name="config_navBarOpacityMode">0</integer> Loading packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml +9 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,15 @@ {@link Window#setEnsuringNavigationBarContrastWhenTransparent}. --> <bool name="config_navBarNeedsScrim">false</bool> <!-- Controls the opacity of the navigation bar depending on the visibility of the various workspace stacks. 0 - Nav bar is always opaque when either the freeform stack or docked stack is visible. 1 - Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. 2 - Nav bar is never forced opaque. --> <integer name="config_navBarOpacityMode">2</integer> <!-- Controls whether seamless rotation should be allowed even though the navbar can move (which normally prevents seamless rotation). --> <bool name="config_allowSeamlessRotationDespiteNavBarMoving">true</bool> Loading services/core/java/com/android/server/wm/DisplayPolicy.java +16 −4 Original line number Diff line number Diff line Loading @@ -198,6 +198,8 @@ public class DisplayPolicy { private static final int NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED = 0; // Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. private static final int NAV_BAR_TRANSLUCENT_WHEN_FREEFORM_OPAQUE_OTHERWISE = 1; // Nav bar is never forced opaque. private static final int NAV_BAR_FORCE_TRANSPARENT = 2; /** * These are the system UI flags that, when changing, can cause the layout Loading Loading @@ -3288,8 +3290,10 @@ public class DisplayPolicy { : mTopFullscreenOpaqueWindowState; vis = mStatusBarController.applyTranslucentFlagLw(fullscreenTransWin, vis, oldVis); vis = mNavigationBarController.applyTranslucentFlagLw(fullscreenTransWin, vis, oldVis); final int dockedVis = mStatusBarController.applyTranslucentFlagLw( int dockedVis = mStatusBarController.applyTranslucentFlagLw( mTopDockedOpaqueWindowState, 0, 0); dockedVis = mNavigationBarController.applyTranslucentFlagLw( mTopDockedOpaqueWindowState, dockedVis, 0); final boolean fullscreenDrawsStatusBarBackground = drawsStatusBarBackground(vis, mTopFullscreenOpaqueWindowState); Loading @@ -3297,6 +3301,8 @@ public class DisplayPolicy { drawsStatusBarBackground(dockedVis, mTopDockedOpaqueWindowState); final boolean fullscreenDrawsNavBarBackground = drawsNavigationBarBackground(vis, mTopFullscreenOpaqueWindowState); final boolean dockedDrawsNavigationBarBackground = drawsNavigationBarBackground(dockedVis, mTopDockedOpaqueWindowState); // prevent status bar interaction from clearing certain flags int type = win.getAttrs().type; Loading @@ -3321,7 +3327,7 @@ public class DisplayPolicy { } vis = configureNavBarOpacity(vis, dockedStackVisible, freeformStackVisible, resizing, fullscreenDrawsNavBarBackground); fullscreenDrawsNavBarBackground, dockedDrawsNavigationBarBackground); // update status bar boolean immersiveSticky = Loading Loading @@ -3439,8 +3445,14 @@ public class DisplayPolicy { */ private int configureNavBarOpacity(int visibility, boolean dockedStackVisible, boolean freeformStackVisible, boolean isDockedDividerResizing, boolean fullscreenDrawsBackground) { if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { boolean fullscreenDrawsBackground, boolean dockedDrawsNavigationBarBackground) { if (mNavBarOpacityMode == NAV_BAR_FORCE_TRANSPARENT) { if (fullscreenDrawsBackground && dockedDrawsNavigationBarBackground) { visibility = setNavBarTransparentFlag(visibility); } else if (dockedStackVisible) { visibility = setNavBarOpaqueFlag(visibility); } } else if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { if (dockedStackVisible || freeformStackVisible || isDockedDividerResizing) { visibility = setNavBarOpaqueFlag(visibility); } else if (fullscreenDrawsBackground) { Loading Loading
core/java/com/android/internal/policy/DecorView.java +4 −3 Original line number Diff line number Diff line Loading @@ -1160,16 +1160,17 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind // Note: We don't need to check for IN_SCREEN or INSET_DECOR because unlike the status bar, // these flags wouldn't make the window draw behind the navigation bar, unless // LAYOUT_HIDE_NAVIGATION was set. boolean hideNavigation = (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0; boolean forceConsumingNavBar = (mForceWindowDrawsBarBackgrounds && (attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) || mLastShouldAlwaysConsumeSystemBars; && !hideNavigation) || (mLastShouldAlwaysConsumeSystemBars && hideNavigation); boolean consumingNavBar = ((attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0 && (sysUiVisibility & SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) == 0 && (sysUiVisibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) && !hideNavigation) || forceConsumingNavBar; // If we didn't request fullscreen layout, but we still got it because of the Loading
core/res/res/values/config.xml +2 −1 Original line number Diff line number Diff line Loading @@ -3280,6 +3280,7 @@ 0 - Nav bar is always opaque when either the freeform stack or docked stack is visible. 1 - Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. 2 - Nav bar is never forced opaque. --> <integer name="config_navBarOpacityMode">0</integer> Loading
packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml +9 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,15 @@ {@link Window#setEnsuringNavigationBarContrastWhenTransparent}. --> <bool name="config_navBarNeedsScrim">false</bool> <!-- Controls the opacity of the navigation bar depending on the visibility of the various workspace stacks. 0 - Nav bar is always opaque when either the freeform stack or docked stack is visible. 1 - Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. 2 - Nav bar is never forced opaque. --> <integer name="config_navBarOpacityMode">2</integer> <!-- Controls whether seamless rotation should be allowed even though the navbar can move (which normally prevents seamless rotation). --> <bool name="config_allowSeamlessRotationDespiteNavBarMoving">true</bool> Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +16 −4 Original line number Diff line number Diff line Loading @@ -198,6 +198,8 @@ public class DisplayPolicy { private static final int NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED = 0; // Nav bar is always translucent when the freeform stack is visible, otherwise always opaque. private static final int NAV_BAR_TRANSLUCENT_WHEN_FREEFORM_OPAQUE_OTHERWISE = 1; // Nav bar is never forced opaque. private static final int NAV_BAR_FORCE_TRANSPARENT = 2; /** * These are the system UI flags that, when changing, can cause the layout Loading Loading @@ -3288,8 +3290,10 @@ public class DisplayPolicy { : mTopFullscreenOpaqueWindowState; vis = mStatusBarController.applyTranslucentFlagLw(fullscreenTransWin, vis, oldVis); vis = mNavigationBarController.applyTranslucentFlagLw(fullscreenTransWin, vis, oldVis); final int dockedVis = mStatusBarController.applyTranslucentFlagLw( int dockedVis = mStatusBarController.applyTranslucentFlagLw( mTopDockedOpaqueWindowState, 0, 0); dockedVis = mNavigationBarController.applyTranslucentFlagLw( mTopDockedOpaqueWindowState, dockedVis, 0); final boolean fullscreenDrawsStatusBarBackground = drawsStatusBarBackground(vis, mTopFullscreenOpaqueWindowState); Loading @@ -3297,6 +3301,8 @@ public class DisplayPolicy { drawsStatusBarBackground(dockedVis, mTopDockedOpaqueWindowState); final boolean fullscreenDrawsNavBarBackground = drawsNavigationBarBackground(vis, mTopFullscreenOpaqueWindowState); final boolean dockedDrawsNavigationBarBackground = drawsNavigationBarBackground(dockedVis, mTopDockedOpaqueWindowState); // prevent status bar interaction from clearing certain flags int type = win.getAttrs().type; Loading @@ -3321,7 +3327,7 @@ public class DisplayPolicy { } vis = configureNavBarOpacity(vis, dockedStackVisible, freeformStackVisible, resizing, fullscreenDrawsNavBarBackground); fullscreenDrawsNavBarBackground, dockedDrawsNavigationBarBackground); // update status bar boolean immersiveSticky = Loading Loading @@ -3439,8 +3445,14 @@ public class DisplayPolicy { */ private int configureNavBarOpacity(int visibility, boolean dockedStackVisible, boolean freeformStackVisible, boolean isDockedDividerResizing, boolean fullscreenDrawsBackground) { if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { boolean fullscreenDrawsBackground, boolean dockedDrawsNavigationBarBackground) { if (mNavBarOpacityMode == NAV_BAR_FORCE_TRANSPARENT) { if (fullscreenDrawsBackground && dockedDrawsNavigationBarBackground) { visibility = setNavBarTransparentFlag(visibility); } else if (dockedStackVisible) { visibility = setNavBarOpaqueFlag(visibility); } } else if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { if (dockedStackVisible || freeformStackVisible || isDockedDividerResizing) { visibility = setNavBarOpaqueFlag(visibility); } else if (fullscreenDrawsBackground) { Loading