From 2380ecf8f49e39efd6a126c41b944cdf3d67177d Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 11 Sep 2025 15:51:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0session=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- .../include/authentication_v2/auth_manager.h | 1 + .../src/authentication_v2/auth_manager.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/services/implementation/include/authentication_v2/auth_manager.h b/services/implementation/include/authentication_v2/auth_manager.h index 02deef3fe..604c5ea7e 100644 --- a/services/implementation/include/authentication_v2/auth_manager.h +++ b/services/implementation/include/authentication_v2/auth_manager.h @@ -154,6 +154,7 @@ private: void GetBindCallerInfo(); int32_t GetBindLevel(int32_t bindLevel); void GetIsNeedJoinLnnParam(const std::map &bindParam); + void GetConnDelayCloseTime(const std::string &extra); }; class AuthSrcManager : public AuthManager { diff --git a/services/implementation/src/authentication_v2/auth_manager.cpp b/services/implementation/src/authentication_v2/auth_manager.cpp index a6ddbde19..946be2679 100644 --- a/services/implementation/src/authentication_v2/auth_manager.cpp +++ b/services/implementation/src/authentication_v2/auth_manager.cpp @@ -638,12 +638,15 @@ int32_t AuthManager::AuthenticateDevice(const std::string &pkgName, int32_t auth } context_->isAuthenticateDevice = true; if (authType == AUTH_TYPE_CRE) { + GetConnDelayCloseTime(extra); LOGI("AuthManager::AuthenticateDevice for credential type, joinLNN directly."); context_->softbusConnector->JoinLnn(deviceId, true); context_->listener->OnAuthResult(context_->processInfo, context_->peerTargetId.deviceId, "", STATUS_DM_AUTH_DEFAULT, DM_OK); context_->listener->OnBindResult(context_->processInfo, context_->peerTargetId, DM_OK, STATUS_DM_AUTH_DEFAULT, ""); + context_->reason = DM_OK; + consext_->authStateMachine->TransitionTo(std::make_shared); return DM_OK; } InitAuthState(pkgName, authType, deviceId, extra); @@ -653,6 +656,20 @@ int32_t AuthManager::AuthenticateDevice(const std::string &pkgName, int32_t auth return DM_OK; } +void AuthManager::GetConnDelayCloseTime(const std::string &extra) +{ + JsonObject jsonObject(extra); + if (jsonObject.IsDiscarded()) { + LOGE("extra string not a json type."); + return; + } + context_->connDelayCloseTime = 0; + if (jsonObject[PARAM_CLOSE_SESSION_DELAY_SECONDS].IsString()) { + std::string delaySecondsStr = jsonObject[PARAM_CLOSE_SESSION_DELAY_SECONDS].Get(); + context_->connDelayCloseTime = GetCloseSessionDelaySeconds(delaySecondsStr); + } +} + int32_t AuthManager::BindTarget(const std::string &pkgName, const PeerTargetId &targetId, const std::map &bindParam, int sessionId, uint64_t logicalSessionId) { -- Gitee From c185fefd5deda713b4934a19f224ce879d06b61f Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 11 Sep 2025 16:01:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- services/implementation/src/authentication_v2/auth_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/authentication_v2/auth_manager.cpp b/services/implementation/src/authentication_v2/auth_manager.cpp index 946be2679..ea891e91c 100644 --- a/services/implementation/src/authentication_v2/auth_manager.cpp +++ b/services/implementation/src/authentication_v2/auth_manager.cpp @@ -646,7 +646,7 @@ int32_t AuthManager::AuthenticateDevice(const std::string &pkgName, int32_t auth context_->listener->OnBindResult(context_->processInfo, context_->peerTargetId, DM_OK, STATUS_DM_AUTH_DEFAULT, ""); context_->reason = DM_OK; - consext_->authStateMachine->TransitionTo(std::make_shared); + context_->authStateMachine->TransitionTo(std::make_shared()); return DM_OK; } InitAuthState(pkgName, authType, deviceId, extra); -- Gitee From 3d91c4cd902bb21491b6494a2fc5ce93d8efb57d Mon Sep 17 00:00:00 2001 From: s30044129 Date: Thu, 11 Sep 2025 21:03:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30044129 --- services/implementation/src/authentication_v2/auth_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/implementation/src/authentication_v2/auth_manager.cpp b/services/implementation/src/authentication_v2/auth_manager.cpp index ea891e91c..786210c80 100644 --- a/services/implementation/src/authentication_v2/auth_manager.cpp +++ b/services/implementation/src/authentication_v2/auth_manager.cpp @@ -663,8 +663,9 @@ void AuthManager::GetConnDelayCloseTime(const std::string &extra) LOGE("extra string not a json type."); return; } + CHECK_NULL_VOID(context_); context_->connDelayCloseTime = 0; - if (jsonObject[PARAM_CLOSE_SESSION_DELAY_SECONDS].IsString()) { + if (IsString(jsonObject, PARAM_CLOSE_SESSION_DELAY_SECONDS)) { std::string delaySecondsStr = jsonObject[PARAM_CLOSE_SESSION_DELAY_SECONDS].Get(); context_->connDelayCloseTime = GetCloseSessionDelaySeconds(delaySecondsStr); } -- Gitee