From 664c1c18e729a57ccb4d961042792fb45f7c36a7 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 6 May 2022 15:47:11 +0100 Subject: [PATCH] Sort hotseat items in migration to preserve position Fix: 231601760 Test: manual with local backup/restore Change-Id: Ie89f0134485296c3cd252cf6b86bb3f88a0f90de --- .../android/launcher3/model/GridSizeMigrationTaskV2.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java index e36d4cf27d..ef9250c900 100644 --- a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java +++ b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java @@ -216,14 +216,15 @@ public class GridSizeMigrationTaskV2 { return false; } + // Sort the items by the reading order. + Collections.sort(mHotseatDiff); + Collections.sort(mWorkspaceDiff); + // Migrate hotseat HotseatPlacementSolution hotseatSolution = new HotseatPlacementSolution(mDb, mSrcReader, mDestReader, mContext, mDestHotseatSize, mHotseatItems, mHotseatDiff); hotseatSolution.find(); - // Sort the items by the reading order. - Collections.sort(mWorkspaceDiff); - // Migrate workspace. // First we create a collection of the screens List screens = new ArrayList<>();