diff --git a/common/include/dtbschedmgr_log.h b/common/include/dtbschedmgr_log.h index 1b22f8ec..adfc9a82 100644 --- a/common/include/dtbschedmgr_log.h +++ b/common/include/dtbschedmgr_log.h @@ -525,6 +525,10 @@ enum { * Result(29360237) for not get mgr. */ DMS_NOT_GET_MANAGER = 29360237, + /** + * Result(29360238) for BMS can not find the specified module. + */ + CAN_NOT_FOUND_MODULE_ERR = 29360238, }; } // namespace DistributedSchedule } // namespace OHOS diff --git a/services/dtbschedmgr/src/continue/dsched_continue.cpp b/services/dtbschedmgr/src/continue/dsched_continue.cpp index 2bbaafd2..8aa9cfac 100644 --- a/services/dtbschedmgr/src/continue/dsched_continue.cpp +++ b/services/dtbschedmgr/src/continue/dsched_continue.cpp @@ -390,9 +390,6 @@ int32_t DSchedContinue::OnContinueDataCmd(std::shared_ptr int32_t DSchedContinue::PostContinueDataTask(std::shared_ptr cmd) { DSchedContinueEventType eventType = DSCHED_CONTINUE_DATA_EVENT; - if (UpdateElementInfo(cmd) != ERR_OK) { - return INVALID_PARAMETERS_ERR; - } HILOGI("PostContinueDataTask %{public}d, continueInfo %{public}s; ", eventType, continueInfo_.toString().c_str()); if (eventHandler_ == nullptr) { HILOGE("PostContinueDataTask eventHandler is nullptr"); @@ -415,7 +412,7 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr cmd->dstDeviceId_, cmd->dstBundleName_, distributedBundleInfo)) { HILOGE("UpdateElementInfo can not found bundle info for bundle name: %{public}s", cmd->dstBundleName_.c_str()); - return INVALID_PARAMETERS_ERR; + return CAN_NOT_FOUND_MODULE_ERR; } std::vector dmsAbilityInfos = distributedBundleInfo.dmsAbilityInfos; @@ -425,22 +422,23 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr for (const auto &abilityInfoElement: dmsAbilityInfos) { std::vector continueTypes = abilityInfoElement.continueType; for (const auto &continueTypeElement: continueTypes) { - if (continueTypeElement == cmd->continueType_) { - if (continueTypeElement == abilityInfoElement.abilityName && - moduleName == abilityInfoElement.moduleName) { - sameAbilityGot = true; - result.push_back(abilityInfoElement); - break; - } else if (continueTypeElement != abilityInfoElement.abilityName && - moduleName == abilityInfoElement.moduleName) { - hasSameModule = true; - result.clear(); - result.push_back(abilityInfoElement); - break; - } else if (continueTypeElement != abilityInfoElement.abilityName) { - result.push_back(abilityInfoElement); - break; - } + if (continueTypeElement != cmd->continueType_) { + continue; + } + if (continueTypeElement == abilityInfoElement.abilityName && + moduleName == abilityInfoElement.moduleName) { + sameAbilityGot = true; + result.push_back(abilityInfoElement); + break; + } else if (continueTypeElement != abilityInfoElement.abilityName && + moduleName == abilityInfoElement.moduleName) { + hasSameModule = true; + result.clear(); + result.push_back(abilityInfoElement); + break; + } else if (continueTypeElement != abilityInfoElement.abilityName) { + result.push_back(abilityInfoElement); + break; } } if (sameAbilityGot || hasSameModule) { @@ -450,7 +448,7 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr if (result.empty()) { HILOGE("UpdateElementInfo can not found bundle info for bundle name: %{public}s", cmd->dstBundleName_.c_str()); - return INVALID_PARAMETERS_ERR; + return CAN_NOT_FOUND_MODULE_ERR; } auto element = cmd->want_.GetElement(); DmsAbilityInfo finalAbility = result[0]; @@ -978,6 +976,10 @@ int32_t DSchedContinue::ExecuteContinueData(std::shared_ptr