properly check for archiving support

This commit is contained in:
MrSluffy committed 2024-12-27 10:44:48 +08:00
1 parent a7c80d909b
commit 7169349f02
2 files changed
+41 -33

No files matched your search

+17 -13
View File
@@ -731,21 +731,25 @@ public class LoaderTask implements Runnable {
LauncherActivityInfo app = apps.get(i);
AppInfo appInfo = new AppInfo(app, mUserCache.getUserInfo(user),
ApiWrapper.INSTANCE.get(mApp.getContext()), mPmHelper, quietMode);
if (Flags.enableSupportForArchiving()) {
if (app.getApplicationInfo().isArchived) {
// For archived apps, include progress info in case there is a pending
// install session post restart of device.
String appPackageName = app.getApplicationInfo().packageName;
SessionInfo si = mInstallingPkgsCached != null ? mInstallingPkgsCached.get(
new PackageUserKey(appPackageName, user))
: mSessionHelper.getActiveSessionInfo(user,
appPackageName);
if (si != null) {
appInfo.runtimeStatusFlags |= FLAG_INSTALL_SESSION_ACTIVE;
appInfo.setProgressLevel((int) (si.getProgress() * 100),
PackageInstallInfo.STATUS_INSTALLING);
try {
if (Flags.enableSupportForArchiving()) {
if (app.getApplicationInfo().isArchived) {
// For archived apps, include progress info in case there is a pending
// install session post restart of device.
String appPackageName = app.getApplicationInfo().packageName;
SessionInfo si = mInstallingPkgsCached != null ? mInstallingPkgsCached.get(
new PackageUserKey(appPackageName, user))
: mSessionHelper.getActiveSessionInfo(user,
appPackageName);
if (si != null) {
appInfo.runtimeStatusFlags |= FLAG_INSTALL_SESSION_ACTIVE;
appInfo.setProgressLevel((int) (si.getProgress() * 100),
PackageInstallInfo.STATUS_INSTALLING);
}
}
}
} catch (Throwable e) {
// Ignore any exceptions while trying to get the session info.
}
iconRequestInfos.add(new IconRequestInfo<>(