From bf31a0641f3495a6ec649368731ddf05ce5be72c Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Wed, 1 Sep 2021 10:33:02 +0800 Subject: [PATCH] Fix dismissing activity getting relaunch signal while dismissing split When applying dismissing split window container transaction to reparent child tasks out of split roots, it'll schedule update multi window mode change. Prevent sending relaunch signal to the dismissing activity which won't be visible after split dismissed by considering visibility while applying new configuration for multi window mode udpate. Fix: 194646075 Test: enter split screen, drag divider bar to dismiss split, checked the dismissing activity won't get relaunch signal. Change-Id: Ifb40fcbf89abaaa1bfb76e5018b31fc95778925d --- .../java/com/android/server/wm/ActivityRecord.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 67043dbab6a38..79df908b2287d 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -1354,14 +1354,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A updatePictureInPictureMode(null, false); } else { mLastReportedMultiWindowMode = inMultiWindowMode; - // If the activity is in stopping or stopped state, for instance, it's in the - // split screen task and not the top one, the last configuration it should keep - // is the one before multi-window mode change. - final State state = getState(); - if (state != STOPPED && state != STOPPING) { - ensureActivityConfiguration(0 /* globalChanges */, PRESERVE_WINDOWS, - true /* ignoreVisibility */); - } + ensureActivityConfiguration(0 /* globalChanges */, PRESERVE_WINDOWS, + false /* ignoreVisibility */); } } }