Loading services/core/java/com/android/server/wm/DisplayContent.java +2 −13 Original line number Diff line number Diff line Loading @@ -134,7 +134,6 @@ import static com.android.server.wm.WindowManagerService.H.REPORT_HARD_KEYBOARD_ import static com.android.server.wm.WindowManagerService.H.WINDOW_HIDE_TIMEOUT; import static com.android.server.wm.WindowManagerService.LAYOUT_REPEAT_THRESHOLD; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_REMOVING_FOCUS; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_ASSIGN_LAYERS; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES; import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_TIMEOUT; Loading Loading @@ -450,6 +449,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Accessed directly by all users. private boolean mLayoutNeeded; int pendingLayoutChanges; boolean mLayoutAndAssignWindowLayersScheduled; /** * Used to gate application window layout until we have sent the complete configuration. Loading Loading @@ -3470,13 +3470,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } } int focusChanged = getDisplayPolicy().focusChangedLw(oldFocus, newFocus); getDisplayPolicy().focusChangedLw(oldFocus, newFocus); if (imWindowChanged && oldFocus != mInputMethodWindow) { // Focus of the input method window changed. Perform layout if needed. if (mode == UPDATE_FOCUS_PLACING_SURFACES) { performLayout(true /*initial*/, updateInputWindows); focusChanged &= ~FINISH_LAYOUT_REDO_LAYOUT; } else if (mode == UPDATE_FOCUS_WILL_PLACE_SURFACES) { // Client will do the layout, but we need to assign layers // for handleNewWindowLocked() below. Loading @@ -3484,16 +3483,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } } if ((focusChanged & FINISH_LAYOUT_REDO_LAYOUT) != 0) { // The change in focus caused us to need to do a layout. Okay. setLayoutNeeded(); if (mode == UPDATE_FOCUS_PLACING_SURFACES) { performLayout(true /*initial*/, updateInputWindows); } else if (mode == UPDATE_FOCUS_REMOVING_FOCUS) { mWmService.mRoot.performSurfacePlacement(); } } if (mode != UPDATE_FOCUS_WILL_ASSIGN_LAYERS) { // If we defer assigning layers, then the caller is responsible for doing this part. getInputMonitor().setInputFocusLw(newFocus, updateInputWindows); Loading services/core/java/com/android/server/wm/DisplayPolicy.java +10 −23 Original line number Diff line number Diff line Loading @@ -1984,11 +1984,7 @@ public class DisplayPolicy { mTopIsFullscreen = topIsFullscreen; } if (updateSystemUiVisibilityLw()) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. changes |= FINISH_LAYOUT_REDO_LAYOUT; } updateSystemBarAttributes(); if (mShowingDream != mLastShowingDream) { mLastShowingDream = mShowingDream; Loading Loading @@ -2524,18 +2520,13 @@ public class DisplayPolicy { /** * A new window has been focused. */ public int focusChangedLw(WindowState lastFocus, WindowState newFocus) { public void focusChangedLw(WindowState lastFocus, WindowState newFocus) { mFocusedWindow = newFocus; mLastFocusedWindow = lastFocus; if (mDisplayContent.isDefaultDisplay) { mService.mPolicy.onDefaultDisplayFocusChangedLw(newFocus); } if (updateSystemUiVisibilityLw()) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. return FINISH_LAYOUT_REDO_LAYOUT; } return 0; updateSystemBarAttributes(); } private void requestTransientBars(WindowState swipeTarget) { Loading Loading @@ -2611,21 +2602,18 @@ public class DisplayPolicy { return mDisplayContent.getInsetsPolicy(); } void resetSystemUiVisibilityLw() { void resetSystemBarAttributes() { mLastDisableFlags = 0; updateSystemUiVisibilityLw(); updateSystemBarAttributes(); } /** * @return {@code true} if the update may affect the layout. */ boolean updateSystemUiVisibilityLw() { void updateSystemBarAttributes() { // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return false; return; } // The immersive mode confirmation should never affect the system bar visibility, otherwise Loading @@ -2641,7 +2629,7 @@ public class DisplayPolicy { : lastFocusCanReceiveKeys ? mLastFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return false; return; } } final WindowState win = winCandidate; Loading Loading @@ -2680,7 +2668,7 @@ public class DisplayPolicy { && Objects.equals(mFocusedApp, focusedApp) && mLastFocusIsFullscreen == isFullscreen && Arrays.equals(mLastStatusBarAppearanceRegions, appearanceRegions)) { return false; return; } if (mDisplayContent.isDefaultDisplay && mLastFocusIsFullscreen != isFullscreen && ((mLastAppearance ^ appearance) & APPEARANCE_LOW_PROFILE_BARS) != 0) { Loading @@ -2698,7 +2686,6 @@ public class DisplayPolicy { callStatusBarSafely(statusBar -> statusBar.onSystemBarAttributesChanged(displayId, appearance, appearanceRegions, isNavbarColorManagedByIme, behavior, requestedVisibilities, focusedApp)); return true; } private int getStatusBarAppearance(WindowState opaque, WindowState opaqueOrDimming) { Loading Loading @@ -2970,7 +2957,7 @@ public class DisplayPolicy { return; } mPendingPanicGestureUptime = SystemClock.uptimeMillis(); updateSystemUiVisibilityLw(); updateSystemBarAttributes(); } } }; Loading services/core/java/com/android/server/wm/InsetsSourceProvider.java +5 −2 Original line number Diff line number Diff line Loading @@ -376,8 +376,11 @@ class InsetsSourceProvider { return; } mClientVisible = clientVisible; if (!mDisplayContent.mLayoutAndAssignWindowLayersScheduled) { mDisplayContent.mLayoutAndAssignWindowLayersScheduled = true; mDisplayContent.mWmService.mH.obtainMessage( LAYOUT_AND_ASSIGN_WINDOW_LAYERS_IF_NEEDED, mDisplayContent).sendToTarget(); } updateVisibility(); } Loading services/core/java/com/android/server/wm/InsetsStateController.java +1 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ class InsetsStateController { if (changed) { notifyInsetsChanged(); mDisplayContent.updateSystemGestureExclusion(); mDisplayContent.getDisplayPolicy().updateSystemUiVisibilityLw(); mDisplayContent.getDisplayPolicy().updateSystemBarAttributes(); } } Loading services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -3050,7 +3050,7 @@ public class WindowManagerService extends IWindowManager.Stub mSettingsObserver.updateSystemUiSettings(true /* handleChange */); synchronized (mGlobalLock) { // force a re-application of focused window sysui visibility on each display. mRoot.forAllDisplayPolicies(DisplayPolicy::resetSystemUiVisibilityLw); mRoot.forAllDisplayPolicies(DisplayPolicy::resetSystemBarAttributes); } } Loading Loading @@ -5292,6 +5292,7 @@ public class WindowManagerService extends IWindowManager.Stub case LAYOUT_AND_ASSIGN_WINDOW_LAYERS_IF_NEEDED: { synchronized (mGlobalLock) { final DisplayContent displayContent = (DisplayContent) msg.obj; displayContent.mLayoutAndAssignWindowLayersScheduled = false; displayContent.layoutAndAssignWindowLayersIfNeeded(); } break; Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +2 −13 Original line number Diff line number Diff line Loading @@ -134,7 +134,6 @@ import static com.android.server.wm.WindowManagerService.H.REPORT_HARD_KEYBOARD_ import static com.android.server.wm.WindowManagerService.H.WINDOW_HIDE_TIMEOUT; import static com.android.server.wm.WindowManagerService.LAYOUT_REPEAT_THRESHOLD; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_REMOVING_FOCUS; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_ASSIGN_LAYERS; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES; import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_TIMEOUT; Loading Loading @@ -450,6 +449,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Accessed directly by all users. private boolean mLayoutNeeded; int pendingLayoutChanges; boolean mLayoutAndAssignWindowLayersScheduled; /** * Used to gate application window layout until we have sent the complete configuration. Loading Loading @@ -3470,13 +3470,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } } int focusChanged = getDisplayPolicy().focusChangedLw(oldFocus, newFocus); getDisplayPolicy().focusChangedLw(oldFocus, newFocus); if (imWindowChanged && oldFocus != mInputMethodWindow) { // Focus of the input method window changed. Perform layout if needed. if (mode == UPDATE_FOCUS_PLACING_SURFACES) { performLayout(true /*initial*/, updateInputWindows); focusChanged &= ~FINISH_LAYOUT_REDO_LAYOUT; } else if (mode == UPDATE_FOCUS_WILL_PLACE_SURFACES) { // Client will do the layout, but we need to assign layers // for handleNewWindowLocked() below. Loading @@ -3484,16 +3483,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } } if ((focusChanged & FINISH_LAYOUT_REDO_LAYOUT) != 0) { // The change in focus caused us to need to do a layout. Okay. setLayoutNeeded(); if (mode == UPDATE_FOCUS_PLACING_SURFACES) { performLayout(true /*initial*/, updateInputWindows); } else if (mode == UPDATE_FOCUS_REMOVING_FOCUS) { mWmService.mRoot.performSurfacePlacement(); } } if (mode != UPDATE_FOCUS_WILL_ASSIGN_LAYERS) { // If we defer assigning layers, then the caller is responsible for doing this part. getInputMonitor().setInputFocusLw(newFocus, updateInputWindows); Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +10 −23 Original line number Diff line number Diff line Loading @@ -1984,11 +1984,7 @@ public class DisplayPolicy { mTopIsFullscreen = topIsFullscreen; } if (updateSystemUiVisibilityLw()) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. changes |= FINISH_LAYOUT_REDO_LAYOUT; } updateSystemBarAttributes(); if (mShowingDream != mLastShowingDream) { mLastShowingDream = mShowingDream; Loading Loading @@ -2524,18 +2520,13 @@ public class DisplayPolicy { /** * A new window has been focused. */ public int focusChangedLw(WindowState lastFocus, WindowState newFocus) { public void focusChangedLw(WindowState lastFocus, WindowState newFocus) { mFocusedWindow = newFocus; mLastFocusedWindow = lastFocus; if (mDisplayContent.isDefaultDisplay) { mService.mPolicy.onDefaultDisplayFocusChangedLw(newFocus); } if (updateSystemUiVisibilityLw()) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. return FINISH_LAYOUT_REDO_LAYOUT; } return 0; updateSystemBarAttributes(); } private void requestTransientBars(WindowState swipeTarget) { Loading Loading @@ -2611,21 +2602,18 @@ public class DisplayPolicy { return mDisplayContent.getInsetsPolicy(); } void resetSystemUiVisibilityLw() { void resetSystemBarAttributes() { mLastDisableFlags = 0; updateSystemUiVisibilityLw(); updateSystemBarAttributes(); } /** * @return {@code true} if the update may affect the layout. */ boolean updateSystemUiVisibilityLw() { void updateSystemBarAttributes() { // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return false; return; } // The immersive mode confirmation should never affect the system bar visibility, otherwise Loading @@ -2641,7 +2629,7 @@ public class DisplayPolicy { : lastFocusCanReceiveKeys ? mLastFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return false; return; } } final WindowState win = winCandidate; Loading Loading @@ -2680,7 +2668,7 @@ public class DisplayPolicy { && Objects.equals(mFocusedApp, focusedApp) && mLastFocusIsFullscreen == isFullscreen && Arrays.equals(mLastStatusBarAppearanceRegions, appearanceRegions)) { return false; return; } if (mDisplayContent.isDefaultDisplay && mLastFocusIsFullscreen != isFullscreen && ((mLastAppearance ^ appearance) & APPEARANCE_LOW_PROFILE_BARS) != 0) { Loading @@ -2698,7 +2686,6 @@ public class DisplayPolicy { callStatusBarSafely(statusBar -> statusBar.onSystemBarAttributesChanged(displayId, appearance, appearanceRegions, isNavbarColorManagedByIme, behavior, requestedVisibilities, focusedApp)); return true; } private int getStatusBarAppearance(WindowState opaque, WindowState opaqueOrDimming) { Loading Loading @@ -2970,7 +2957,7 @@ public class DisplayPolicy { return; } mPendingPanicGestureUptime = SystemClock.uptimeMillis(); updateSystemUiVisibilityLw(); updateSystemBarAttributes(); } } }; Loading
services/core/java/com/android/server/wm/InsetsSourceProvider.java +5 −2 Original line number Diff line number Diff line Loading @@ -376,8 +376,11 @@ class InsetsSourceProvider { return; } mClientVisible = clientVisible; if (!mDisplayContent.mLayoutAndAssignWindowLayersScheduled) { mDisplayContent.mLayoutAndAssignWindowLayersScheduled = true; mDisplayContent.mWmService.mH.obtainMessage( LAYOUT_AND_ASSIGN_WINDOW_LAYERS_IF_NEEDED, mDisplayContent).sendToTarget(); } updateVisibility(); } Loading
services/core/java/com/android/server/wm/InsetsStateController.java +1 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ class InsetsStateController { if (changed) { notifyInsetsChanged(); mDisplayContent.updateSystemGestureExclusion(); mDisplayContent.getDisplayPolicy().updateSystemUiVisibilityLw(); mDisplayContent.getDisplayPolicy().updateSystemBarAttributes(); } } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -3050,7 +3050,7 @@ public class WindowManagerService extends IWindowManager.Stub mSettingsObserver.updateSystemUiSettings(true /* handleChange */); synchronized (mGlobalLock) { // force a re-application of focused window sysui visibility on each display. mRoot.forAllDisplayPolicies(DisplayPolicy::resetSystemUiVisibilityLw); mRoot.forAllDisplayPolicies(DisplayPolicy::resetSystemBarAttributes); } } Loading Loading @@ -5292,6 +5292,7 @@ public class WindowManagerService extends IWindowManager.Stub case LAYOUT_AND_ASSIGN_WINDOW_LAYERS_IF_NEEDED: { synchronized (mGlobalLock) { final DisplayContent displayContent = (DisplayContent) msg.obj; displayContent.mLayoutAndAssignWindowLayersScheduled = false; displayContent.layoutAndAssignWindowLayersIfNeeded(); } break; Loading