!7449 卸载恢复预制应用判断逻辑修正

Merge pull request !7449 from amao/uninstallUpdate
This commit is contained in:
openharmony_ci 2024-11-12 06:39:44 +00:00 committed by Gitee
commit bfc1759496
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1515,9 +1515,12 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall(
LOG_W(BMS_TAG_INSTALLER, "uninstall bundle info missing");
return ERR_APPEXECFWK_UNINSTALL_MISSING_INSTALLED_BUNDLE;
}
if (installParam.GetIsUninstallAndRecover() && !oldInfo.IsPreInstallApp()) {
LOG_E(BMS_TAG_INSTALLER, "UninstallAndRecover bundle is not pre-install app");
return ERR_APPEXECFWK_UNINSTALL_AND_RECOVER_NOT_PREINSTALLED_BUNDLE;
if (installParam.GetIsUninstallAndRecover()) {
PreInstallBundleInfo preInstallBundleInfo;
if (!dataMgr_->GetPreInstallBundleInfo(bundleName, preInstallBundleInfo)) {
LOG_E(BMS_TAG_INSTALLER, "UninstallAndRecover %{public}s is not pre-install app", bundleName.c_str());
return ERR_APPEXECFWK_UNINSTALL_AND_RECOVER_NOT_PREINSTALLED_BUNDLE;
}
}
oldApplicationReservedFlag_ = oldInfo.GetApplicationReservedFlag();
bundleType_ = oldInfo.GetApplicationBundleType();