Loading core/java/android/window/IBackAnimationRunner.aidl +4 −5 Original line number Diff line number Diff line Loading @@ -38,14 +38,13 @@ oneway interface IBackAnimationRunner { /** * Called when the system is ready for the handler to start animating all the visible tasks. * @param apps The list of departing (type=MODE_CLOSING) and entering (type=MODE_OPENING) windows to animate, * @param wallpapers The list of wallpapers to animate. * @param nonApps The list of non-app windows such as Bubbles to animate. * windows to animate, * @param prepareOpenTransition If non-null, the animation should start after receive open * transition * @param finishedCallback The callback to invoke when the animation is finished. */ void onAnimationStart( in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in RemoteAnimationTarget[] nonApps, in IBinder prepareOpenTransition, in IBackAnimationFinishedCallback finishedCallback) = 2; } No newline at end of file libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +26 −16 Original line number Diff line number Diff line Loading @@ -1066,14 +1066,30 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont return true; } private void kickStartAnimation() { startSystemAnimation(); // Dispatch the first progress after animation start for // smoothing the initial animation, instead of waiting for next // onMove. final BackMotionEvent backFinish = mCurrentTracker .createProgressEvent(); dispatchOnBackProgressed(mActiveCallback, backFinish); if (!mBackGestureStarted) { // if the down -> up gesture happened before animation // start, we have to trigger the uninterruptible transition // to finish the back animation. startPostCommitAnimation(); } } private void createAdapter() { IBackAnimationRunner runner = new IBackAnimationRunner.Stub() { @Override public void onAnimationStart( RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, IBinder token, IBackAnimationFinishedCallback finishedCallback) { mShellExecutor.execute( () -> { Loading @@ -1085,21 +1101,12 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } mBackAnimationFinishedCallback = finishedCallback; mApps = apps; startSystemAnimation(); mBackTransitionHandler.consumeQueuedTransitionIfNeeded(); // Dispatch the first progress after animation start for // smoothing the initial animation, instead of waiting for next // onMove. final BackMotionEvent backFinish = mCurrentTracker .createProgressEvent(); dispatchOnBackProgressed(mActiveCallback, backFinish); if (!mBackGestureStarted) { // if the down -> up gesture happened before animation // start, we have to trigger the uninterruptible transition // to finish the back animation. startPostCommitAnimation(); // app only visible after transition ready, break for now. if (token != null) { return; } kickStartAnimation(); mBackTransitionHandler.consumeQueuedTransitionIfNeeded(); }); } Loading Loading @@ -1199,6 +1206,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont @NonNull SurfaceControl.Transaction st, @NonNull SurfaceControl.Transaction ft, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION) { kickStartAnimation(); } // Both mShellExecutor and Transitions#mMainExecutor are ShellMainThread, so we don't // need to post to ShellExecutor when called. if (info.getType() == WindowManager.TRANSIT_CLOSE_PREPARE_BACK_NAVIGATION) { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -881,7 +881,7 @@ public class BackAnimationControllerTest extends ShellTestCase { RemoteAnimationTarget[] targets = new RemoteAnimationTarget[]{animationTarget}; if (mController.mBackAnimationAdapter != null) { mController.mBackAnimationAdapter.getRunner().onAnimationStart( targets, null, null, mBackAnimationFinishedCallback); targets, null /* prepareOpenTransition */, mBackAnimationFinishedCallback); mShellExecutor.flushAll(); } } Loading services/core/java/com/android/server/wm/BackNavigationController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1820,8 +1820,10 @@ class BackNavigationController { mNavigationMonitor.cancelBackNavigating("cancelAnimation"); mBackAnimationAdapter.getRunner().onAnimationCancelled(); } else { mBackAnimationAdapter.getRunner().onAnimationStart( targets, null, null, callback); mBackAnimationAdapter.getRunner().onAnimationStart(targets, mOpenAnimAdaptor.mPreparedOpenTransition != null ? mOpenAnimAdaptor.mPreparedOpenTransition.getToken() : null, callback); } } catch (RemoteException e) { e.printStackTrace(); Loading Loading
core/java/android/window/IBackAnimationRunner.aidl +4 −5 Original line number Diff line number Diff line Loading @@ -38,14 +38,13 @@ oneway interface IBackAnimationRunner { /** * Called when the system is ready for the handler to start animating all the visible tasks. * @param apps The list of departing (type=MODE_CLOSING) and entering (type=MODE_OPENING) windows to animate, * @param wallpapers The list of wallpapers to animate. * @param nonApps The list of non-app windows such as Bubbles to animate. * windows to animate, * @param prepareOpenTransition If non-null, the animation should start after receive open * transition * @param finishedCallback The callback to invoke when the animation is finished. */ void onAnimationStart( in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in RemoteAnimationTarget[] nonApps, in IBinder prepareOpenTransition, in IBackAnimationFinishedCallback finishedCallback) = 2; } No newline at end of file
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +26 −16 Original line number Diff line number Diff line Loading @@ -1066,14 +1066,30 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont return true; } private void kickStartAnimation() { startSystemAnimation(); // Dispatch the first progress after animation start for // smoothing the initial animation, instead of waiting for next // onMove. final BackMotionEvent backFinish = mCurrentTracker .createProgressEvent(); dispatchOnBackProgressed(mActiveCallback, backFinish); if (!mBackGestureStarted) { // if the down -> up gesture happened before animation // start, we have to trigger the uninterruptible transition // to finish the back animation. startPostCommitAnimation(); } } private void createAdapter() { IBackAnimationRunner runner = new IBackAnimationRunner.Stub() { @Override public void onAnimationStart( RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, IBinder token, IBackAnimationFinishedCallback finishedCallback) { mShellExecutor.execute( () -> { Loading @@ -1085,21 +1101,12 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } mBackAnimationFinishedCallback = finishedCallback; mApps = apps; startSystemAnimation(); mBackTransitionHandler.consumeQueuedTransitionIfNeeded(); // Dispatch the first progress after animation start for // smoothing the initial animation, instead of waiting for next // onMove. final BackMotionEvent backFinish = mCurrentTracker .createProgressEvent(); dispatchOnBackProgressed(mActiveCallback, backFinish); if (!mBackGestureStarted) { // if the down -> up gesture happened before animation // start, we have to trigger the uninterruptible transition // to finish the back animation. startPostCommitAnimation(); // app only visible after transition ready, break for now. if (token != null) { return; } kickStartAnimation(); mBackTransitionHandler.consumeQueuedTransitionIfNeeded(); }); } Loading Loading @@ -1199,6 +1206,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont @NonNull SurfaceControl.Transaction st, @NonNull SurfaceControl.Transaction ft, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION) { kickStartAnimation(); } // Both mShellExecutor and Transitions#mMainExecutor are ShellMainThread, so we don't // need to post to ShellExecutor when called. if (info.getType() == WindowManager.TRANSIT_CLOSE_PREPARE_BACK_NAVIGATION) { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -881,7 +881,7 @@ public class BackAnimationControllerTest extends ShellTestCase { RemoteAnimationTarget[] targets = new RemoteAnimationTarget[]{animationTarget}; if (mController.mBackAnimationAdapter != null) { mController.mBackAnimationAdapter.getRunner().onAnimationStart( targets, null, null, mBackAnimationFinishedCallback); targets, null /* prepareOpenTransition */, mBackAnimationFinishedCallback); mShellExecutor.flushAll(); } } Loading
services/core/java/com/android/server/wm/BackNavigationController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1820,8 +1820,10 @@ class BackNavigationController { mNavigationMonitor.cancelBackNavigating("cancelAnimation"); mBackAnimationAdapter.getRunner().onAnimationCancelled(); } else { mBackAnimationAdapter.getRunner().onAnimationStart( targets, null, null, callback); mBackAnimationAdapter.getRunner().onAnimationStart(targets, mOpenAnimAdaptor.mPreparedOpenTransition != null ? mOpenAnimAdaptor.mPreparedOpenTransition.getToken() : null, callback); } } catch (RemoteException e) { e.printStackTrace(); Loading