diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/RecentsAnimationController.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index 59bec74d5265..7392e803a125 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -240,11 +240,16 @@ public class RecentsAnimationController { return; } try { - final RemoteAnimationTarget[] appAnimations = - new RemoteAnimationTarget[mPendingAnimations.size()]; + final ArrayList<RemoteAnimationTarget> appAnimations = new ArrayList<>(); for (int i = mPendingAnimations.size() - 1; i >= 0; i--) { - appAnimations[i] = mPendingAnimations.get(i).createRemoteAnimationApp(); + final RemoteAnimationTarget target = + mPendingAnimations.get(i).createRemoteAnimationApp(); + if (target != null) { + appAnimations.add(target); + } } + final RemoteAnimationTarget[] appTargets = appAnimations.toArray( + new RemoteAnimationTarget[appAnimations.size()]); mPendingStart = false; final Rect minimizedHomeBounds = @@ -253,7 +258,7 @@ public class RecentsAnimationController { final Rect contentInsets = mHomeAppToken != null && mHomeAppToken.findMainWindow() != null ? mHomeAppToken.findMainWindow().mContentInsets : null; - mRunner.onAnimationStart_New(mController, appAnimations, contentInsets, + mRunner.onAnimationStart_New(mController, appTargets, contentInsets, minimizedHomeBounds); } catch (RemoteException e) { Slog.e(TAG, "Failed to start recents animation", e); @@ -367,6 +372,9 @@ public class RecentsAnimationController { container.getRelativePosition(position); container.getBounds(bounds); final WindowState mainWindow = mTask.getTopVisibleAppMainWindow(); + if (mainWindow == null) { + return null; + } mTarget = new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash, !mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect, mainWindow.mContentInsets, mTask.getPrefixOrderIndex(), position, bounds, |