From b0e388823bef00975176a11ba269c29b062ca786 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Wed, 25 Apr 2018 12:48:54 -0700 Subject: [PATCH] Use correct windowingMode when computing override config The StackWindowController was calculating task bounds with the WM-side windowingMode instead of the AM-side. In this case, we are resizing during a windowingMode change (fullscreen -> freeform). Since the windowingMode isn't sent to WM-side yet, the smallestScreenWidthDp was set using the old windowingMode resulting in the wrong resources being used. This change makes windowingMode one of the parameters (like bounds/density) used to adjust the configuration. Bug: 71028905 Test: ActivityStackTests and WindowConfigurationTests still pass. Open playstore maximized, go to an app page, restore window. Layout should now be appropriate for the smaller window. Change-Id: Idcb538a768cd983ab9eac0d61a6dbea3e9dc64a5 --- .../java/android/app/WindowConfiguration.java | 10 ++++++++- .../com/android/server/am/TaskRecord.java | 2 +- .../server/wm/StackWindowController.java | 21 ++++++++++++------- .../server/wm/WindowConfigurationTests.java | 3 ++- .../android/server/wm/WindowTestUtils.java | 3 ++- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java index 46566e79d99cc..21d6762666a0b 100644 --- a/core/java/android/app/WindowConfiguration.java +++ b/core/java/android/app/WindowConfiguration.java @@ -495,7 +495,15 @@ public class WindowConfiguration implements Parcelable, Comparable