From a53ff31b1e956be00841cad5dc64cd522f7dc9e9 Mon Sep 17 00:00:00 2001 From: AXYChen Date: Tue, 22 Jul 2025 20:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8E=A7=E4=BB=B6=E6=94=B6?= =?UTF-8?q?=E5=9B=9E=E6=9D=83=E9=99=90=E4=BB=8E10s=E6=94=B9=E4=B8=BA1min?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AXYChen Change-Id: I0f3eebb9e849798cd9d1345b7c0a5ec54b517d7a --- .../sa/sa_main/sec_comp_perm_manager.cpp | 5 +++-- .../sa/test/unittest/src/sec_comp_service_mock_test.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp index 9fd40aa..212393a 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_perm_manager.cpp @@ -23,6 +23,7 @@ namespace SecurityComponent { namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompPermManager"}; static const int32_t DELAY_REVOKE_MILLISECONDS = 10 * 1000; +static constexpr int32_t DELAY_SAVE_REVOKE_MILLISECONDS = 60 * 1000; static const std::string REVOKE_TASK_PREFIX = "RevokeAll"; static const std::string REVOKE_SAVE_PERM_TASK_PREFIX = "RevokeSavePerm"; static std::mutex g_instanceMutex; @@ -52,8 +53,8 @@ bool SecCompPermManager::DelaySaveRevokePermission(AccessToken::AccessTokenID to SecCompPermManager::GetInstance().RevokeTempSavePermissionCount(tokenId); }); - SC_LOG_DEBUG(LABEL, "revoke save permission after %{public}d ms", DELAY_REVOKE_MILLISECONDS); - secHandler_->ProxyPostTask(delayed, taskName, DELAY_REVOKE_MILLISECONDS); + SC_LOG_DEBUG(LABEL, "revoke save permission after %{public}d ms", DELAY_SAVE_REVOKE_MILLISECONDS); + secHandler_->ProxyPostTask(delayed, taskName, DELAY_SAVE_REVOKE_MILLISECONDS); return true; } diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp index 4b24313..9a7497b 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp @@ -653,7 +653,7 @@ HWTEST_F(SecCompServiceMockTest, PreRegisterSecCompProcess001, TestSize.Level0) * @tc.type: FUNC * @tc.require: */ -HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEventBody001, TestSize.Level0) +HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEventBody001, TestSize.Level1) { int32_t scId; secCompService_->state_ = ServiceRunningState::STATE_RUNNING; @@ -692,7 +692,7 @@ HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEventBody001, TestS ASSERT_TRUE(isGranted); secCompService_->VerifySavePermission(ServiceTestCommon::HAP_TOKEN_ID, isGranted); ASSERT_TRUE(isGranted); - sleep(11); + sleep(61); secCompService_->VerifySavePermission(ServiceTestCommon::HAP_TOKEN_ID, isGranted); ASSERT_FALSE(isGranted); -- Gitee