If nothing to animate, don't call remote animator
Otherwise we'll end up with weird transitions when just switching
focus because focus switch causes an app transition to run.
Test: go/wm-smoke
Test: Enter PIP, click on PIP window, click on launcher window
to execute an empty app transition.
Change-Id: Ie42ad808ff4d4646570c122fd3b964e3255a57bc
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 8515dcb..0048983 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -88,6 +88,10 @@
* Called when the transition is ready to be started, and all leashes have been set up.
*/
void goodToGo() {
+ if (mPendingAnimations.isEmpty()) {
+ onAnimationFinished();
+ return;
+ }
mHandler.postDelayed(mTimeoutRunnable, TIMEOUT_MS);
try {
mRemoteAnimationAdapter.getRunner().onAnimationStart(createAnimations(),