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

Commit b9fa8013 authored by Todd Lee's avatar Todd Lee
Browse files

Ensure that starting surface transaction is applied correctly

This fixes a glitch on the takeover transition on swipe
where window cropping/radius isn't applied early enough
(single square frame)

Bug: b/378975686
Test: Visual verification
Flag: NONE exempt minor UX fix
Change-Id: I8a3e21b76355fa269a092950a8a6fc8a8d8200ee
parent 2a85664a
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@ public class OriginRemoteTransition extends IRemoteTransition.Stub implements
    private static void applyWindowAnimationStates(
            TransitionInfo info,
            @Nullable WindowAnimationState[] states,
            UIComponent.Transaction transactions,
            UIComponent closingApp,
            UIComponent openingApp) {
        if (states == null) {
@@ -477,20 +478,18 @@ public class OriginRemoteTransition extends IRemoteTransition.Stub implements
            }
        }

        // Intentionally use a new transaction instead of reusing the existing transaction since we
        // want to apply window animation states first without committing any other pending changes
        // in the existing transaction. The existing transaction is expected to be committed by the
        // Intentionally use the existing transaction since we want to ensure that the window
        // states are applied along with the other surface preparations prior to the animation.
        // The existing transaction is expected to be committed by the
        // onStart() client callback together with client's custom transformation.
        UIComponent.Transaction transaction = closingApp.newTransaction();
        if (!maxClosingBounds.isEmpty()) {
            logD("Applying closing window bounds: " + maxClosingBounds);
            transaction.setBounds(closingApp, maxClosingBounds);
            transactions.setBounds(closingApp, maxClosingBounds);
        }
        if (!maxOpeningBounds.isEmpty()) {
            logD("Applying opening window bounds: " + maxOpeningBounds);
            transaction.setBounds(openingApp, maxOpeningBounds);
            transactions.setBounds(openingApp, maxOpeningBounds);
        }
        transaction.commit();
    }

    @Nullable
@@ -554,7 +553,8 @@ public class OriginRemoteTransition extends IRemoteTransition.Stub implements
            UIComponent openingApp = wrapSurfaces(transitionInfo, /* isOpening= */ true);

            // Restore the pending animation states coming from predictive back transition.
            applyWindowAnimationStates(transitionInfo, states, closingApp, openingApp);
            applyWindowAnimationStates(
                    transitionInfo, states, transactions, closingApp, openingApp);

            // Start.
            onStart(animationController, transactions, origin, closingApp, openingApp);