From 55fd5f857bb57fb9c363da0dcb7661dffc15586f Mon Sep 17 00:00:00 2001 From: xiaozuo00 Date: Thu, 14 Nov 2024 22:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=B5=84=E6=BA=90=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E3=80=91OTA=E6=97=B6=E5=8F=AA=E5=88=B7=E6=96=B0=E4=B8=BB?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaozuo00 Change-Id: If6017b70f0e8275ca741e8ce98b6386c82ae0b1c --- services/bundlemgr/include/base_bundle_installer.h | 1 + services/bundlemgr/src/base_bundle_installer.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/services/bundlemgr/include/base_bundle_installer.h b/services/bundlemgr/include/base_bundle_installer.h index c98688b91..0694a20cf 100644 --- a/services/bundlemgr/include/base_bundle_installer.h +++ b/services/bundlemgr/include/base_bundle_installer.h @@ -753,6 +753,7 @@ private: const InnerBundleInfo &oldBundleInfo, bool isPreInstallApp); bool DeleteDisposedRuleWhenBundleUpdateEnd(const InnerBundleInfo &oldBundleInfo); + void ProcessAddResourceInfo(const InstallParam &installParam, const std::string &bundleName, int32_t userId); InstallerState state_ = InstallerState::INSTALL_START; std::shared_ptr dataMgr_ = nullptr; // this pointer will get when public functions called diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index c330d1f3b..c3e978a3a 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -1356,7 +1356,7 @@ ErrCode BaseBundleInstaller::ProcessBundleInstall(const std::vector RemoveOldExtensionDirs(); /* process quick fix when install new moudle */ ProcessQuickFixWhenInstallNewModule(installParam, newInfos); - BundleResourceHelper::AddResourceInfoByBundleName(bundleName_, userId_); + ProcessAddResourceInfo(installParam, bundleName_, userId_); VerifyDomain(); MarkInstallFinish(); UtdHandler::InstallUtdAsync(bundleName_, userId_); @@ -6319,5 +6319,14 @@ bool BaseBundleInstaller::DeleteDisposedRuleWhenBundleUpdateEnd(const InnerBundl return true; #endif } + +void BaseBundleInstaller::ProcessAddResourceInfo(const InstallParam &installParam, + const std::string &bundleName, int32_t userId) +{ + if (installParam.isOTA && userId != Constants::START_USERID) { + return; + } + BundleResourceHelper::AddResourceInfoByBundleName(bundleName_, userId_); +} } // namespace AppExecFwk } // namespace OHOS