codecheck

Signed-off-by: MisterE <smart_e@126.com>
This commit is contained in:
MisterE 2024-11-19 20:00:15 +08:00
parent 4c608e7eb5
commit d0fb02f0a3
2 changed files with 10 additions and 6 deletions

View File

@ -434,7 +434,7 @@ int32_t DSchedContinue::UpdateElementInfo(std::shared_ptr<DSchedContinueDataCmd>
srcContinueType.c_str()); srcContinueType.c_str());
DmsBundleInfo distributedBundleInfo; DmsBundleInfo distributedBundleInfo;
if (!DmsBmStorage::GetInstance()->GetDistributedBundleInfo( if (!DmsBmStorage::GetInstance()->GetDistributedBundleInfo(
cmd->dstDeviceId_, cmd->dstBundleName_, distributedBundleInfo)) { cmd->dstDeviceId_, cmd->dstBundleName_, distributedBundleInfo)) {
HILOGE("UpdateElementInfo can not found bundle info for bundle name: %{public}s", HILOGE("UpdateElementInfo can not found bundle info for bundle name: %{public}s",
cmd->dstBundleName_.c_str()); cmd->dstBundleName_.c_str());
return CAN_NOT_FOUND_MODULE_ERR; return CAN_NOT_FOUND_MODULE_ERR;
@ -1008,11 +1008,6 @@ int32_t DSchedContinue::ExecuteContinueData(std::shared_ptr<DSchedContinueDataCm
return INVALID_PARAMETERS_ERR; return INVALID_PARAMETERS_ERR;
} }
if (UpdateElementInfo(cmd) != ERR_OK) {
HILOGE("ExecuteContinueData UpdateElementInfo failed.");
return CAN_NOT_FOUND_MODULE_ERR;
}
DurationDumperBeforeStartAbility(cmd); DurationDumperBeforeStartAbility(cmd);
std::string localDeviceId; std::string localDeviceId;
@ -1022,6 +1017,10 @@ int32_t DSchedContinue::ExecuteContinueData(std::shared_ptr<DSchedContinueDataCm
HILOGE("check deviceId failed"); HILOGE("check deviceId failed");
return INVALID_REMOTE_PARAMETERS_ERR; return INVALID_REMOTE_PARAMETERS_ERR;
} }
if (UpdateElementInfo(cmd) != ERR_OK) {
HILOGE("ExecuteContinueData UpdateElementInfo failed.");
return CAN_NOT_FOUND_MODULE_ERR;
}
int32_t ret = CheckStartPermission(cmd); int32_t ret = CheckStartPermission(cmd);
if (ret != ERR_OK) { if (ret != ERR_OK) {
HILOGE("ExecuteContinueData CheckTargetPermission failed!"); HILOGE("ExecuteContinueData CheckTargetPermission failed!");

View File

@ -653,6 +653,11 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0017_2, TestSize.Level0)
cmd->continueType_ = CONTINUE_TYPE2; cmd->continueType_ = CONTINUE_TYPE2;
cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_DIFF_AS_CONTINUE_TYPE, MODULE_NAME3); cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_DIFF_AS_CONTINUE_TYPE, MODULE_NAME3);
ret = conti->UpdateElementInfo(cmd); ret = conti->UpdateElementInfo(cmd);
EXPECT_EQ(ret, ERR_OK);
// has continueType, no same module
cmd->continueType_ = CONTINUE_TYPE2;
cmd->want_.SetElementName("", BUNDLEMAME_1, CONTINUE_TYPE1, MODULE_NAME3);
ret = conti->UpdateElementInfo(cmd);
EXPECT_EQ(ret, CAN_NOT_FOUND_MODULE_ERR); EXPECT_EQ(ret, CAN_NOT_FOUND_MODULE_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_2 end ret:" << ret << std::endl; DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_2 end ret:" << ret << std::endl;
usleep(WAITTIME); usleep(WAITTIME);