From c0f1f4f3afe1d6cf275ad4f54fabfc134f0294c3 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 28 May 2019 15:49:09 -0700 Subject: Fix bug where changing the display size does not update the launcher grid. The bug is caused by launcher saving the grid name and using that grid name to look for matching display options. This makes sense when changing the grid size, but doesn't work well when changing the display size. Example: Initial Pixel display size is set to Default, so we save "normal" as the KEY_IDP_GRID_NAME. When we change display size to Largest, the KEY_IDP_GRID_NAME is still "normal" and so we only look at display options under "normal". Before this, Pixel with display size set to Largest would be set to "reasonable". This should be safe change for Q, and we can have a proper fix when we officially support changing grid size. Bug: 131867841 Change-Id: If5f3b0a13b90069973e929024b26bd9b9c45a7d8 --- src/com/android/launcher3/InvariantDeviceProfile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 8a8a2fbe5..bde87cb50 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -288,7 +288,9 @@ public class InvariantDeviceProfile { InvariantDeviceProfile oldProfile = new InvariantDeviceProfile(this); // Re-init grid - initGrid(context, Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null)); + // TODO(b/131867841): We pass in null here so that we can calculate the closest profile + // without the bias of the grid name. + initGrid(context, null); int changeFlags = 0; if (numRows != oldProfile.numRows || -- cgit v1.2.3