Signed-off-by: chenzexin <chenzexin14@huawei.com>
This commit is contained in:
chenzexin 2024-11-23 18:55:15 +08:00
parent 88527dfda6
commit 8946432fdd
3 changed files with 4 additions and 3 deletions

View File

@ -3026,6 +3026,7 @@ void AbilityRecord::SetWantAppIndex(const int32_t appIndex)
int32_t AbilityRecord::GetWantAppIndex() const
{
std::lock_guard guard(wantLock_);
return want_.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, 0);
}

View File

@ -1108,7 +1108,7 @@ private:
int32_t appRecordId_ = 0;
std::string processName_; // the name of this process
std::string specifiedProcessFlag_; // the flag of specified Process
std::string customProcessFlag_;
std::string customProcessFlag_; // the flag of custom process
std::unordered_set<sptr<IRemoteObject>, RemoteObjHash> foregroundingAbilityTokens_;
std::weak_ptr<AppMgrServiceInner> appMgrServiceInner_;
sptr<AppDeathRecipient> appDeathRecipient_ = nullptr;

View File

@ -116,7 +116,7 @@ std::shared_ptr<AppRunningRecord> AppRunningManager::CheckAppRunningRecordIsExis
auto jointUserId = bundleInfo.jointUserId;
TAG_LOGD(AAFwkTag::APPMGR, "jointUserId : %{public}s", jointUserId.c_str());
ClipStringContent(rule, bundleInfo.appId, signCode);
auto FindSameProcess = [signCode, specifiedProcessFlag, processName, jointUserId, customProcessFlag]
auto findSameProcess = [signCode, specifiedProcessFlag, processName, jointUserId, customProcessFlag]
(const auto &pair) {
return (pair.second != nullptr) &&
(specifiedProcessFlag.empty() || pair.second->GetSpecifiedProcessFlag() == specifiedProcessFlag) &&
@ -127,7 +127,7 @@ std::shared_ptr<AppRunningRecord> AppRunningManager::CheckAppRunningRecordIsExis
};
auto appRunningMap = GetAppRunningRecordMap();
if (!jointUserId.empty()) {
auto iter = std::find_if(appRunningMap.begin(), appRunningMap.end(), FindSameProcess);
auto iter = std::find_if(appRunningMap.begin(), appRunningMap.end(), findSameProcess);
return ((iter == appRunningMap.end()) ? nullptr : iter->second);
}
for (const auto &item : appRunningMap) {