noSkipsKill变量名修改

Signed-off-by: Zhou Shihui <zhoushihui4@huawei.com>
This commit is contained in:
Zhou Shihui 2024-09-02 16:35:10 +08:00
parent ee8cb21a56
commit cf43228108
14 changed files with 71 additions and 71 deletions

View File

@ -101,7 +101,7 @@ private:
// should force uninstall when delete userinfo.
bool forceExecuted = false;
// OTA upgrade skips the killing process
bool noSkipsKill = true;
bool killProcess = true;
// system app can be uninstalled when uninstallUpdates
bool isUninstallAndRecover = false;
@ -118,15 +118,15 @@ public:
}
}
bool GetNoSkipsKill() const
bool GetKillProcess() const
{
return noSkipsKill;
return killProcess;
}
void SetNoSkipsKill(bool value)
void SetKillProcess(bool value)
{
if (CheckPermission()) {
noSkipsKill = value;
killProcess = value;
}
}

View File

@ -250,7 +250,7 @@ private:
* @return Returns ERR_OK if the bundle updating successfully; returns error code otherwise.
*/
ErrCode ProcessBundleUpdateStatus(InnerBundleInfo &oldInfo,
InnerBundleInfo &newInfo, bool isReplace, bool noSkipsKill = true);
InnerBundleInfo &newInfo, bool isReplace, bool killProcess = true);
/**
* @brief Remove a whole bundle.
* @param info Indicates the InnerBundleInfo object of a bundle.
@ -324,7 +324,7 @@ private:
* @return Returns ERR_OK if the module updating successfully; returns error code otherwise.
*/
ErrCode ProcessModuleUpdate(InnerBundleInfo &newInfo,
InnerBundleInfo &oldInfo, bool isReplace, bool noSkipsKill = true);
InnerBundleInfo &oldInfo, bool isReplace, bool killProcess = true);
/**
* @brief The real procedure for bundle install by bundleName.
* @param bundleName Indicates the bundleName the application to install.
@ -491,7 +491,7 @@ private:
* @param packageVec Indicates the array of package names of the high version entry or feature hap.
* @return Returns ERR_OK if uninstall successfully; returns error code otherwise.
*/
ErrCode UninstallLowerVersionFeature(const std::vector<std::string> &packageVec, bool noSkipsKill = false);
ErrCode UninstallLowerVersionFeature(const std::vector<std::string> &packageVec, bool killProcess = false);
/**
* @brief To get userId.
* @param installParam Indicates the installParam of the bundle.
@ -554,7 +554,7 @@ private:
*/
void SaveHapPathToRecords(
bool isPreInstallApp, const std::unordered_map<std::string, InnerBundleInfo> &infos);
void OnSingletonChange(bool noSkipsKill);
void OnSingletonChange(bool killProcess);
bool AllowSingletonChange(const std::string &bundleName);
void MarkPreInstallState(const std::string &bundleName, bool isUninstalled);
ErrCode UninstallAllSandboxApps(const std::string &bundleName, int32_t userId = Constants::INVALID_USERID);

View File

