Support multiple tasks in recentsaninmation onTaskAppeared

Needed for app-pairs support

Bug: 204094785
Test: TODO
Change-Id: I3c5f8097b04b4033ba887e3c6d9e5ffd900df80e
This commit is contained in:
Evan Rosky
2021-11-03 11:50:35 -07:00
committed by Vinit Nayak
parent 44fcfa5bfd
commit e4102c6ffe
9 changed files with 45 additions and 24 deletions
@@ -56,6 +56,7 @@ public class SplitSelectStateController {
private Task mInitialTask;
private Task mSecondTask;
private Rect mInitialBounds;
private boolean mRecentsAnimationRunning;
public SplitSelectStateController(Handler handler, SystemUiProxy systemUiProxy) {
mHandler = handler;
@@ -113,6 +114,10 @@ public class SplitSelectStateController {
return mStagePosition;
}
public void setRecentsAnimationRunning(boolean running) {
this.mRecentsAnimationRunning = running;
}
/**
* Requires Shell Transitions
*/
@@ -172,7 +177,9 @@ public class SplitSelectStateController {
public void onAnimationCancelled() {
postAsyncCallback(mHandler, () -> {
if (mSuccessCallback != null) {
mSuccessCallback.accept(false);
// Launching legacy tasks while recents animation is running will always cause
// onAnimationCancelled to be called (should be fixed w/ shell transitions?)
mSuccessCallback.accept(mRecentsAnimationRunning);
}
resetState();
});
@@ -187,6 +194,7 @@ public class SplitSelectStateController {
mSecondTask = null;
mStagePosition = SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
mInitialBounds = null;
mRecentsAnimationRunning = false;
}
/**