diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index bf513bd703437d579d3f9538bf25bfad6645bac8..ba0f1a8d1aac6f698c41eae7a9d545feee379c99 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 5fb0581f55626fb96e90fb385fad1a1d46faf68f..6de0e874a37e2a6a4f9a31567e95e566e6894888 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 96ba18f22af7fa93346cac6c261d296a0db13b60..6786f70a16526e69e5a41ac661249630e4ad90bc 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 b3bda289645479239c1dfe05439c055e9ae9cea9..b5ef4824fac3d74ef49978b8d98805f2c39331bd 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 3d22070d7ea264c5a8b82255e3f7b055ae33b5b7..8bfda9eb1e8c5d16fc843d621cac8bc6c5bb84fb 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 {