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

Commit e580fbd8 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unnecessary layer assignment on destroy client surface

Because:
- Client surface doesn't have a computed layer value.
- If destroySurface removes a window, the removal
  postWindowRemoveCleanupLocked also updates layers.
- updateLetterboxSurfaceIfNeeded is no-op if the argument is null.

This mainly reduces unnecessary operations from
 activityStopped > destroySurfaces.

History commit: e12aece4

Bug: 163976519
Flag: EXEMPT remove outdate code
Test: CtsWindowManagerDeviceActivity
Change-Id: Ib11916f900eb8d30a7f9f6fdfc155420bbda34f6
parent a08a0293
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -5789,18 +5789,11 @@ final class ActivityRecord extends WindowToken {
     * surfaces that's eligible, if the app is already stopped.
     */
    private void destroySurfaces(boolean cleanupOnResume) {
        boolean destroyedSomething = false;

        // Copying to a different list as multiple children can be removed.
        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);
        }
        if (destroyedSomething) {
            final DisplayContent dc = getDisplayContent();
            dc.assignWindowLayers(true /*setLayoutNeeded*/);
            updateLetterboxSurfaceIfNeeded(null);
            win.destroySurface(cleanupOnResume, mAppStopped);
        }
    }