Call exitSplitScreen() when user leaves split tasks

* Also call it when user swipes to home

Fixes: 198310766
Test: Tested QS'ing split to fullscreen,
full to split, swipe to home from split and fullscreen

Change-Id: I6a465ead7fcd68dc85e0ab401789f4a5c3feb0d1
This commit is contained in:
Vinit Nayak
2021-09-03 14:09:47 -07:00
parent 11438429a8
commit 84511f2997
6 changed files with 41 additions and 9 deletions
@@ -99,6 +99,7 @@ import com.android.quickstep.TaskThumbnailCache;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TaskViewUtils;
import com.android.quickstep.util.CancellableTask;
import com.android.quickstep.util.LauncherSplitScreenListener;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.TaskCornerRadius;
import com.android.quickstep.util.TransformParams;
@@ -689,8 +690,13 @@ public class TaskView extends FrameLayout implements Reusable {
TestLogging.recordEvent(
TestProtocol.SEQUENCE_MAIN, "startActivityFromRecentsAsync", mTask);
ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null);
boolean isOldTaskSplit = LauncherSplitScreenListener.INSTANCE.getNoCreate()
.getPersistentSplitIds().length > 0;
if (ActivityManagerWrapper.getInstance()
.startActivityFromRecents(mTask.key, opts.options)) {
if (isOldTaskSplit) {
SystemUiProxy.INSTANCE.getNoCreate().exitSplitScreen(mTask.key.id);
}
RecentsView recentsView = getRecentsView();
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskViewId() != -1) {
recentsView.onTaskLaunchedInLiveTileMode();