!1117 代码整改优化

Merge pull request !1117 from dengxiaoyu/master
This commit is contained in:
openharmony_ci 2024-10-12 11:31:15 +00:00 committed by Gitee
commit ad126ee669
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 16 additions and 3 deletions

View File

@ -505,6 +505,14 @@ enum {
* Result(29360232) for all connect manager deal connect apply timeout.
*/
DMS_CONNECT_APPLY_TIMEOUT_FAILED = 29360232,
/**
* Result(29360233) for mission continue state is not active.
*/
MISSION_NOT_CONTINUE_ACTIVE = 29360233,
/**
* Result(29360234) for mission is not focused.
*/
MISSION_NOT_FOCUSED = 29360234,
};
} // namespace DistributedSchedule
} // namespace OHOS

View File

@ -723,7 +723,7 @@ int32_t DSchedContinue::CheckContinueAbilityPermission()
if (missionInfo.continueState != AAFwk::ContinueState::CONTINUESTATE_ACTIVE) {
HILOGE("Mission continue state set to INACTIVE. Can't continue. Mission id: %{public}d",
continueInfo_.missionId_);
return INVALID_PARAMETERS_ERR;
return MISSION_NOT_CONTINUE_ACTIVE;
}
return ERR_OK;
}

View File

@ -810,7 +810,8 @@ bool DmsRadar::ClickIconDmsStartAbility(const std::string& func, int32_t errCode
bool DmsRadar::ClickIconDmsRecvOver(const std::string& func, int32_t errCode)
{
int32_t res = ERR_OK;
StageRes stageRes = (errCode == ERR_OK) ? StageRes::STAGE_SUCC : StageRes::STAGE_FAIL;
StageRes stageRes = (errCode == ERR_OK || errCode == MISSION_NOT_FOCUSED ||
errCode == MISSION_NOT_CONTINUE_ACTIVE) ? StageRes::STAGE_SUCC : StageRes::STAGE_FAIL;
if (stageRes == StageRes::STAGE_SUCC) {
res = HiSysEventWrite(
APP_CONTINUE_DOMAIN,

View File

@ -214,7 +214,7 @@ int32_t DMSContinueSendMgr::GetMissionIdByBundleName(const std::string& bundleNa
HILOGI("get missionId end, missionId: %{public}d", missionId);
return ERR_OK;
}
return INVALID_PARAMETERS_ERR;
return MISSION_NOT_FOCUSED;
}
void DMSContinueSendMgr::StartEvent()
@ -240,6 +240,10 @@ int32_t DMSContinueSendMgr::SendSoftbusEvent(uint16_t bundleNameId, uint8_t cont
HILOGD("SendSoftbusEvent start, bundleNameId: %{public}u, continueTypeId: %{public}u",
bundleNameId, continueTypeId);
std::shared_ptr<DSchedDataBuffer> buffer = std::make_shared<DSchedDataBuffer>(DMS_SEND_LEN);
if (buffer->Data() == nullptr || buffer->Size() < DMS_SEND_LEN) {
HILOGE("Failed to initialize DSchedDataBuffer");
return INVALID_PARAMETERS_ERR;
}
buffer->Data()[0] = (type << CONTINUE_SHIFT_04) | DMS_DATA_LEN;
buffer->Data()[1] = (bundleNameId >> CONTINUE_SHIFT_08) & DMS_0XFF;
buffer->Data()[INDEX_2] = bundleNameId & DMS_0XFF;