From e4dddeb11f7c54458926b4b1e93df3e54c6c15bf Mon Sep 17 00:00:00 2001 From: hunili Date: Thu, 21 Aug 2025 16:03:02 +0800 Subject: [PATCH] =?UTF-8?q?[Bug]:=20=E4=BA=91=E7=9B=98=20https://gitee.com?= =?UTF-8?q?/openharmony/filemanagement=5Fuser=5Ffile=5Fservice/issues/ICRW?= =?UTF-8?q?I6=20Signed-off-by:=20hunili=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hunili --- frameworks/native/src/common_event_support.cpp | 12 ++++++++++++ interfaces/inner_api/common_event_support.h | 6 ++++++ .../common_event/ets/@ohos.commonEventManager.ets | 1 + interfaces/kits/napi/support/src/support.cpp | 4 ++++ services/src/common_event_permission_manager.cpp | 6 +++++- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index bf513bd7..ba0f1a8d 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -1594,6 +1594,12 @@ const std::string CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED */ const std::string CommonEventSupport::COMMON_EVENT_SCREEN_SHARE = "usual.event.SCREEN_SHARE"; +/** + * Indicates that the cloud disk root info has changed. + * This is a protected common event that can only be sent by system. + */ +const std::string CommonEventSupport::COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED = "usual.event.CLOUD_DISK_ROOT_CHANGED"; + CommonEventSupport::CommonEventSupport() { Init(); @@ -3027,6 +3033,12 @@ void CommonEventSupport::Init() * This is a protected common event that can only be sent by system. */ commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_SHARE); + + /** + * Indicates that the cloud disk root info has changed. + * This is a protected common event that can only be sent by system. + */ + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED); return; } diff --git a/interfaces/inner_api/common_event_support.h b/interfaces/inner_api/common_event_support.h index 5fb0581f..6de0e874 100644 --- a/interfaces/inner_api/common_event_support.h +++ b/interfaces/inner_api/common_event_support.h @@ -1445,6 +1445,12 @@ public: */ static const std::string COMMON_EVENT_SCREEN_SHARE; + /** + * Indicates that the cloud disk root info has changed. + * This is a protected common event that can only be sent by system. + */ + static const std::string COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED; + public: CommonEventSupport(); diff --git a/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets b/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets index 96ba18f2..6786f70a 100644 --- a/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets +++ b/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets @@ -509,6 +509,7 @@ namespace commonEventManager { COMMON_EVENT_KIOSK_MODE_OFF = 'usual.event.KIOSK_MODE_OFF', COMMON_EVENT_CUSTOM_CONFIG_POLICY_UPDATED = 'usual.event.CUSTOM_CONFIG_POLICY_UPDATED', COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED = 'usual.event.CUSTOM_ROAMING_REGION_UPDATED', + COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED = 'usual.event.CLOUD_DISK_ROOT_CHANGED', } } diff --git a/interfaces/kits/napi/support/src/support.cpp b/interfaces/kits/napi/support/src/support.cpp index b3bda289..b5ef4824 100644 --- a/interfaces/kits/napi/support/src/support.cpp +++ b/interfaces/kits/napi/support/src/support.cpp @@ -718,6 +718,10 @@ napi_value SupportInit(napi_env env, napi_value exports) obj, EventFwk::CommonEventSupport::COMMON_EVENT_SCREEN_SHARE, "COMMON_EVENT_SCREEN_SHARE"); + SetNamedPropertyByStr(env, + obj, + EventFwk::CommonEventSupport::COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED, + "COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED"); napi_property_descriptor exportFuncs[] = {DECLARE_NAPI_PROPERTY("Support", obj)}; napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs); diff --git a/services/src/common_event_permission_manager.cpp b/services/src/common_event_permission_manager.cpp index 3d22070d..8bfda9eb 100644 --- a/services/src/common_event_permission_manager.cpp +++ b/services/src/common_event_permission_manager.cpp @@ -181,6 +181,9 @@ static const std::unordered_map SYSTEM_API_COMMON_EVENTS { @@ -200,7 +203,8 @@ static const std::unordered_set SYSTEM_API_COMMON_EVENTS { CommonEventSupport::COMMON_EVENT_CUSTOM_CONFIG_POLICY_UPDATED, CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED, CommonEventSupport::COMMON_EVENT_SCREEN_SHARE, - CommonEventSupport::COMMON_EVENT_BUNDLE_SCAN_FINISHED + CommonEventSupport::COMMON_EVENT_BUNDLE_SCAN_FINISHED, + CommonEventSupport::COMMON_EVENT_CLOUD_DISK_ROOT_CHANGED }; static const std::vector SENSITIVE_COMMON_EVENTS { -- Gitee