Check if returned surface params are null before adding them for surface transform

We call finish recents animation before app switch animation finishes. When we finish, the live tile params are not cleared up.

This change takes care of
- clean up recents animation targets when it's finished
- do a sanity check on live tile surface params before adding them to the surface transform array

Fixes: 143889142
Test: Swipe up to Overview in live tile mode, switch to a different task, and make sure it doesn't crash anymore
Change-Id: I089cf0a97744461d1fec4d0c97e0c3c6c1049ae3
This commit is contained in:
Tracy Zhou
2019-11-13 14:14:30 -08:00
parent 445cc2421e
commit fdf954a353
4 changed files with 14 additions and 9 deletions
@@ -48,12 +48,12 @@ import com.android.launcher3.graphics.RotationMode;
import com.android.launcher3.util.VibratorWrapper;
import com.android.launcher3.views.FloatingIconView;
import com.android.quickstep.BaseActivityInterface.HomeAnimationFactory;
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -285,12 +285,18 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
mRecentsAnimationController = null;
mRecentsAnimationTargets = null;
if (mRecentsView != null) {
mRecentsView.setRecentsAnimationTargets(null, null);
}
}
@Override
public void onRecentsAnimationFinished(RecentsAnimationController controller) {
mRecentsAnimationController = null;
mRecentsAnimationTargets = null;
if (mRecentsView != null) {
mRecentsView.setRecentsAnimationTargets(null, null);
}
}
private Rect getStackBounds(DeviceProfile dp) {