From 9605361e1e3c65c611a32503d018394f9b3785a5 Mon Sep 17 00:00:00 2001 From: zhang_hao_zheng Date: Thu, 11 Sep 2025 20:58:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=89=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhang_hao_zheng Change-Id: If79d09a7be30b3f724fa18d3ee3e0473457ef816 --- services/appmgr/include/app_mgr_service_inner.h | 1 + services/appmgr/src/app_mgr_service_inner.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index 4aa1d11bf28..042f30e4945 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -2178,6 +2178,7 @@ private: std::mutex loadTaskListMutex_; std::vector loadAbilityTaskFuncList_; + std::mutex kiaInterceptorMutex_; sptr kiaInterceptor_; std::shared_ptr multiUserConfigurationMgr_; std::unordered_set nwebPreloadSet_ {}; diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index d8da949cadc..b805dcb53c6 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -268,8 +268,6 @@ constexpr const char* EVENT_MESSAGE_START_SPECIFIED_ABILITY_TIMEOUT = "Start Spe constexpr const char* EVENT_MESSAGE_START_PROCESS_SPECIFIED_ABILITY_TIMEOUT = "Start Process Specified Ability TimeOut!"; constexpr const char* EVENT_MESSAGE_DEFAULT = "AppMgrServiceInner HandleTimeOut!"; -constexpr const char* SUPPORT_CALL_NOTIFY_MEMORY_CHANGED = - "persist.sys.abilityms.support_call_notify_memory_changed"; constexpr const char* SYSTEM_BASIC = "system_basic"; constexpr const char* SYSTEM_CORE = "system_core"; @@ -807,6 +805,7 @@ int32_t AppMgrServiceInner::MakeKiaProcess(std::shared_ptr want, bo #ifdef INCLUDE_ZURI isFileUri = !want->GetUriString().empty() && want->GetUri().GetScheme() == "file"; #endif + std::lock_guard lock(kiaInterceptorMutex_); if (isFileUri && kiaInterceptor_ != nullptr) { auto resultCode = kiaInterceptor_->OnIntercept(*want); watermarkBusinessName = want->GetStringParam(KEY_WATERMARK_BUSINESS_NAME); @@ -9341,8 +9340,7 @@ int32_t AppMgrServiceInner::NotifyMemorySizeStateChanged(int32_t memorySizeState TAG_LOGI(AAFwkTag::APPMGR, "memorySizeState: %{public}d", memorySizeState); bool isMemmgrCall = AAFwk::PermissionVerification::GetInstance()->CheckSpecificSystemAbilityAccessPermission( MEMMGR_PROC_NAME); - bool isSupportCall = OHOS::system::GetBoolParameter(SUPPORT_CALL_NOTIFY_MEMORY_CHANGED, false); - if (!isMemmgrCall && !isSupportCall) { + if (!isMemmgrCall) { TAG_LOGE(AAFwkTag::APPMGR, "callerToken not %{public}s", MEMMGR_PROC_NAME); return ERR_PERMISSION_DENIED; } @@ -10177,6 +10175,7 @@ int AppMgrServiceInner::RegisterKiaInterceptor(const sptr &inte TAG_LOGE(AAFwkTag::APPMGR, "interceptor is nullptr."); return ERR_INVALID_VALUE; } + std::lock_guard lock(kiaInterceptorMutex_); kiaInterceptor_ = interceptor; return ERR_OK; } -- Gitee