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

Commit ab4c1eaa authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Copy child window list when destroying surface"

parents 500bb827 59f3e926
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -649,8 +649,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        boolean destroyedSomething = false;

        // Copying to a different list as multiple children can be removed.
        // TODO: Not sure why this is needed.
        final LinkedList<WindowState> children = new LinkedList<>(mChildren);
        final ArrayList<WindowState> children = new ArrayList<>(mChildren);
        for (int i = children.size() - 1; i >= 0; i--) {
            final WindowState win = children.get(i);
            destroyedSomething |= win.destroySurface(cleanupOnResume, mAppStopped);
+6 −4
Original line number Diff line number Diff line
@@ -2664,8 +2664,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

    boolean destroySurface(boolean cleanupOnResume, boolean appStopped) {
        boolean destroyedSomething = false;
        for (int i = mChildren.size() - 1; i >= 0; --i) {
            final WindowState c = mChildren.get(i);

        // Copying to a different list as multiple children can be removed.
        final ArrayList<WindowState> childWindows = new ArrayList<>(mChildren);
        for (int i = childWindows.size() - 1; i >= 0; --i) {
            final WindowState c = childWindows.get(i);
            destroyedSomething |= c.destroySurface(cleanupOnResume, appStopped);
        }

@@ -3923,8 +3926,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

        if (!mChildren.isEmpty()) {
            // Copying to a different list as multiple children can be removed.
            // TODO: Not sure if we really need to copy this into a different list.
            final LinkedList<WindowState> childWindows = new LinkedList(mChildren);
            final ArrayList<WindowState> childWindows = new ArrayList<>(mChildren);
            for (int i = childWindows.size() - 1; i >= 0; i--) {
                childWindows.get(i).onExitAnimationDone();
            }