Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d0fec8a authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Fix incorrect launcher loading.

Apps that were installed and downloading incrementally would be shown as fully downloaded on reboot. Updated LoaderTask and AppInfo.updateRuntimeFlagsForActivityTarget to account for this.

Fixes: 178528867

Test: manual with hardcoded values

Change-Id: I088e43ae886b4157bad9f4fa8d40373cf7f8235a
parent 6d0d3b51
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -588,12 +588,17 @@ public class LoaderTask implements Runnable {
                                if (isSafeMode && !isSystemApp(context, intent)) {
                                    info.runtimeStatusFlags |= FLAG_DISABLED_SAFEMODE;
                                }
                                    LauncherActivityInfo activityInfo = c.getLauncherActivityInfo();
                                    if (activityInfo != null) {
                                        info.setProgressLevel(
                                                PackageManagerHelper
                                                    .getLoadingProgress(activityInfo),
                                                PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
                                    }

                                if (c.restoreFlag != 0 && !TextUtils.isEmpty(targetPkg)) {
                                    tempPackageKey.update(targetPkg, c.user);
                                    SessionInfo si = installingPkgs.get(tempPackageKey);
                                        LauncherActivityInfo activityInfo =
                                                c.getLauncherActivityInfo();
                                        if (si == null) {
                                            info.runtimeStatusFlags &=
                                                ~ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE;
@@ -603,12 +608,6 @@ public class LoaderTask implements Runnable {
                                            info.setProgressLevel(
                                                    installProgress,
                                                    PackageInstallInfo.STATUS_INSTALLING);
                                        } else {
                                            info.setProgressLevel(
                                                    PackageManagerHelper
                                                            .getLoadingProgress(activityInfo),
                                                    PackageInstallInfo
                                                            .STATUS_INSTALLED_DOWNLOADING);
                                        }
                                }

+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ public class AppInfo extends ItemInfoWithIcon {
        // Sets the progress level, installation and incremental download flags.
        info.setProgressLevel(
                PackageManagerHelper.getLoadingProgress(lai),
                PackageInstallInfo.STATUS_INSTALLED);
                PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
    }

    @Override