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

Commit e92179d6 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Refactoring: create method for marking display as needing layout.

Change-Id: Ib040d053bf5011587d4383e89c6206a783387b72
parent c8433b60
Loading
Loading
Loading
Loading
+8 −32
Original line number Original line Diff line number Diff line
@@ -2174,10 +2174,7 @@ public class WindowManagerService extends IWindowManager.Stub
                // The exit animation is running... wait for it!
                // The exit animation is running... wait for it!
                win.mExiting = true;
                win.mExiting = true;
                win.mRemoveOnExit = true;
                win.mRemoveOnExit = true;
                final DisplayContent displayContent = win.getDisplayContent();
                win.setDisplayLayoutNeeded();
                if (displayContent != null) {
                    displayContent.layoutNeeded = true;
                }
                final boolean focusChanged = updateFocusedWindowLocked(
                final boolean focusChanged = updateFocusedWindowLocked(
                        UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/);
                        UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/);
                mWindowPlacerLocked.performSurfacePlacement();
                mWindowPlacerLocked.performSurfacePlacement();
@@ -2300,10 +2297,7 @@ public class WindowManagerService extends IWindowManager.Stub
            windows.remove(win);
            windows.remove(win);
            if (!mWindowPlacerLocked.isInLayout()) {
            if (!mWindowPlacerLocked.isInLayout()) {
                assignLayersLocked(windows);
                assignLayersLocked(windows);
                final DisplayContent displayContent = win.getDisplayContent();
                win.setDisplayLayoutNeeded();
                if (displayContent != null) {
                    displayContent.layoutNeeded = true;
                }
                if (performLayout) {
                if (performLayout) {
                    mWindowPlacerLocked.performSurfacePlacement();
                    mWindowPlacerLocked.performSurfacePlacement();
                }
                }
@@ -2385,10 +2379,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        w.mGivenVisibleInsets.scale(w.mGlobalScale);
                        w.mGivenVisibleInsets.scale(w.mGlobalScale);
                        w.mGivenTouchableRegion.scale(w.mGlobalScale);
                        w.mGivenTouchableRegion.scale(w.mGlobalScale);
                    }
                    }
                    final DisplayContent displayContent = w.getDisplayContent();
                    w.setDisplayLayoutNeeded();
                    if (displayContent != null) {
                        displayContent.layoutNeeded = true;
                    }
                    mWindowPlacerLocked.performSurfacePlacement();
                    mWindowPlacerLocked.performSurfacePlacement();
                }
                }
            }
            }
@@ -2730,10 +2721,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
                        WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
            }
            }


            final DisplayContent displayContent = win.getDisplayContent();
            win.setDisplayLayoutNeeded();
            if (displayContent != null) {
                displayContent.layoutNeeded = true;
            }
            win.mGivenInsetsPending = (flags&WindowManagerGlobal.RELAYOUT_INSETS_PENDING) != 0;
            win.mGivenInsetsPending = (flags&WindowManagerGlobal.RELAYOUT_INSETS_PENDING) != 0;
            configChanged = updateOrientationFromAppTokensLocked(false);
            configChanged = updateOrientationFromAppTokensLocked(false);
            mWindowPlacerLocked.performSurfacePlacement();
            mWindowPlacerLocked.performSurfacePlacement();
@@ -2826,10 +2814,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        getDefaultDisplayContentLocked().pendingLayoutChanges |=
                        getDefaultDisplayContentLocked().pendingLayoutChanges |=
                                WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
                                WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
                    }
                    }
                    final DisplayContent displayContent = win.getDisplayContent();
                    win.setDisplayLayoutNeeded();
                    if (displayContent != null) {
                        displayContent.layoutNeeded = true;
                    }
                    mWindowPlacerLocked.requestTraversal();
                    mWindowPlacerLocked.requestTraversal();
                }
                }
            }
            }
@@ -3950,10 +3935,7 @@ public class WindowManagerService extends IWindowManager.Stub
                            }
                            }
                        }
                        }
                        changed = true;
                        changed = true;
                        final DisplayContent displayContent = win.getDisplayContent();
                        win.setDisplayLayoutNeeded();
                        if (displayContent != null) {
                            displayContent.layoutNeeded = true;
                        }
                    }
                    }
                } else if (win.isVisibleNow()) {
                } else if (win.isVisibleNow()) {
                    if (!runningAppAnimation) {
                    if (!runningAppAnimation) {
@@ -3967,10 +3949,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        }
                        }
                    }
                    }
                    changed = true;
                    changed = true;
                    final DisplayContent displayContent = win.getDisplayContent();
                    win.setDisplayLayoutNeeded();
                    if (displayContent != null) {
                        displayContent.layoutNeeded = true;
                    }
                }
                }
            }
            }


@@ -4138,10 +4117,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    }
                    }
                    w.mLastFreezeDuration = 0;
                    w.mLastFreezeDuration = 0;
                    unfrozeWindows = true;
                    unfrozeWindows = true;
                    final DisplayContent displayContent = w.getDisplayContent();
                    w.setDisplayLayoutNeeded();
                    if (displayContent != null) {
                        displayContent.layoutNeeded = true;
                    }
                }
                }
            }
            }
            if (force || unfrozeWindows) {
            if (force || unfrozeWindows) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -1321,6 +1321,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
        }
    }
    }


    void setDisplayLayoutNeeded() {
        if (mDisplayContent != null) {
            mDisplayContent.layoutNeeded = true;
        }
    }

    private class DeathRecipient implements IBinder.DeathRecipient {
    private class DeathRecipient implements IBinder.DeathRecipient {
        @Override
        @Override
        public void binderDied() {
        public void binderDied() {