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

Commit 4753bdeb authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Keep nav bar position updated

The change is to update the nav bar position variable every time when we
layout the navigation bar. This is necessary to make the nav bar color
control works correctly, and also the transient bar gesture control
works correctly.

Test: Open light themed app in landscape and enable IME, check the bar
color.
Test: landscape immersive mode app swipe from the side.
Bug: 202476380

Change-Id: I736af97326763b8ccb0afb2c82bbf25edf8d25c4
parent dde83e10
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1898,6 +1898,13 @@ public class DisplayPolicy {
     */
     */
    public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs,
    public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs,
            WindowState attached, WindowState imeTarget) {
            WindowState attached, WindowState imeTarget) {
        if (INSETS_LAYOUT_GENERALIZATION && attrs.type == TYPE_NAVIGATION_BAR) {
            // Keep mNavigationBarPosition updated to make sure the transient detection and bar
            // color control is working correctly.
            final DisplayFrames displayFrames = mDisplayContent.mDisplayFrames;
            mNavigationBarPosition = navigationBarPosition(displayFrames.mDisplayWidth,
                    displayFrames.mDisplayHeight, displayFrames.mRotation);
        }
        final boolean affectsSystemUi = win.canAffectSystemUiFlags();
        final boolean affectsSystemUi = win.canAffectSystemUiFlags();
        if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": affectsSystemUi=" + affectsSystemUi);
        if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": affectsSystemUi=" + affectsSystemUi);
        applyKeyguardPolicy(win, imeTarget);
        applyKeyguardPolicy(win, imeTarget);