Draw live tile below Overview after launch animation

A fix (see http://go/b320307512_problems) was put in to change layers
when swiping from Desktop Windowing to Overview, so that the blur effect
 didn't apply to the live tile. The result of this change was that the
 tasks now sat on top of Overview and if you didn't launch the task but
 went back to Overview, then you could interact with them and do things
 like resize the task and get into a very broken state.

This fix simply flips the layer ordering back after the animation
completes to ensure Overview sits on top.

Fix: 373400009
Flag: NONE bugfix
Test: Swipe from Desktop to Overview. Swipe down from Overview to launch
 the live tile, but then swipe back to Overview i.e. don't launch
 Desktop. Try to resize the DW window.

Change-Id: I80c8d72f76a8393eb8bd963df81723defd85ed97
This commit is contained in:
samcackett
2024-10-14 18:30:11 +01:00
committed by Sam Cackett
parent 89eae4484a
commit ea788d92be
@@ -5564,15 +5564,13 @@ public abstract class RecentsView<
remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator()
.addOverviewToAppAnim(mPendingAnimation, interpolator));
mPendingAnimation.addOnFrameCallback(this::redrawLiveTile);
if (taskView instanceof DesktopTaskView && mRemoteTargetHandles != null) {
mPendingAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
runActionOnRemoteHandles(remoteTargetHandle ->
remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(false));
}
});
}
mPendingAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
runActionOnRemoteHandles(remoteTargetHandle ->
remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(false));
}
});
mPendingAnimation.addEndListener(isSuccess -> {
if (isSuccess) {
if (taskView instanceof GroupedTaskView && hasAllValidTaskIds(taskView.getTaskIds())
@@ -5604,6 +5602,13 @@ public abstract class RecentsView<
protected Unit onTaskLaunchAnimationEnd(boolean success) {
if (success) {
resetTaskVisuals();
} else {
// If launch animation didn't complete i.e. user dragged live tile down and then
// back up and returned to Overview, then we need to ensure we reset the
// view to draw below recents so that it can't be interacted with.
runActionOnRemoteHandles(remoteTargetHandle ->
remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(true));
redrawLiveTile();
}
return Unit.INSTANCE;
}