From 49dcd16b26f22a166a67a38338203b8c1877f494 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 17 Jun 2022 17:56:18 +0100 Subject: [PATCH] Only check dbFile to decide if grid migration is needed Fix: 234847755 Test: With a modified local build, when changing display config to swap between same grid: - When dbFile is same but device type is different, no migration is performed - When both dbFile and device type are different, migration is performed properly Test: Grid migration through Wallpaper & Styles still works properly Change-Id: Ie7429a7d59c135ba47061cae21c40b8d8af7188a --- src/com/android/launcher3/model/DeviceGridState.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/model/DeviceGridState.java b/src/com/android/launcher3/model/DeviceGridState.java index 35fcb789e7..46f0b0b155 100644 --- a/src/com/android/launcher3/model/DeviceGridState.java +++ b/src/com/android/launcher3/model/DeviceGridState.java @@ -134,10 +134,13 @@ public class DeviceGridState implements Comparable { * DeviceGridState without migration, or false otherwise. */ public boolean isCompatible(DeviceGridState other) { - if (this == other) return true; - if (other == null) return false; - return mNumHotseat == other.mNumHotseat - && Objects.equals(mGridSizeString, other.mGridSizeString); + if (this == other) { + return true; + } + if (other == null) { + return false; + } + return Objects.equals(mDbFile, other.mDbFile); } public Integer getColumns() {