@ -217,7 +217,7 @@ bool RecentlyUnuseBundleAgingHandler::UnInstallBundle(const std::string &bundleN
installParam.userId = Constants::ALL_USERID;
installParam.installFlag = InstallFlag::FREE_INSTALL;
installParam.isAgingUninstall = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
bundleInstaller->Uninstall(bundleName, installParam, unInstallReceiverImpl);
if (unInstallReceiverImpl->IsRunning()) {
APP_LOGD("Wait for UnInstallBundle end %{public}s", bundleName.c_str());

View File

@ -220,7 +220,7 @@ ErrCode BaseBundleInstaller::InstallBundle(
}
if (result == ERR_OK) {
OnSingletonChange(installParam.GetNoSkipsKill());
OnSingletonChange(installParam.GetKillProcess());
}
if (!bundlePaths.empty()) {
@ -920,7 +920,7 @@ ErrCode BaseBundleInstaller::InnerProcessBundleInstall(std::unordered_map<std::s
installParam.installFlag == InstallFlag::FREE_INSTALL);
// app exist, but module may not
if ((result = ProcessBundleUpdateStatus(
bundleInfo, newInfo, isReplace, installParam.GetNoSkipsKill())) != ERR_OK) {
bundleInfo, newInfo, isReplace, installParam.GetKillProcess())) != ERR_OK) {
break;
}
}
@ -1229,7 +1229,7 @@ ErrCode BaseBundleInstaller::ProcessBundleInstall(const std::vector<std::string>
// delete low-version hap or hsp when higher-version hap or hsp installed
if (!uninstallModuleVec_.empty()) {
UninstallLowerVersionFeature(uninstallModuleVec_, installParam.GetNoSkipsKill());
UninstallLowerVersionFeature(uninstallModuleVec_, installParam.GetKillProcess());
}
// create data group dir
@ -1460,13 +1460,13 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall(
uid = curInnerBundleUserInfo.uid;
if (!installParam.GetForceExecuted() &&
!oldInfo.IsRemovable() && installParam.GetNoSkipsKill() && !installParam.GetIsUninstallAndRecover()) {
!oldInfo.IsRemovable() && installParam.GetKillProcess() && !installParam.GetIsUninstallAndRecover()) {
LOG_E(BMS_TAG_INSTALLER, "uninstall system app");
return ERR_APPEXECFWK_UNINSTALL_SYSTEM_APP_ERROR;
}
if (!installParam.GetForceExecuted() &&
!oldInfo.GetUninstallState() && installParam.GetNoSkipsKill() && !installParam.GetIsUninstallAndRecover()) {
!oldInfo.GetUninstallState() && installParam.GetKillProcess() && !installParam.GetIsUninstallAndRecover()) {
LOG_E(BMS_TAG_INSTALLER, "bundle : %{public}s can not be uninstalled, uninstallState : %{public}d",
bundleName.c_str(), oldInfo.GetUninstallState());
return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL;
@ -1478,7 +1478,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall(
}
// reboot scan case will not kill the bundle
if (installParam.GetNoSkipsKill()) {
if (installParam.GetKillProcess()) {
// kill the bundle process during uninstall.
if (!AbilityManagerHelper::UninstallApplicationProcesses(oldInfo.GetApplicationName(), uid)) {
LOG_E(BMS_TAG_INSTALLER, "can not kill process, uid : %{public}d", uid);
@ -1627,13 +1627,13 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall(
uid = curInnerBundleUserInfo.uid;
if (!installParam.GetForceExecuted()
&& !oldInfo.IsRemovable() && installParam.GetNoSkipsKill()) {
&& !oldInfo.IsRemovable() && installParam.GetKillProcess()) {
LOG_E(BMS_TAG_INSTALLER, "uninstall system app");
return ERR_APPEXECFWK_UNINSTALL_SYSTEM_APP_ERROR;
}
if (!installParam.GetForceExecuted() &&
!oldInfo.GetUninstallState() && installParam.GetNoSkipsKill() && !installParam.GetIsUninstallAndRecover()) {
!oldInfo.GetUninstallState() && installParam.GetKillProcess() && !installParam.GetIsUninstallAndRecover()) {
LOG_E(BMS_TAG_INSTALLER, "bundle : %{public}s can not be uninstalled, uninstallState : %{public}d",
bundleName.c_str(), oldInfo.GetUninstallState());
return ERR_BUNDLE_MANAGER_APP_CONTROL_DISALLOWED_UNINSTALL;
@ -1658,7 +1658,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUninstall(
ScopeGuard stateGuard([&] { dataMgr_->UpdateBundleInstallState(bundleName, InstallState::INSTALL_SUCCESS); });
// reboot scan case will not kill the bundle
if (installParam.GetNoSkipsKill()) {
if (installParam.GetKillProcess()) {
// kill the bundle process during uninstall.
if (!AbilityManagerHelper::UninstallApplicationProcesses(oldInfo.GetApplicationName(), uid)) {
LOG_E(BMS_TAG_INSTALLER, "can not kill process, uid : %{public}d", uid);
@ -2024,7 +2024,7 @@ bool BaseBundleInstaller::AllowSingletonChange(const std::string &bundleName)
}
ErrCode BaseBundleInstaller::ProcessBundleUpdateStatus(
InnerBundleInfo &oldInfo, InnerBundleInfo &newInfo, bool isReplace, bool noSkipsKill)
InnerBundleInfo &oldInfo, InnerBundleInfo &newInfo, bool isReplace, bool killProcess)
{
if (!InitDataMgr()) {
return ERR_APPEXECFWK_INSTALL_STATE_ERROR;
@ -2068,7 +2068,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUpdateStatus(
if (!CheckAppIdentifier(oldInfo, newInfo)) {
return ERR_APPEXECFWK_INSTALL_FAILED_INCONSISTENT_SIGNATURE;
}
LOG_D(BMS_TAG_INSTALLER, "ProcessBundleUpdateStatus noSkipsKill = %{public}d", noSkipsKill);
LOG_D(BMS_TAG_INSTALLER, "ProcessBundleUpdateStatus killProcess = %{public}d", killProcess);
// now there are two cases for updating:
// 1. bundle exist, hap exist, update hap
// 2. bundle exist, install new hap
@ -2078,7 +2078,7 @@ ErrCode BaseBundleInstaller::ProcessBundleUpdateStatus(
}
newInfo.RestoreFromOldInfo(oldInfo);
result = isModuleExist ? ProcessModuleUpdate(newInfo, oldInfo,
isReplace, noSkipsKill) : ProcessNewModuleInstall(newInfo, oldInfo);
isReplace, killProcess) : ProcessNewModuleInstall(newInfo, oldInfo);
if (result != ERR_OK) {
LOG_E(BMS_TAG_INSTALLER, "install module failed %{public}d", result);
return result;
@ -2172,7 +2172,7 @@ ErrCode BaseBundleInstaller::ProcessNewModuleInstall(InnerBundleInfo &newInfo, I
}
ErrCode BaseBundleInstaller::ProcessModuleUpdate(InnerBundleInfo &newInfo,
InnerBundleInfo &oldInfo, bool isReplace, bool noSkipsKill)
InnerBundleInfo &oldInfo, bool isReplace, bool killProcess)
{
LOG_D(BMS_TAG_INSTALLER, "bundleName :%{public}s, moduleName: %{public}s, userId: %{public}d",
newInfo.GetBundleName().c_str(), newInfo.GetCurrentModulePackage().c_str(), userId_);
@ -2221,9 +2221,9 @@ ErrCode BaseBundleInstaller::ProcessModuleUpdate(InnerBundleInfo &newInfo,
CHECK_RESULT(result, "UpdateOverlayModule failed %{public}d");
#endif
LOG_D(BMS_TAG_INSTALLER, "ProcessModuleUpdate noSkipsKill = %{public}d", noSkipsKill);
LOG_D(BMS_TAG_INSTALLER, "ProcessModuleUpdate killProcess = %{public}d", killProcess);
// reboot scan case will not kill the bundle
if (noSkipsKill) {
if (killProcess) {
// kill the bundle process during updating
if (!AbilityManagerHelper::UninstallApplicationProcesses(
oldInfo.GetApplicationName(), oldInfo.GetUid(userId_), true)) {
@ -4057,7 +4057,7 @@ ErrCode BaseBundleInstaller::CheckVersionCompatibilityForHmService(const InnerBu
return ERR_OK;
}
ErrCode BaseBundleInstaller::UninstallLowerVersionFeature(const std::vector<std::string> &packageVec, bool noSkipsKill)
ErrCode BaseBundleInstaller::UninstallLowerVersionFeature(const std::vector<std::string> &packageVec, bool killProcess)
{
LOG_D(BMS_TAG_INSTALLER, "start to uninstall lower version feature hap");
if (!InitDataMgr()) {
@ -4075,7 +4075,7 @@ ErrCode BaseBundleInstaller::UninstallLowerVersionFeature(const std::vector<std:
}
// kill the bundle process during uninstall.
if (noSkipsKill) {
if (killProcess) {
if (!AbilityManagerHelper::UninstallApplicationProcesses(
info.GetApplicationName(), info.GetUid(userId_), true)) {
LOG_W(BMS_TAG_INSTALLER, "can not kill process");
@ -4652,7 +4652,7 @@ void BaseBundleInstaller::ResetInstallProperties()
isAppService_ = false;
}
void BaseBundleInstaller::OnSingletonChange(bool noSkipsKill)
void BaseBundleInstaller::OnSingletonChange(bool killProcess)
{
if (singletonState_ == SingletonState::DEFAULT) {
return;
@ -4668,7 +4668,7 @@ void BaseBundleInstaller::OnSingletonChange(bool noSkipsKill)
InstallParam installParam;
installParam.needSendEvent = false;
installParam.SetForceExecuted(true);
installParam.SetNoSkipsKill(noSkipsKill);
installParam.SetKillProcess(killProcess);
if (singletonState_ == SingletonState::SINGLETON_TO_NON) {
LOG_I(BMS_TAG_INSTALLER, "Bundle changes from singleton app to non singleton app");
installParam.userId = Constants::DEFAULT_USERID;
@ -5500,7 +5500,7 @@ ErrCode BaseBundleInstaller::InstallEntryMoudleFirst(std::unordered_map<std::str
bool isReplace = (installParam.installFlag == InstallFlag::REPLACE_EXISTING ||
installParam.installFlag == InstallFlag::FREE_INSTALL);
// app exist, but module may not
result = ProcessBundleUpdateStatus(bundleInfo, newInfo, isReplace, installParam.GetNoSkipsKill());
result = ProcessBundleUpdateStatus(bundleInfo, newInfo, isReplace, installParam.GetKillProcess());
if (result == ERR_OK) {
entryModuleName_ = info.second.GetCurrentModulePackage();
LOG_D(BMS_TAG_INSTALLER, "entry packageName is %{public}s", entryModuleName_.c_str());

View File

@ -1042,7 +1042,7 @@ void BMSEventHandler::ProcessSystemBundleInstall(
InstallParam installParam;
installParam.userId = userId;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.removable = preScanInfo.removable;
installParam.needSavePreInstallInfo = true;
@ -1062,7 +1062,7 @@ void BMSEventHandler::ProcessSystemBundleInstall(
InstallParam installParam;
installParam.userId = userId;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.removable = false;
installParam.needSavePreInstallInfo = true;
@ -1080,7 +1080,7 @@ void BMSEventHandler::ProcessSystemSharedBundleInstall(const std::string &shared
LOG_I(BMS_TAG_DEFAULT, "Process system shared bundle by sharedBundlePath(%{public}s)", sharedBundlePath.c_str());
InstallParam installParam;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.removable = false;
installParam.needSavePreInstallInfo = true;
@ -2800,7 +2800,7 @@ bool BMSEventHandler::OTAInstallSystemBundle(
InstallParam installParam;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.installFlag = InstallFlag::REPLACE_EXISTING;
installParam.removable = removable;
@ -2828,7 +2828,7 @@ bool BMSEventHandler::OTAInstallSystemBundleNeedCheckUser(
InstallParam installParam;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.installFlag = InstallFlag::REPLACE_EXISTING;
installParam.removable = removable;
@ -3372,7 +3372,7 @@ void BMSEventHandler::ProcessRebootQuickFixBundleInstall(const std::string &path
continue;
}
InstallParam installParam;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.installFlag = InstallFlag::REPLACE_EXISTING;
installParam.copyHapToInstallPath = true;
@ -3553,7 +3553,7 @@ void BMSEventHandler::ProcessRebootQuickFixUnInstallAndRecover(const std::string
// If metadata name has quickfix flag, it should be uninstall and recover.
InstallParam installParam;
installParam.SetIsUninstallAndRecover(true);
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installer->UninstallAndRecover(bundleName, installParam, innerReceiverImpl);
}
@ -3565,7 +3565,7 @@ void BMSEventHandler::InnerProcessRebootUninstallWrongBundle()
{
InstallParam installParam;
installParam.userId = Constants::DEFAULT_USERID;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
std::vector<std::string> wrongBundleNameList;
wrongBundleNameList.emplace_back(Constants::SCENE_BOARD_BUNDLE_NAME);

View File

@ -91,7 +91,7 @@ ErrCode HmpBundleInstaller::InstallNormalAppInHmp(const std::string &bundleDir,
}
InstallParam installParam;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = true;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;
@ -311,7 +311,7 @@ bool HmpBundleInstaller::UninstallSystemBundle(const std::string &bundleName, co
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
MarkPreBundleSyeEventBootTag(false);
ErrCode result = UninstallBundle(bundleName, modulePackage, installParam);
@ -355,7 +355,7 @@ void HmpBundleInstaller::CheckUninstallSystemHsp(const std::string &bundleName)
installParam.userId = Constants::DEFAULT_USERID;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = true;
MarkPreBundleSyeEventBootTag(false);

View File

@ -153,7 +153,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName)
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = true;
MarkPreBundleSyeEventBootTag(false);
@ -180,7 +180,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName,
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = isKeepData;
MarkPreBundleSyeEventBootTag(false);
@ -207,7 +207,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName,
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = true;
MarkPreBundleSyeEventBootTag(false);
@ -268,7 +268,7 @@ void SystemBundleInstaller::CheckUninstallSystemHsp(const std::string &bundleNam
installParam.userId = Constants::DEFAULT_USERID;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = true;
MarkPreBundleSyeEventBootTag(false);

View File

@ -127,7 +127,7 @@ ErrCode BmsBundleAppServiceFwkInstallerTest::InstallSystemBundle(const std::stri
InstallParam installParam;
installParam.userId = userId;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;

View File

@ -114,7 +114,7 @@ bool BmsBundleInstallerPermissionTest::InstallSystemBundle(const std::string &fi
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.copyHapToInstallPath = false;
return installer->InstallSystemBundle(
filePath, installParam, Constants::AppType::SYSTEM_APP) == ERR_OK;
@ -131,7 +131,7 @@ bool BmsBundleInstallerPermissionTest::OTAInstallSystemBundle(const std::string
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.copyHapToInstallPath = false;
return installer->OTAInstallSystemBundle(
filePaths, installParam, Constants::AppType::SYSTEM_APP) == ERR_OK;

View File

@ -162,7 +162,7 @@ bool BmsBundleInstallerTest::InstallSystemBundle(const std::string &filePath) co
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;
@ -179,7 +179,7 @@ bool BmsBundleInstallerTest::OTAInstallSystemBundle(const std::string &filePath)
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;
@ -2109,9 +2109,9 @@ HWTEST_F(BmsBundleInstallerTest, baseBundleInstaller_2700, Function | SmallTest
InnerBundleInfo newInfo;
newInfo.currentPackage_ = "";
bool isReplace = false;
bool noSkipsKill = false;
bool killProcess = false;
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, noSkipsKill);
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, killProcess);
EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_PARAM_ERROR);
}
@ -2128,9 +2128,9 @@ HWTEST_F(BmsBundleInstallerTest, baseBundleInstaller_2800, Function | SmallTest
InnerBundleInfo newInfo;
newInfo.currentPackage_ = MODULE_NAME;
bool isReplace = false;
bool noSkipsKill = false;
bool killProcess = false;
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, noSkipsKill);
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, killProcess);
EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_SINGLETON_INCOMPATIBLE);
}
@ -2147,9 +2147,9 @@ HWTEST_F(BmsBundleInstallerTest, baseBundleInstaller_2900, Function | SmallTest
newInfo.currentPackage_ = MODULE_NAME;
newInfo.baseApplicationInfo_->singleton = true;
bool isReplace = false;
bool noSkipsKill = false;
bool killProcess = false;
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, noSkipsKill);
auto res = installer.ProcessBundleUpdateStatus(oldInfo, newInfo, isReplace, killProcess);
EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_SINGLETON_INCOMPATIBLE);
installer.modulePackage_ = MODULE_NAME;
@ -4724,9 +4724,9 @@ HWTEST_F(BmsBundleInstallerTest, ProcessModuleUpdate_0020, Function | SmallTest
InnerBundleInfo innerBundleInfo;
InnerBundleInfo oldInfo;
bool isReplace = true;
bool noSkipsKill = false;
bool killProcess = false;
innerBundleInfo.userId_ = USERID;
ErrCode res = installer.ProcessModuleUpdate(innerBundleInfo, oldInfo, isReplace, noSkipsKill);
ErrCode res = installer.ProcessModuleUpdate(innerBundleInfo, oldInfo, isReplace, killProcess);
EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_INCONSISTENT_MODULE_NAME);
}
@ -4848,11 +4848,11 @@ HWTEST_F(BmsBundleInstallerTest, CheckApiInfo_0010, Function | SmallTest | Level
{
BaseBundleInstaller installer;
installer.singletonState_ = AppExecFwk::BaseBundleInstaller::SingletonState::SINGLETON_TO_NON;
bool noSkipsKill = false;
bool killProcess = false;
std::unordered_map<std::string, InnerBundleInfo> info;
InnerBundleInfo innerBundleInfo;
innerBundleInfo.baseApplicationInfo_->compileSdkType = "OpenHarmony";
installer.OnSingletonChange(noSkipsKill);
installer.OnSingletonChange(killProcess);
info.try_emplace("OpenHarmony", innerBundleInfo);
bool res = installer.CheckApiInfo(info);
@ -4868,12 +4868,12 @@ HWTEST_F(BmsBundleInstallerTest, CheckApiInfo_0030, Function | SmallTest | Level
{
BaseBundleInstaller installer;
installer.singletonState_ = AppExecFwk::BaseBundleInstaller::SingletonState::NON_TO_SINGLETON;
bool noSkipsKill = false;
bool killProcess = false;
std::unordered_map<std::string, InnerBundleInfo> info;
InnerBundleInfo innerBundleInfo;
innerBundleInfo.baseApplicationInfo_->compileSdkType = "OpenHarmony1";
innerBundleInfo.baseBundleInfo_->compatibleVersion = COMPATIBLE_VERSION;
installer.OnSingletonChange(noSkipsKill);
installer.OnSingletonChange(killProcess);
info.try_emplace("OpenHarmony2", innerBundleInfo);
bool res = installer.CheckApiInfo(info);
@ -6608,7 +6608,7 @@ HWTEST_F(BmsBundleInstallerTest, SendStartInstallNotify_0100, Function | SmallTe
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(true);
installParam.SetKillProcess(true);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;

View File

@ -131,7 +131,7 @@ bool BmsBundleOtaUpdateTest::InstallSystemBundle(const std::string &filePath) co
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;
@ -146,7 +146,7 @@ bool BmsBundleOtaUpdateTest::OTAInstallSystemBundle(const std::vector<std::strin
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;
@ -512,7 +512,7 @@ HWTEST_F(BmsBundleOtaUpdateTest, SUB_BMS_OTA_0009, Function | SmallTest | Level3
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.copyHapToInstallPath = false;
auto installer = std::make_unique<SystemBundleInstaller>();

View File

@ -138,7 +138,7 @@ bool BmsBundleManagerTest::InstallSystemBundle(const std::string &filePath) cons
InstallParam installParam;
installParam.userId = USERID;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.needSavePreInstallInfo = true;
installParam.copyHapToInstallPath = false;

View File

@ -95,7 +95,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName)
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
MarkPreBundleSyeEventBootTag(false);
ErrCode result = UninstallBundle(bundleName, installParam);
@ -121,7 +121,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName,
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
installParam.isKeepData = isKeepData;
MarkPreBundleSyeEventBootTag(false);
@ -148,7 +148,7 @@ bool SystemBundleInstaller::UninstallSystemBundle(const std::string &bundleName,
installParam.userId = userId;
installParam.needSavePreInstallInfo = true;
installParam.isPreInstallApp = true;
installParam.SetNoSkipsKill(false);
installParam.SetKillProcess(false);
installParam.needSendEvent = false;
MarkPreBundleSyeEventBootTag(false);
ErrCode result = UninstallBundle(bundleName, modulePackage, installParam);

View File

@ -47,7 +47,7 @@ namespace OHOS {
std::string hspPath = ", path: ";
appServiceFwk.ProcessBundleUpdateStatus(oldInfo, newInfo, VERSION_ONE_LIBRARY_ONE_PATH);
bool isReplace = true;
bool noSkipsKill = false;
bool killProcess = false;
appServiceFwk.ProcessModuleUpdate(innerBundleInfo, oldInfo, hspPath);
appServiceFwk.RemoveLowerVersionSoDir(VERSION_LOW);
std::string bundlePath(data, size);