diff --git a/bundle.json b/bundle.json index 0d14d377af..3a60745559 100644 --- a/bundle.json +++ b/bundle.json @@ -104,8 +104,7 @@ "zlib" ], "third_party": [ - "libjpeg-turbo", - "googletest" + "libjpeg-turbo" ] }, "build": { diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index ce3c6af8b4..f04e192188 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -1931,8 +1931,6 @@ private: std::atomic willKillPidsNum_ = 0; std::shared_ptr delayKillTaskHandler_; std::unordered_set nwebPreloadSet_ {}; - ffrt::mutex killedBundleSetMutex_; - std::set killedBundleSet_; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 3db73a0eb0..1be7f7d0a4 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -628,13 +628,6 @@ void AppMgrServiceInner::LoadAbility(std::shared_ptr abilityInfo, s TAG_LOGE(AAFwkTag::APPMGR, "checkLoadAbilityConditions fail"); return; } - { - std::lock_guard lock(killedBundleSetMutex_); - if (killedBundleSet_.find(abilityInfo->bundleName) != killedBundleSet_.end()) { - TAG_LOGW(AAFwkTag::APPMGR, "%{public}s is being killed", abilityInfo->bundleName.c_str()); - return; - } - } if (abilityInfo->type == AbilityType::PAGE) { AbilityRuntime::FreezeUtil::LifecycleFlow flow = {loadParam->token, AbilityRuntime::FreezeUtil::TimeoutState::LOAD}; @@ -2927,25 +2920,16 @@ int32_t AppMgrServiceInner::KillProcessesInBatch(const std::vector &pid TAG_LOGE(AAFwkTag::APPMGR, "not supported."); return AAFwk::ERR_CAPABILITY_NOT_SUPPORT; } - std::vector killPids; for (const auto& pid: pids) { auto appRecord = GetAppRunningRecordByPid(pid); if (appRecord == nullptr) { TAG_LOGE(AAFwkTag::APPMGR, "appRecord null"); continue; } - killPids.emplace_back(pid); - std::string bundleName = appRecord->GetBundleName(); - { - std::lock_guard lock(killedBundleSetMutex_); - killedBundleSet_.insert(bundleName); - } - } - std::lock_guard lock(killedBundleSetMutex_); - for (const auto& pid: killPids) { + std::string callerKey = std::to_string(pid) + ":" + std::to_string(appRecord->GetUid()); + KillingProcessManager::GetInstance().AddKillingCallerKey(callerKey); (void)KillProcessByPid(pid, "KillProcessesInBatch"); } - killedBundleSet_.clear(); return ERR_OK; }