diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index 33a826189d..2e1a62c372 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -45,6 +45,7 @@ import android.view.View; import android.window.RemoteTransition; import android.window.SplashScreen; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; @@ -240,6 +241,11 @@ public final class RecentsActivity extends StatefulActivity { } final TaskView taskView = (TaskView) v; + final RecentsView recentsView = taskView.getRecentsView(); + if (recentsView == null) { + return super.getActivityLaunchOptions(v, item); + } + RunnableList onEndCallback = new RunnableList(); mActivityLaunchAnimationRunner = new RemoteAnimationFactory() { @@ -248,7 +254,7 @@ public final class RecentsActivity extends StatefulActivity { RemoteAnimationTarget[] wallpaperTargets, RemoteAnimationTarget[] nonAppTargets, AnimationResult result) { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); - AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets, + AnimatorSet anim = composeRecentsLaunchAnimator(recentsView, taskView, appTargets, wallpaperTargets, nonAppTargets); anim.addListener(resetStateListener()); result.setAnimation(anim, RecentsActivity.this, onEndCallback::executeAllAndDestroy, @@ -285,14 +291,16 @@ public final class RecentsActivity extends StatefulActivity { /** * Composes the animations for a launch from the recents list if possible. */ - private AnimatorSet composeRecentsLaunchAnimator(TaskView taskView, + private AnimatorSet composeRecentsLaunchAnimator( + @NonNull RecentsView recentsView, + @NonNull TaskView taskView, RemoteAnimationTarget[] appTargets, RemoteAnimationTarget[] wallpaperTargets, RemoteAnimationTarget[] nonAppTargets) { AnimatorSet target = new AnimatorSet(); boolean activityClosing = taskIsATargetWithMode(appTargets, getTaskId(), MODE_CLOSING); PendingAnimation pa = new PendingAnimation(RECENTS_LAUNCH_DURATION); - createRecentsWindowAnimator(taskView, !activityClosing, appTargets, + createRecentsWindowAnimator(recentsView, taskView, !activityClosing, appTargets, wallpaperTargets, nonAppTargets, null /* depthController */, pa); target.play(pa.buildAnim()); diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index c9bad38546..538aba9e21 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -160,13 +160,14 @@ public final class TaskViewUtils { } public static void createRecentsWindowAnimator( - @NonNull TaskView v, boolean skipViewChanges, + @NonNull RecentsView recentsView, + @NonNull TaskView v, + boolean skipViewChanges, @NonNull RemoteAnimationTarget[] appTargets, @NonNull RemoteAnimationTarget[] wallpaperTargets, @NonNull RemoteAnimationTarget[] nonAppTargets, @Nullable DepthController depthController, PendingAnimation out) { - RecentsView recentsView = v.getRecentsView(); boolean isQuickSwitch = v.isEndQuickswitchCuj(); v.setEndQuickswitchCuj(false); @@ -606,8 +607,8 @@ public final class TaskViewUtils { TaskView taskView = findTaskViewToLaunch(recentsView, v, appTargets); PendingAnimation pa = new PendingAnimation(RECENTS_LAUNCH_DURATION); - createRecentsWindowAnimator(taskView, skipLauncherChanges, appTargets, wallpaperTargets, - nonAppTargets, depthController, pa); + createRecentsWindowAnimator(recentsView, taskView, skipLauncherChanges, appTargets, + wallpaperTargets, nonAppTargets, depthController, pa); if (launcherClosing) { // TODO(b/182592057): differentiate between "restore split" vs "launch fullscreen app" TaskViewUtils.createSplitAuxiliarySurfacesAnimator(nonAppTargets, true /*shown*/,