From 6f8ebc05d9f62ab6aea0535bbf1f8c2df9ac7a9f Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Thu, 30 Sep 2021 12:20:13 +0800 Subject: [PATCH] Applying lifecycle effect when changing TaskFragment bounds The activity visibility was not updated when folding the Device and the TaskFragment below remain visible and the activity was still in resumed state. The same issue can also result in wrong activity visibility state when unfolding the device due to there is a race between processing the activity configuration changes and requesting TaskFragment bounds changes from the organizer. Bug: 201564759 Test: resize display when activities in split Change-Id: I2bffb2ee27fc2437be231df606e2e46509dced97 --- .../java/com/android/server/wm/WindowOrganizerController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java index 69313810fa931..781b53df998e7 100644 --- a/services/core/java/com/android/server/wm/WindowOrganizerController.java +++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java @@ -462,6 +462,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub container.onRequestedOverrideConfigurationChanged(c); } effects |= TRANSACT_EFFECTS_CLIENT_CONFIG; + if (windowMask != 0 && container.isEmbedded()) { + // Changing bounds of the embedded TaskFragments may result in lifecycle changes. + effects |= TRANSACT_EFFECTS_LIFECYCLE; + } } if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_FOCUSABLE) != 0) { if (container.setFocusable(change.getFocusable())) {