From 4f7d3945611b9d14547b47a9c98eb03c4c3ec891 Mon Sep 17 00:00:00 2001 From: liqinglin <996260657@qq.com> Date: Mon, 23 Sep 2024 10:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liqinglin <996260657@qq.com> --- .../inner_kits/native_cpp/src/device_manager_impl.cpp | 6 +++--- .../implementation/src/authentication/dm_auth_manager.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp index 9abe58c4b..bf9d9b990 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -101,7 +101,7 @@ const uint16_t DM_IMPORT_AUTH_CODE_LENGTH = 6; const int32_t NORMAL = 0; const int32_t SYSTEM_BASIC = 1; const int32_t SYSTEM_CORE = 2; -const int32_t USLEEP_TIME_MS = 100000; // 100ms +const int32_t USLEEP_TIME_US_100000 = 100000; // 100ms uint16_t GenRandUint(uint16_t randMin, uint16_t randMax) { std::random_device randDevice; @@ -133,7 +133,7 @@ int32_t DeviceManagerImpl::InitDeviceManager(const std::string &pkgName, std::sh if (ret == DM_OK) { break; } - usleep(USLEEP_TIME_MS); + usleep(USLEEP_TIME_US_100000); retryNum++; if (retryNum == SERVICE_INIT_TRY_MAX_NUM) { DmRadarHelper::GetInstance().ReportDmBehavior(pkgName, "InitDeviceManager", ERR_DM_NOT_INIT); @@ -376,7 +376,7 @@ int32_t DeviceManagerImpl::RegisterDevStateCallback(const std::string &pkgName, } while (samgr->CheckSystemAbility(ACCESS_TOKEN_MANAGER_SERVICE_ID) == nullptr) { LOGD("Access_token SA not start."); - usleep(USLEEP_TIME_MS); + usleep(USLEEP_TIME_US_100000); } int32_t ret = CheckApiPermission(SYSTEM_CORE); if (ret != DM_OK) { diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index 2601101f9..a9cd97016 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -69,7 +69,7 @@ const int32_t MAX_PIN_CODE = 999999; const int32_t DM_AUTH_TYPE_MAX = 5; const int32_t DM_AUTH_TYPE_MIN = 0; const int32_t AUTH_SESSION_SIDE_SERVER = 0; -const int32_t USLEEP_TIME_MS = 500000; // 500ms +const int32_t USLEEP_TIME_US_500000 = 500000; // 500ms const int32_t AUTH_DEVICE_TIMEOUT = 10; const int32_t SESSION_HEARTBEAT_TIMEOUT = 50; const int32_t ALREADY_BIND = 1; @@ -1185,7 +1185,7 @@ void DmAuthManager::SrcAuthenticateFinish() authRequestContext_->token, authResponseContext_->state, authRequestContext_->reason); listener_->OnBindResult(authRequestContext_->hostPkgName, peerTargetId_, authRequestContext_->reason, authResponseContext_->state, GenerateBindResultContent()); - usleep(USLEEP_TIME_MS); // 500ms + usleep(USLEEP_TIME_US_500000); // 500ms softbusConnector_->GetSoftbusSession()->CloseAuthSession(authRequestContext_->sessionId); authRequestContext_ = nullptr; authRequestState_ = nullptr; -- Gitee