fix for dataPreloadApp

Signed-off-by: sunjiakun <sunjiakun5@huawei.com>
This commit is contained in:
sunjiakun 2024-11-21 18:13:04 +08:00
parent 7eb42e7209
commit cd43208f2b
3 changed files with 3 additions and 2 deletions

View File

@ -2003,7 +2003,7 @@ ErrCode BaseBundleInstaller::InnerProcessInstallByPreInstallInfo(
innerInstallParam.isPreInstallApp = true;
innerInstallParam.removable = preInstallBundleInfo.IsRemovable();
innerInstallParam.copyHapToInstallPath = false;
innerInstallParam.isDataPreloadHap = IsDataPreloadHap(pathVec.front());
innerInstallParam.isDataPreloadHap = IsDataPreloadHap(pathVec.empty() ? "" : pathVec.front());
ErrCode resultCode = ProcessBundleInstall(pathVec, innerInstallParam, preInstallBundleInfo.GetAppType(), uid);
if (resultCode != ERR_OK && innerInstallParam.isDataPreloadHap) {
LOG_E(BMS_TAG_INSTALLER, "set parameter BMS_DATA_PRELOAD false");

View File

@ -1086,7 +1086,7 @@ void BMSEventHandler::ProcessSystemBundleInstall(
installParam.preinstallSourceFlag = ApplicationInfoFlag::FLAG_BOOT_INSTALLED;
SystemBundleInstaller installer;
ErrCode ret = installer.InstallSystemBundle(preScanInfo.bundleDir, installParam, appType);
if (ret != ERR_OK && ret != ERR_APPEXECFWK_INSTALL_ZERO_USER_WITH_NO_SINGLETON) {
if (ret != ERR_OK && ret != ERR_APPEXECFWK_INSTALL_ZERO_USER_WITH_NO_SINGLETON && !preScanInfo.isDataPreloadHap) {
LOG_W(BMS_TAG_DEFAULT, "Install System app:%{public}s error", preScanInfo.bundleDir.c_str());
SavePreInstallException(preScanInfo.bundleDir);
}

View File

@ -161,6 +161,7 @@ void BundleUserMgrHostImpl::OnCreateNewUser(int32_t userId, const std::vector<st
if (!info.GetBundlePaths().empty() && (info.GetBundlePaths().front().find(DATA_PRELOAD_APP) == 0) &&
userId != Constants::START_USERID) {
APP_LOGW("data preload app only install in 100 ,bundleName: %{public}s", info.GetBundleName().c_str());
totalHapNum--;
continue;
}
sptr<UserReceiverImpl> userReceiverImpl(