codecheck

Signed-off-by: MisterE <smart_e@126.com>
This commit is contained in:
MisterE 2024-11-13 10:57:21 +08:00
commit a646b4b0df
2 changed files with 15 additions and 1 deletions

View File

@ -166,6 +166,7 @@ private:
int32_t OnContinueDataCmd(std::shared_ptr<DSchedContinueDataCmd> cmd); int32_t OnContinueDataCmd(std::shared_ptr<DSchedContinueDataCmd> cmd);
int32_t OnNotifyComplete(int32_t missionId, bool isSuccess); int32_t OnNotifyComplete(int32_t missionId, bool isSuccess);
int32_t UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd> cmd); int32_t UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd> cmd);
std::string ContinueTypeFormat(const std::string &continueType);
int32_t OnContinueEndCmd(std::shared_ptr<DSchedContinueEndCmd> cmd); int32_t OnContinueEndCmd(std::shared_ptr<DSchedContinueEndCmd> cmd);
int32_t OnContinueEnd(int32_t result); int32_t OnContinueEnd(int32_t result);

View File

@ -424,6 +424,8 @@ int32_t DSchedContinue::OnNotifyComplete(int32_t missionId, bool isSuccess)
int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd> cmd) int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd> cmd)
{ {
std::string moduleName = cmd->want_.GetStringParam(OHOS::AAFwk::Want::PARAM_MODULE_NAME); std::string moduleName = cmd->want_.GetStringParam(OHOS::AAFwk::Want::PARAM_MODULE_NAME);
std::string continueType = cmd->continueType_;
std::string formatContinueType = ContinueTypeFormat(continueType);
DmsBundleInfo distributedBundleInfo; DmsBundleInfo distributedBundleInfo;
if (!DmsBmStorage::GetInstance()->GetDistributedBundleInfo( if (!DmsBmStorage::GetInstance()->GetDistributedBundleInfo(
cmd->dstDeviceId_, cmd->dstBundleName_, distributedBundleInfo)) { cmd->dstDeviceId_, cmd->dstBundleName_, distributedBundleInfo)) {
@ -439,7 +441,7 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd>
for (const auto &abilityInfoElement: dmsAbilityInfos) { for (const auto &abilityInfoElement: dmsAbilityInfos) {
std::vector<std::string> continueTypes = abilityInfoElement.continueType; std::vector<std::string> continueTypes = abilityInfoElement.continueType;
for (const auto &continueTypeElement: continueTypes) { for (const auto &continueTypeElement: continueTypes) {
if (continueTypeElement != cmd->continueType_) { if (continueTypeElement != continueType && continueTypeElement != formatContinueType) {
continue; continue;
} }
if (continueTypeElement == abilityInfoElement.abilityName && if (continueTypeElement == abilityInfoElement.abilityName &&
@ -474,6 +476,17 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd>
return ERR_OK; return ERR_OK;
} }
std::string DSchedContinue::ContinueTypeFormat(const std::string &continueType)
{
std::string suffix = QUICK_START_CONFIGURATION;
if (suffix.length() <= continueType.length() &&
continueType.rfind(suffix) == (continueType.length() - suffix.length())) {
return continueType.substr(0, continueType.rfind(QUICK_START_CONFIGURATION));
} else {
return continueType + QUICK_START_CONFIGURATION;
}
}
int32_t DSchedContinue::OnContinueEndCmd(std::shared_ptr<DSchedContinueEndCmd> cmd) int32_t DSchedContinue::OnContinueEndCmd(std::shared_ptr<DSchedContinueEndCmd> cmd)
{ {
HILOGI("called"); HILOGI("called");