From: Garfield Tan Date: Mon, 25 Jun 2018 23:29:21 +0000 (-0700) Subject: Preserve other windows during resize as well. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b91511879d22a323f6ea3989d2661c9a23614342;p=android-x86%2Fframeworks-base.git Preserve other windows during resize as well. Before this change if user resizes a window that has a dialog activity in the front, and a paused activity in its back, the paused activity will be completely torn down and relaunched, causing a whole period of black window showing to users. Bug: 110716902 Test: The activity stopped flickering and go/wm-smoke. Change-Id: I0dfe6a9c3d925a365a1a3beaa5841e1606220ac2 --- diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index c8ffdb16ed6d..b44727fb6fe7 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -542,8 +542,14 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi if (r != null && !deferResume) { kept = r.ensureActivityConfiguration(0 /* globalChanges */, preserveWindow); + // Preserve other windows for resizing because if resizing happens when there + // is a dialog activity in the front, the activity that still shows some + // content to the user will become black and cause flickers. Note in most cases + // this won't cause tons of irrelevant windows being preserved because only + // activities in this task may experience a bounds change. Configs for other + // activities stay the same. mService.mStackSupervisor.ensureActivitiesVisibleLocked(r, 0, - !PRESERVE_WINDOWS); + preserveWindow); if (!kept) { mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); }