diff options
author | Tony Huang <tonyychuang@google.com> | 2023-02-23 07:49:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-03-15 01:37:12 +0000 |
commit | 91ef3bf26af446d17119bdaa34520878e45f85ee (patch) | |
tree | 6d01b6e95b0146993f432788ded53436a5a654e8 | |
parent | d40c3a37248eecfd3011d3c13b79f0aa67c806b2 (diff) | |
download | base-91ef3bf26af446d17119bdaa34520878e45f85ee.tar.gz |
Fix launch failed when split non-resizable app
We already handled such case on onRemoteAnimationFinishedOrCancelled
but ignore remote animation cancelled case(Quikc switch) because
it was a workaround for another bug. And that bug was already
resolved so we could remove add cancel case back.
Also rollback previous remove split pair patch due to we want to
let all background split pair keep after fold or unfold.
Fix: 267245649
Test: manual
Test: pass existing tests
Change-Id: I6ce80e6fc8c42e7b29180fd1cbf3f735da60434d
(cherry picked from commit on googleplex-android-review.googlesource.com host: b2f35cc29ece191ab7ad199bc772fd4bd2db1b77)
Merged-In: I6ce80e6fc8c42e7b29180fd1cbf3f735da60434d
-rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java | 13 | ||||
-rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java | 14 |
2 files changed, 6 insertions, 21 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index a4bd8ecfe314..9b61d0f138af 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -865,7 +865,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, new IRemoteAnimationFinishedCallback.Stub() { @Override public void onAnimationFinished() throws RemoteException { - onRemoteAnimationFinishedOrCancelled(false /* cancel */, evictWct); + onRemoteAnimationFinishedOrCancelled(evictWct); finishedCallback.onAnimationFinished(); } }; @@ -881,7 +881,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, @Override public void onAnimationCancelled(boolean isKeyguardOccluded) { - onRemoteAnimationFinishedOrCancelled(true /* cancel */, evictWct); + onRemoteAnimationFinishedOrCancelled(evictWct); try { adapter.getRunner().onAnimationCancelled(isKeyguardOccluded); } catch (RemoteException e) { @@ -902,14 +902,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } - private void onRemoteAnimationFinishedOrCancelled(boolean cancel, - WindowContainerTransaction evictWct) { + private void onRemoteAnimationFinishedOrCancelled(WindowContainerTransaction evictWct) { mIsSplitEntering = false; mShouldUpdateRecents = true; // If any stage has no child after animation finished, it means that split will display // nothing, such status will happen if task and intent is same app but not support // multi-instance, we should exit split and expand that app as full screen. - if (!cancel && (mMainStage.getChildCount() == 0 || mSideStage.getChildCount() == 0)) { + if (mMainStage.getChildCount() == 0 || mSideStage.getChildCount() == 0) { mMainExecutor.execute(() -> exitSplitScreen(mMainStage.getChildCount() == 0 ? mSideStage : mMainStage, EXIT_REASON_UNKNOWN)); @@ -1164,8 +1163,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Notify recents if we are exiting in a way that breaks the pair, and disable further // updates to splits in the recents until we enter split again if (shouldBreakPairedTaskInRecents(exitReason) && mShouldUpdateRecents) { - recentTasks.removeSplitPair(mMainStage.getLastVisibleTaskId()); - recentTasks.removeSplitPair(mSideStage.getLastVisibleTaskId()); + recentTasks.removeSplitPair(mMainStage.getTopVisibleChildTaskId()); + recentTasks.removeSplitPair(mSideStage.getTopVisibleChildTaskId()); } }); mShouldUpdateRecents = false; diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java index 0359761388dc..a841b7f96d3c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java @@ -92,7 +92,6 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { protected SurfaceControl mDimLayer; protected SparseArray<ActivityManager.RunningTaskInfo> mChildrenTaskInfo = new SparseArray<>(); private final SparseArray<SurfaceControl> mChildrenLeashes = new SparseArray<>(); - private int mLastVisibleTaskId = INVALID_TASK_ID; // TODO(b/204308910): Extracts SplitDecorManager related code to common package. private SplitDecorManager mSplitDecorManager; @@ -124,13 +123,6 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { } /** - * Returns the last visible task's id. - */ - int getLastVisibleTaskId() { - return mLastVisibleTaskId; - } - - /** * Returns the top visible child task's id. */ int getTopVisibleChildTaskId() { @@ -229,9 +221,6 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { return; } mChildrenTaskInfo.put(taskInfo.taskId, taskInfo); - if (taskInfo.isVisible && taskInfo.taskId != mLastVisibleTaskId) { - mLastVisibleTaskId = taskInfo.taskId; - } mCallbacks.onChildTaskStatusChanged(taskInfo.taskId, true /* present */, taskInfo.isVisible); if (!ENABLE_SHELL_TRANSITIONS) { @@ -264,9 +253,6 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { } else if (mChildrenTaskInfo.contains(taskId)) { mChildrenTaskInfo.remove(taskId); mChildrenLeashes.remove(taskId); - if (taskId == mLastVisibleTaskId) { - mLastVisibleTaskId = INVALID_TASK_ID; - } mCallbacks.onChildTaskStatusChanged(taskId, false /* present */, taskInfo.isVisible); if (ENABLE_SHELL_TRANSITIONS) { // Status is managed/synchronized by the transition lifecycle. |