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

Commit 4412e234 authored by chaviw's avatar chaviw
Browse files

Fix some issues with applySyncTransaction

1. Sometimes there are windows that don't need to be re-drawn when
there's a config change. In those cases, system server will still wait
on those clients to notify that it's completed drawing. Therefore, we
force clients to report draw when blast sync is enabled, meaning the
server is waiting for all clients to draw.

2. If a window is removed during a syncTransaction, the server will
continue waiting but the client will never report back. Therefore, call
finishDrawing when a window is removed

3. Ensure performSurfacePlacement is called when there has been a config
change as a result of applyTransaction

Test: Tested with DisplayAreaOrganizer and syncTransaction
Bug: 152114574
Change-Id: Ib725e6ae1da4e37184c34759baea2fe8e0d5c02a
parent 8650e9aa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.wm;
import static android.Manifest.permission.MANAGE_ACTIVITY_STACKS;

import static com.android.server.wm.ActivityStackSupervisor.PRESERVE_WINDOWS;
import static com.android.server.wm.ActivityTaskManagerService.LAYOUT_REASON_CONFIG_CHANGED;
import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_TASK_ORG;
import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
@@ -173,6 +174,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                            f.recycle();
                        }
                    }

                    if ((effects & TRANSACT_EFFECTS_CLIENT_CONFIG) == 0) {
                        mService.addWindowLayoutReasons(LAYOUT_REASON_CONFIG_CHANGED);
                    }
                } finally {
                    mService.continueWindowLayout();
                    if (syncId >= 0) {
+2 −1
Original line number Diff line number Diff line
@@ -2114,6 +2114,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    void removeIfPossible() {
        super.removeIfPossible();
        removeIfPossible(false /*keepVisibleDeadWindow*/);
        finishDrawing(null);
    }

    private void removeIfPossible(boolean keepVisibleDeadWindow) {
@@ -3454,7 +3455,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final Rect visibleInsets = mWindowFrames.mLastVisibleInsets;
        final Rect stableInsets = mWindowFrames.mLastStableInsets;
        final MergedConfiguration mergedConfiguration = mLastReportedConfiguration;
        final boolean reportDraw = mWinAnimator.mDrawState == DRAW_PENDING;
        final boolean reportDraw = mWinAnimator.mDrawState == DRAW_PENDING || useBLASTSync();
        final boolean forceRelayout = reportOrientation || isDragResizeChanged();
        final int displayId = getDisplayId();
        final DisplayCutout displayCutout = getWmDisplayCutout().getDisplayCutout();