summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jerry Chang <chenghsiuchang@google.com> 2021-05-26 09:10:40 +0000
committer Jerry Chang <chenghsiuchang@google.com> 2021-05-26 09:52:02 +0000
commitff29ec1c8a4fcfc2e763000a549485e8f1c59fea (patch)
tree35bbb2b767d35d947244c965fcd22fa4901374a2
parentad227b1cab5c1d52036a2d6d000064e373e0c4f0 (diff)
Fix Launcher won't get split screen config changed after dismissed
When split screen was dismissed due to launching activity not supporting split screen, it will reparent home task and update its bounds with two different window container transactions. When the home task was reparented without updating bounds, Launcher won't refresh split screen state because it only updates split screen config when there's orientation or screen size config changed. When the home task's bounds was updated latter, it might not triggers Activity#onConfigurationChanged due to the screen size changes didn't cross the threshold after ag/13816978 and ag/13844692. This merges reparent and reseting bounds transactions to make sure Launcher updates split screen state properly after dismissed split with not supporting split screen activity launched. Fix: 188462404 Test: dismiss split screen by launcher activity not supporting multiwindow, observed the split screen button shows properly in recent panel. Change-Id: Ic6224a3b593acd3e978f377c9840a8cfc9d9a29c
-rw-r--r--services/core/java/com/android/server/wm/TaskDisplayArea.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index a32f4904b229..90d40f3b13c2 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -49,6 +49,7 @@ import android.util.IntArray;
import android.util.Slog;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
+import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
import com.android.internal.annotations.VisibleForTesting;
@@ -1510,8 +1511,10 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
for (int i = mTmpTasks.size() - 1; i >= 0; i--) {
final Task root = mTmpTasks.get(i);
for (int j = 0; j < root.getChildCount(); j++) {
- wct.reparent(root.getChildAt(j).mRemoteToken.toWindowContainerToken(),
- null, true /* toTop */);
+ final WindowContainerToken token =
+ root.getChildAt(j).mRemoteToken.toWindowContainerToken();
+ wct.reparent(token, null, true /* toTop */);
+ wct.setBounds(token, null);
}
}
mAtmService.mWindowOrganizerController.applyTransaction(wct);