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

Commit 28017afd authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Allow WindowState to assign layer during transition." into udc-dev

parents 460be670 848544b4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -516,8 +516,14 @@ class TransitionController {
     * playing, but can be "opened-up" for certain transition operations like calculating layers
     * for finishTransaction.
     */
    boolean canAssignLayers() {
        return mBuildingFinishLayers || !isPlaying();
    boolean canAssignLayers(@NonNull WindowContainer wc) {
        // Don't build window state into finish transaction in case another window is added or
        // removed during transition playing.
        if (mBuildingFinishLayers) {
            return wc.asWindowState() == null;
        }
        // Always allow WindowState to assign layers since it won't affect transition.
        return wc.asWindowState() != null || !isPlaying();
    }

    @WindowConfiguration.WindowingMode
+1 −1
Original line number Diff line number Diff line
@@ -2596,7 +2596,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
    void assignLayer(Transaction t, int layer) {
        // Don't assign layers while a transition animation is playing
        // TODO(b/173528115): establish robust best-practices around z-order fighting.
        if (!mTransitionController.canAssignLayers()) return;
        if (!mTransitionController.canAssignLayers(this)) return;
        final boolean changed = layer != mLastLayer || mLastRelativeToLayer != null;
        if (mSurfaceControl != null && changed) {
            setLayer(t, layer);