diff --git a/services/implementation/include/authentication/dm_auth_manager.h b/services/implementation/include/authentication/dm_auth_manager.h index 38ebf8607f9003578a4b33a4eb87be8cda2ad0b2..820169b417dba6da628357bd1a4b4256537a0a79 100644 --- a/services/implementation/include/authentication/dm_auth_manager.h +++ b/services/implementation/include/authentication/dm_auth_manager.h @@ -532,6 +532,7 @@ private: std::string GetBundleName(nlohmann::json &jsonObject); int32_t GetBinderInfo(); void SetProcessInfo(); + void OpenAuthSession(); private: std::shared_ptr softbusConnector_; diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index 651ddc55e8a331d923cda093a293c66c7cd61405..1a588c3b53bf838c583020ef2f8aebd85cb2f570 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -39,6 +39,7 @@ #include "dm_log.h" #include "dm_radar_helper.h" #include "dm_random.h" +#include "ffrt.h" #include "multiple_user_connector.h" #include "nlohmann/json.hpp" #include "parameter.h" @@ -261,10 +262,17 @@ void DmAuthManager::InitAuthState(const std::string &pkgName, int32_t authType, if (!DmRadarHelper::GetInstance().ReportAuthStart(peerTargetId_.deviceId, pkgName)) { LOGE("ReportAuthStart failed"); } - authRequestState_->Enter(); + ffrt::submit([=]() { OpenAuthSession(); }); LOGI("DmAuthManager::AuthenticateDevice complete"); } +void DmAuthManager::OpenAuthSession() +{ + CHECK_NULL_VOID(authRequestState_); + LOGI("state %{public}d", authRequestState_->GetStateType()); + authRequestState_->Enter(); +} + int32_t DmAuthManager::AuthenticateDevice(const std::string &pkgName, int32_t authType, const std::string &deviceId, const std::string &extra) {