Merge "Fix incorrect launcher loading." into sc-dev

This commit is contained in:
TreeHugger Robot 2021-01-29 18:13:02 +00:00 committed by Android (Google) Code Review
commit 26801f802e
2 changed files with 9 additions and 10 deletions

View File

@ -588,27 +588,26 @@ 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;
~ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE;
} else if (activityInfo == null) {
int installProgress = (int) (si.getProgress() * 100);
info.setProgressLevel(
installProgress,
PackageInstallInfo.STATUS_INSTALLING);
} else {
info.setProgressLevel(
PackageManagerHelper
.getLoadingProgress(activityInfo),
PackageInstallInfo
.STATUS_INSTALLED_DOWNLOADING);
}
}

View File

@ -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