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

Commit 97bb0a84 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Apply syncPipSurfaceState synchronously

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/f02oeUMaFepLgVdibCqXM7
Bug: 286476220
Test: follow the reproduce steps in bug, see video
Change-Id: If85a7c1e952caee1f0647f3ca33356f39f0c6b27
parent 205c965c
Loading
Loading
Loading
Loading
+7 −18
Original line number Diff line number Diff line
@@ -609,19 +609,15 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler,
            }
        };
        mixed.mInFlightSubAnimations++;
        // Sync pip state.
        if (mPipHandler != null) {
            mPipHandler.syncPipSurfaceState(info, startTransaction, finishTransaction);
        }
        if (!mKeyguardHandler.startAnimation(
                mixed.mTransition, info, startTransaction, finishTransaction, finishCB)) {
            mixed.mInFlightSubAnimations--;
            return false;
        }
        // Sync pip state.
        if (mPipHandler != null) {
            // We don't know when to apply `startTransaction` so use a separate transaction here.
            // This should be fine because these surface properties are independent.
            final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
            mPipHandler.syncPipSurfaceState(info, t, finishTransaction);
            t.apply();
        }
        return true;
    }

@@ -637,19 +633,12 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler,
            finishCallback.onTransitionFinished(wct, wctCB);
        };
        mixed.mInFlightSubAnimations = 1;
        if (!mUnfoldHandler.startAnimation(
                mixed.mTransition, info, startTransaction, finishTransaction, finishCB)) {
            return false;
        }
        // Sync pip state.
        if (mPipHandler != null) {
            // We don't know when to apply `startTransaction` so use a separate transaction here.
            // This should be fine because these surface properties are independent.
            final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
            mPipHandler.syncPipSurfaceState(info, t, finishTransaction);
            t.apply();
            mPipHandler.syncPipSurfaceState(info, startTransaction, finishTransaction);
        }
        return true;
        return mUnfoldHandler.startAnimation(
                mixed.mTransition, info, startTransaction, finishTransaction, finishCB);
    }

    /** Use to when split use intent to enter, check if this enter transition should be mixed or