!1086 锁屏时判断当前应用的接续状态

Merge pull request !1086 from m30043719/master
This commit is contained in:
openharmony_ci 2024-09-14 11:35:22 +00:00 committed by Gitee
commit cf0ecc0b90
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -365,7 +365,7 @@ int32_t DMSContinueSendMgr::CheckContinueState(const int32_t missionId)
int32_t ret = abilityMgr->GetMissionInfo("", missionId, info);
if (ret != ERR_OK) {
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) {
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)
{
HILOGI("DealSetMissionContinueStateBusiness start, missionId: %{public}d, state: %{public}d", missionId, state);
std::string bundleName;
if (info_.currentMissionId != missionId && GetBundleNameByMissionId(missionId, bundleName) != ERR_OK) {
if (info_.currentMissionId != missionId) {
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);
return INVALID_PARAMETERS_ERR;
}
if (!info_.currentIsContinuable) {
HILOGI("mission is not continuable, broadcast task abort, missionId: %{public}d", missionId);
return INVALID_PARAMETERS_ERR;
@ -620,11 +624,11 @@ int32_t DMSContinueSendMgr::NotifyDeviceOnline()
void DMSContinueSendMgr::OnDeviceScreenOff()
{
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");
return;
}
int32_t missionId = info_.currentMissionId;
auto feedfunc = [this, missionId]() {
if (screenOffHandler_ != nullptr) {
screenOffHandler_->OnDeviceScreenOff(missionId);