diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index 7b0b20110898c969e7fb942bf29fb7f226c58e7a..55b33f53a13b18e991fd77a7bfbf99bb48ef18df 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -1588,6 +1588,12 @@ const std::string CommonEventSupport::COMMON_EVENT_CUSTOM_CONFIG_POLICY_UPDATED const std::string CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED = "usual.event.CUSTOM_ROAMING_REGION_UPDATED"; +/** + * Indicates that the device screen capture. + * This is a protected common event that can only be sent by system. + */ + const std::string CommonEventSupport::COMMON_EVENT_SCREEN_SHARE = "usual.event.SCREEN_SHARE"; + CommonEventSupport::CommonEventSupport() { Init(); @@ -3015,6 +3021,12 @@ void CommonEventSupport::Init() * This is a protected common event that can only be sent by system. */ commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED); + + /** + * Indicates that the device screen capture. + * This is a protected common event that can only be sent by system. + */ + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_SHARE); return; } diff --git a/interfaces/inner_api/common_event_support.h b/interfaces/inner_api/common_event_support.h index 2723e9f007e017da0604f9710db03bfc56ca5bd5..5fb0581f55626fb96e90fb385fad1a1d46faf68f 100644 --- a/interfaces/inner_api/common_event_support.h +++ b/interfaces/inner_api/common_event_support.h @@ -1439,6 +1439,12 @@ public: */ static const std::string COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED; + /** + * Indicates that the screen capture. + * This is a protected common event that can only be sent by system. + */ + static const std::string COMMON_EVENT_SCREEN_SHARE; + public: CommonEventSupport(); diff --git a/interfaces/kits/napi/support/src/support.cpp b/interfaces/kits/napi/support/src/support.cpp index 572629cfffa4145ecb0e3a1bfb236b2df69a62ab..b3bda289645479239c1dfe05439c055e9ae9cea9 100644 --- a/interfaces/kits/napi/support/src/support.cpp +++ b/interfaces/kits/napi/support/src/support.cpp @@ -714,6 +714,10 @@ napi_value SupportInit(napi_env env, napi_value exports) obj, EventFwk::CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED, "COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED"); + SetNamedPropertyByStr(env, + obj, + EventFwk::CommonEventSupport::COMMON_EVENT_SCREEN_SHARE, + "COMMON_EVENT_SCREEN_SHARE"); 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 5bfb1987c8f8e58257c82cb3512459d6231f0135..53785744861e448eb55947bc0d5efc7e08320790 100644 --- a/services/src/common_event_permission_manager.cpp +++ b/services/src/common_event_permission_manager.cpp @@ -197,6 +197,7 @@ static const std::unordered_set SYSTEM_API_COMMON_EVENTS { CommonEventSupport::COMMON_EVENT_TRUSTED_RING_RESET, CommonEventSupport::COMMON_EVENT_USER_LOCKING, CommonEventSupport::COMMON_EVENT_USER_LOCKED, + CommonEventSupport::COMMON_EVENT_SCREEN_SHARE, CommonEventSupport::COMMON_EVENT_CUSTOM_CONFIG_POLICY_UPDATED, CommonEventSupport::COMMON_EVENT_CUSTOM_ROAMING_REGION_UPDATED };