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

Commit 8af6ba49 authored by Tiger Huang's avatar Tiger Huang
Browse files

Perform layout after removing the focused window

This change fixes a bug that navigation bar didn't show after the
hide-nav-bar window had been removed.

Bug: 81118995
Test: 1. go/wm-smoke
      2. a. Open an app which can show a window which hides nav bar.
         b. Make the app show the window which hides nav bar.
         c. Dismiss the window and see if nav bar shows.
      3. atest CtsWindowManagerDeviceTestCases:LayoutTests

Change-Id: I859b467b44bab8ea30dd5c4b03aa1673a30534fa
parent e8aad9ce
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -342,6 +342,8 @@ public class WindowManagerService extends IWindowManager.Stub
    static final int UPDATE_FOCUS_WILL_ASSIGN_LAYERS = 1;
    static final int UPDATE_FOCUS_PLACING_SURFACES = 2;
    static final int UPDATE_FOCUS_WILL_PLACE_SURFACES = 3;
    /** Indicates we are removing the focused window when updating the focus. */
    static final int UPDATE_FOCUS_REMOVING_FOCUS = 4;

    private static final String SYSTEM_SECURE = "ro.secure";
    private static final String SYSTEM_DEBUGGABLE = "ro.debuggable";
@@ -5707,6 +5709,8 @@ public class WindowManagerService extends IWindowManager.Stub
                displayContent.setLayoutNeeded();
                if (mode == UPDATE_FOCUS_PLACING_SURFACES) {
                    displayContent.performLayout(true /*initial*/, updateInputWindows);
                } else if (mode == UPDATE_FOCUS_REMOVING_FOCUS) {
                    mRoot.performSurfacePlacement(false);
                }
            }

+5 −1
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ import static com.android.server.wm.WindowManagerService.MAX_ANIMATION_DURATION;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_OFFSET;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_REMOVING_FOCUS;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_TIMEOUT;
import static com.android.server.wm.WindowManagerService.localLOGV;
@@ -2061,7 +2062,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            if (wasVisible && mService.updateOrientationFromAppTokensLocked(displayId)) {
                mService.mH.obtainMessage(SEND_NEW_CONFIGURATION, displayId).sendToTarget();
            }
            mService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/);
            mService.updateFocusedWindowLocked(mService.mCurrentFocus == this
                            ? UPDATE_FOCUS_REMOVING_FOCUS
                            : UPDATE_FOCUS_NORMAL,
                    true /*updateInputWindows*/);
        } finally {
            Binder.restoreCallingIdentity(origId);
        }