mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-23 06:20:07 +00:00
commit
cf0ecc0b90
@ -365,7 +365,7 @@ int32_t DMSContinueSendMgr::CheckContinueState(const int32_t missionId)
|
|||||||
int32_t ret = abilityMgr->GetMissionInfo("", missionId, info);
|
int32_t ret = abilityMgr->GetMissionInfo("", missionId, info);
|
||||||
if (ret != ERR_OK) {
|
if (ret != ERR_OK) {
|
||||||
HILOGE("get missionInfo failed, missionId: %{public}d, ret: %{public}d", missionId, ret);
|
HILOGE("get missionInfo failed, missionId: %{public}d, ret: %{public}d", missionId, ret);
|
||||||
return ERR_OK;
|
return INVALID_PARAMETERS_ERR;
|
||||||
}
|
}
|
||||||
if (info.continueState != AAFwk::ContinueState::CONTINUESTATE_ACTIVE) {
|
if (info.continueState != AAFwk::ContinueState::CONTINUESTATE_ACTIVE) {
|
||||||
HILOGE("Mission continue state set to INACTIVE. Broadcast task abort.");
|
HILOGE("Mission continue state set to INACTIVE. Broadcast task abort.");
|
||||||
@ -541,12 +541,16 @@ int32_t DMSContinueSendMgr::DealSetMissionContinueStateBusiness(const int32_t mi
|
|||||||
const AAFwk::ContinueState &state)
|
const AAFwk::ContinueState &state)
|
||||||
{
|
{
|
||||||
HILOGI("DealSetMissionContinueStateBusiness start, missionId: %{public}d, state: %{public}d", missionId, state);
|
HILOGI("DealSetMissionContinueStateBusiness start, missionId: %{public}d, state: %{public}d", missionId, state);
|
||||||
std::string bundleName;
|
if (info_.currentMissionId != missionId) {
|
||||||
if (info_.currentMissionId != missionId && GetBundleNameByMissionId(missionId, bundleName) != ERR_OK) {
|
HILOGE("mission is not focused, broadcast task abort, missionId: %{public}d", missionId);
|
||||||
|
return INVALID_PARAMETERS_ERR;
|
||||||
|
}
|
||||||
|
std::string bundleName;
|
||||||
|
if (state == AAFwk::ContinueState::CONTINUESTATE_ACTIVE &&
|
||||||
|
GetBundleNameByMissionId(missionId, bundleName) != ERR_OK) {
|
||||||
HILOGE("mission is not focused, broadcast task abort, missionId: %{public}d", missionId);
|
HILOGE("mission is not focused, broadcast task abort, missionId: %{public}d", missionId);
|
||||||
return INVALID_PARAMETERS_ERR;
|
return INVALID_PARAMETERS_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!info_.currentIsContinuable) {
|
if (!info_.currentIsContinuable) {
|
||||||
HILOGI("mission is not continuable, broadcast task abort, missionId: %{public}d", missionId);
|
HILOGI("mission is not continuable, broadcast task abort, missionId: %{public}d", missionId);
|
||||||
return INVALID_PARAMETERS_ERR;
|
return INVALID_PARAMETERS_ERR;
|
||||||
@ -620,11 +624,11 @@ int32_t DMSContinueSendMgr::NotifyDeviceOnline()
|
|||||||
void DMSContinueSendMgr::OnDeviceScreenOff()
|
void DMSContinueSendMgr::OnDeviceScreenOff()
|
||||||
{
|
{
|
||||||
HILOGI("OnDeviceScreenOff called");
|
HILOGI("OnDeviceScreenOff called");
|
||||||
if (!info_.currentIsContinuable) {
|
int32_t missionId = info_.currentMissionId;
|
||||||
|
if (!info_.currentIsContinuable || CheckContinueState(missionId) != ERR_OK) {
|
||||||
HILOGW("current mission is not continuable, ignore");
|
HILOGW("current mission is not continuable, ignore");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int32_t missionId = info_.currentMissionId;
|
|
||||||
auto feedfunc = [this, missionId]() {
|
auto feedfunc = [this, missionId]() {
|
||||||
if (screenOffHandler_ != nullptr) {
|
if (screenOffHandler_ != nullptr) {
|
||||||
screenOffHandler_->OnDeviceScreenOff(missionId);
|
screenOffHandler_->OnDeviceScreenOff(missionId);
|
||||||
|
Loading…
Reference in New Issue
Block a user