Patch fix for Android 13 and below (#4978)

* Patch fix for Android 13 and below
tested in Android 9, 10 and 13 and works fine.

* fix crash dragging the icons from drawer to home screen

* use LawnchairWindowManagerProxy

---------

Co-authored-by: MrSluffy <werdna.jac@gmail.com>
This commit is contained in:
Rafael de Moura DevandMrSluffy authored and GitHub committed 2024-11-17 09:05:31 +08:00
1 parent 71fbccb5a3
commit 795fdb2948
37 files changed
+605 -198

No files matched your search

@@ -106,6 +106,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.stream.Collectors;
import app.lawnchair.preferences.PreferenceManager;
@@ -442,9 +443,10 @@ public class LoaderTask implements Runnable {
mInstallingPkgsCached = installingPkgs;
}
installingPkgs.forEach(mApp.getIconCache()::updateSessionCache);
FileLog.d(TAG, "loadWorkspace: Packages with active install sessions: "
if (Utilities.ATLEAST_U) {
FileLog.d(TAG, "loadWorkspace: Packages with active install sessions: "
+ installingPkgs.keySet().stream().map(info -> info.mPackageName).toList());
}
mFirstScreenBroadcast = new FirstScreenBroadcast(installingPkgs);
mShortcutKeyToPinnedShortcuts = new HashMap<>();
@@ -574,8 +576,15 @@ public class LoaderTask implements Runnable {
private void processFolderItems() {
// Sort the folder items, update ranks, and make sure all preview items are high
// res.
List<FolderGridOrganizer> verifiers = mApp.getInvariantDeviceProfile().supportedProfiles
List<FolderGridOrganizer> verifiers;
if (Utilities.ATLEAST_U) {
verifiers = mApp.getInvariantDeviceProfile().supportedProfiles
.stream().map(FolderGridOrganizer::new).toList();
} else {
verifiers = mApp.getInvariantDeviceProfile().supportedProfiles
.stream().map(FolderGridOrganizer::new).collect(Collectors.toList());
}
for (CollectionInfo collection : mBgDataModel.collections) {
if (!(collection instanceof FolderInfo folder)) {
continue;