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

Commit 52e12640 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove prepareSurface from surface placement

Since I67e4e58aced78a2f36163178a64ca55d3c77e6f3, the pending
transaction no longer applies with surface placement.

This is similar to partially undo commit 6b0f8461. The problem
is gone with centralized transaction in WindowAnimator.

And because surface placement already always schedules a frame
to call prepareSurface, the invocation in itself becomes redundant.

Bug: 159103089
Bug: 330721336
Test: CtsWindowManagerDeviceWindow
Change-Id: I6ae097b413ce04a30968807af545f95833b16ce0
parent 642bdb48
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -30,6 +30,17 @@ flag {
    is_fixed_read_only: true
}

flag {
  name: "remove_prepare_surface_in_placement"
  namespace: "windowing_frontend"
  description: "Reduce unnecessary invocation to improve performance"
  bug: "330721336"
  is_fixed_read_only: true
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "close_to_square_config_includes_status_bar"
  namespace: "windowing_frontend"
+3 −1
Original line number Diff line number Diff line
@@ -5102,7 +5102,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
        if (!com.android.window.flags.Flags.removePrepareSurfaceInPlacement()) {
            prepareSurfaces();
        }

        // This should be called after the insets have been dispatched to clients and we have
        // committed finish drawing windows.
+2 −0
Original line number Diff line number Diff line
@@ -3416,6 +3416,7 @@ public class ActivityRecordTests extends WindowTestsBase {
        // Remove window during transition, so it is requested to hide, but won't be committed until
        // the transition is finished.
        app.mActivityRecord.onRemovedFromDisplay();
        app.mActivityRecord.prepareSurfaces();

        assertTrue(mDisplayContent.mClosingApps.contains(app.mActivityRecord));
        assertFalse(app.mActivityRecord.isVisibleRequested());
@@ -3433,6 +3434,7 @@ public class ActivityRecordTests extends WindowTestsBase {
    public void testInClosingAnimation_visibilityCommitted_hideSurface() {
        final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
        makeWindowVisibleAndDrawn(app);
        app.mActivityRecord.prepareSurfaces();

        // Put the activity in close transition.
        mDisplayContent.mOpeningApps.clear();