summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tony Huang <tonyychuang@google.com> 2021-10-29 13:15:59 +0800
committer Tony Huang <tonyychuang@google.com> 2021-10-29 22:03:53 +0800
commit2003f5796c929eb55d50accb46d80f8079ee19f0 (patch)
treee2ba26656446f545504f26beefe8fa0221ced4db
parent44850438d9487b4ed04c4ddc5c0545b66d7f89d2 (diff)
Fix side stage cannot be focused
When split active by drag drop, the active point is onStageHasChildrenChanged callback but we don't reorder side stage to top then make it cannot be focused. Add reorder root to top for fixing. Fix: 204510713 Test: manual Test: pass existing tests Change-Id: I553a57250c302ff435a35c9a10599fc375e48248
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java
index 51104e44569e..d67f4a6077b6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java
@@ -45,6 +45,11 @@ class SideStage extends StageTaskListener {
stageTaskUnfoldController);
}
+ void moveToTop(Rect rootBounds, WindowContainerTransaction wct) {
+ final WindowContainerToken rootToken = mRootTaskInfo.token;
+ wct.setBounds(rootToken, rootBounds).reorder(rootToken, true /* onTop */);
+ }
+
void addTask(ActivityManager.RunningTaskInfo task, Rect rootBounds,
WindowContainerTransaction wct) {
final WindowContainerToken rootToken = mRootTaskInfo.token;
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 3b62afc7320e..2cca41153ef0 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
@@ -758,7 +758,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
final WindowContainerTransaction wct = new WindowContainerTransaction();
// Make sure the main stage is active.
mMainStage.activate(getMainStageBounds(), wct, true /* reparent */);
- mSideStage.setBounds(getSideStageBounds(), wct);
+ mSideStage.moveToTop(getSideStageBounds(), wct);
mTaskOrganizer.applyTransaction(wct);
}
if (!mLogger.hasStartedSession() && mMainStageListener.mHasChildren