Fixing a few potential crashes, preparing for Task affiliations framework changes.
- Deferring widget host listening to speed up startup
- Ensuring that we animate to the right task position in the stack and not just the front-most
- Removing assumption that we can only get screenshots for the most recent task
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index 1ba0560..33e3f58 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -19,7 +19,6 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
-import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
@@ -242,10 +241,10 @@
/** Prepares this task view for the enter-recents animations. This is called earlier in the
* first layout because the actual animation into recents may take a long time. */
- public void prepareEnterRecentsAnimation(boolean isTaskViewFrontMost, int offsetY, int offscreenY,
- Rect taskRect) {
+ public void prepareEnterRecentsAnimation(boolean isTaskViewLaunchTargetTask, int offsetY,
+ int offscreenY) {
if (mConfig.launchedFromAppWithScreenshot) {
- if (isTaskViewFrontMost) {
+ if (isTaskViewLaunchTargetTask) {
// Hide the task view as we are going to animate the full screenshot into view
// and then replace it with this view once we are done
setVisibility(View.INVISIBLE);
@@ -259,7 +258,7 @@
}
} else if (mConfig.launchedFromAppWithThumbnail) {
- if (isTaskViewFrontMost) {
+ if (isTaskViewLaunchTargetTask) {
// Hide the front most task bar view so we can animate it in
mBarView.prepareEnterRecentsAnimation();
// Set the dim to 0 so we can animate it in
@@ -282,7 +281,7 @@
TaskViewTransform transform = ctx.currentTaskTransform;
if (mConfig.launchedFromAppWithScreenshot) {
- if (ctx.isCurrentTaskFrontMost) {
+ if (ctx.isCurrentTaskLaunchTarget) {
// Animate the full screenshot down first, before swapping with this task view
ctx.fullScreenshotView.animateOnEnterRecents(ctx, new Runnable() {
@Override
@@ -318,7 +317,7 @@
ctx.postAnimationTrigger.increment();
} else if (mConfig.launchedFromAppWithThumbnail) {
- if (ctx.isCurrentTaskFrontMost) {
+ if (ctx.isCurrentTaskLaunchTarget) {
// Animate the task bar of the first task view
mBarView.startEnterRecentsAnimation(mConfig.taskBarEnterAnimDelay, mEnableThumbnailClip);