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

Commit 6d3f7116 authored by Chris Li's avatar Chris Li
Browse files

Sync surface position for legacy app transition animation

With legacy app transition:
1. TaskFragment is resized when it is invisible -> update surface
   position on sync transaction.
2. Activity becomes visible in TaskFragment, which trigger app
   transition.
3. Animation target is promoted to TaskFragment and create animation
   leash -> reset position on pending transaction.
4. Apply pending transaction to start legacy app transition -> 1 is
   applied after 3, which cause the TaskFragment surface position offset
   in animation leash.

This is similar to I74e044f440e40c3c5f99bf0f8c7a601e953dbbc7

Fix: 256689498
Test: Launch Setting into split left with any app, click back to exit
the split right. No flicker when Settings shows in fullscreen.

Change-Id: Id3db698729a5c25df7e50a49caf504b6fa866aa6
parent 96e8a788
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2336,6 +2336,11 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        if (mTaskFragmentOrganizer != null
                && (mLastSurfaceSize.x != 0 || mLastSurfaceSize.y != 0)) {
            t.setWindowCrop(mSurfaceControl, 0, 0);
            final SurfaceControl.Transaction syncTransaction = getSyncTransaction();
            if (t != syncTransaction) {
                // Avoid restoring to old window crop if the sync transaction is applied later.
                syncTransaction.setWindowCrop(mSurfaceControl, 0, 0);
            }
            mLastSurfaceSize.set(0, 0);
        }
    }
+3 −2
Original line number Diff line number Diff line
@@ -3250,9 +3250,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<

    void resetSurfacePositionForAnimationLeash(Transaction t) {
        t.setPosition(mSurfaceControl, 0, 0);
        if (mSyncState != SYNC_STATE_NONE && t != mSyncTransaction) {
        final SurfaceControl.Transaction syncTransaction = getSyncTransaction();
        if (t != syncTransaction) {
            // Avoid restoring to old position if the sync transaction is applied later.
            mSyncTransaction.setPosition(mSurfaceControl, 0, 0);
            syncTransaction.setPosition(mSurfaceControl, 0, 0);
        }
        mLastSurfacePosition.set(0, 0);
    }