From 27fe8b8c86ca200277b14bed25788a899be8cc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Wed, 4 Jun 2025 21:00:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- .../implementation/src/authentication_v2/dm_auth_state.cpp | 4 ++-- .../src/authentication_v2/dm_auth_state_machine.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/implementation/src/authentication_v2/dm_auth_state.cpp b/services/implementation/src/authentication_v2/dm_auth_state.cpp index 3476d8563..7ab8d7a8c 100644 --- a/services/implementation/src/authentication_v2/dm_auth_state.cpp +++ b/services/implementation/src/authentication_v2/dm_auth_state.cpp @@ -111,7 +111,7 @@ bool DmAuthState::IsScreenLocked() void DmAuthState::SourceFinish(std::shared_ptr context) { - LOGI("SourceFinish reason:%{public}d", context->reason); + LOGI("SourceFinish reason:%{public}d, state:%{public}d", context->reason, context->state); context->listener->OnAuthResult(context->processInfo, context->peerTargetId.deviceId, context->accessee.tokenIdHash, GetOutputState(context->state), context->reason); context->listener->OnBindResult(context->processInfo, context->peerTargetId, @@ -147,7 +147,7 @@ void DmAuthState::SourceFinish(std::shared_ptr context) void DmAuthState::SinkFinish(std::shared_ptr context) { - LOGI("SinkFinish reason:%{public}d", context->reason); + LOGI("SinkFinish reason:%{public}d, state:%{public}d", context->reason, context->state); context->processInfo.pkgName = context->accessee.pkgName; context->listener->OnSinkBindResult(context->processInfo, context->peerTargetId, GetOutputReplay(context->accessee.bundleName, context->reason), diff --git a/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp b/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp index fea412184..54be90b0b 100644 --- a/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp +++ b/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp @@ -311,6 +311,7 @@ void DmAuthStateMachine::NotifyEventFinish(DmEventType eventType) void DmAuthStateMachine::Run(std::shared_ptr context) { while (running_.load()) { + DmAuthStateType preStateType = GetCurState(); auto state = FetchAndSetCurState(); if (!state.has_value()) { break; @@ -320,7 +321,7 @@ void DmAuthStateMachine::Run(std::shared_ptr context) } // Obtain the status and execute the status action. DmAuthStateType stateType = state.value()->GetStateType(); - context->state = static_cast(stateType); + context->state = static_cast(preStateType); int32_t ret = state.value()->Action(context); if (ret != DM_OK) { LOGE("DmAuthStateMachine::Run err:%{public}d", ret); -- Gitee From 1e42c28cb9dea4b168ace45412a8fdab9f29ad62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Thu, 5 Jun 2025 09:26:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- .../src/authentication_v2/auth_stages/auth_acl.cpp | 4 +++- .../src/authentication_v2/dm_auth_state_machine.cpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp index 727dfef39..23ed565e0 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp @@ -110,10 +110,10 @@ DmAuthStateType AuthSrcDataSyncState::GetStateType() int32_t AuthSinkFinishState::Action(std::shared_ptr context) { LOGI("AuthSinkFinishState::Action start"); - context->state = static_cast(GetStateType()); int32_t ret = DM_OK; LOGI("reason: %{public}d", context->reason); if (context->reason == DM_OK) { + context->state = static_cast(GetStateType()); ret = FreezeProcess::GetInstance().DeleteFreezeRecord(context->accessee.bundleName, context->accessee.deviceType); LOGI("DeleteFreezeRecord ret: %{public}d", ret); @@ -143,6 +143,8 @@ int32_t AuthSrcFinishState::Action(std::shared_ptr context) LOGI("AuthSrcFinishState::Action start"); if (context->reason != DM_OK) { context->authMessageProcessor->CreateAndSendMsg(MSG_TYPE_AUTH_REQ_FINISH, context); + } else { + context->state = static_cast(GetStateType()); } SourceFinish(context); LOGI("AuthSrcFinishState::Action ok"); diff --git a/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp b/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp index 54be90b0b..74bba53bb 100644 --- a/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp +++ b/services/implementation/src/authentication_v2/dm_auth_state_machine.cpp @@ -311,7 +311,7 @@ void DmAuthStateMachine::NotifyEventFinish(DmEventType eventType) void DmAuthStateMachine::Run(std::shared_ptr context) { while (running_.load()) { - DmAuthStateType preStateType = GetCurState(); + context->state = static_cast(GetCurState()); auto state = FetchAndSetCurState(); if (!state.has_value()) { break; @@ -321,7 +321,6 @@ void DmAuthStateMachine::Run(std::shared_ptr context) } // Obtain the status and execute the status action. DmAuthStateType stateType = state.value()->GetStateType(); - context->state = static_cast(preStateType); int32_t ret = state.value()->Action(context); if (ret != DM_OK) { LOGE("DmAuthStateMachine::Run err:%{public}d", ret); -- Gitee