From abcc99f01587f2185a0f49e86d34fcfc12d7b216 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Fri, 4 Apr 2025 16:11:14 -0700 Subject: [PATCH] When updating workspace items, make sure to not process Folder icons as Workspace items. Also, in Folder.java the DeviceProfile obtained using the activity, in this case the Activity is TaskbarActivityContext is returning a different DeviceProfile form the Launcher which causes the update. So this triggers an update when is not needed but even if we make a faulty update the workspace should be able to differentiate between workspace item and folder items. This issue was triggered by this flag com.android.window.flags.enable_taskbar_recents_layout_transition . Fix: 407630150 Test: NA Flag: EXEMPT bug fix Change-Id: I255052506e7d198b1384c15ebfe2f6f2753da1ed --- src/com/android/launcher3/folder/Folder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index d1c6a4f39a..788c6d5bbb 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -76,6 +76,7 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.DragSource; import com.android.launcher3.DropTarget; import com.android.launcher3.ExtendedEditText; +import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.OnAlarmListener; import com.android.launcher3.R; @@ -1141,8 +1142,12 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo } private void updateItemLocationsInDatabaseBatch(boolean isBind) { + // b/409061698 We need to get the DeviceProfile directly from the activity but to fix the + // issue we will merge this solution. FolderGridOrganizer verifier = createFolderGridOrganizer( - mActivityContext.getDeviceProfile()).setFolderInfo(mInfo); + InvariantDeviceProfile.INSTANCE.get(mActivityContext.asContext()) + .getDeviceProfile(mActivityContext.asContext()) + ).setFolderInfo(mInfo); ArrayList items = new ArrayList<>(); int total = mInfo.getContents().size();