diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index 7b0b20110898c969e7fb942bf29fb7f226c58e7a..d1debfa414db07b7e7afbe72d5334aa40602919f 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 has updated the custom roaming region of device. + * This is a protected common event that can only be sent by system. + */ + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_CAPTURE); return; } diff --git a/interfaces/inner_api/common_event_support.h b/interfaces/inner_api/common_event_support.h index 2723e9f007e017da0604f9710db03bfc56ca5bd5..029c35d4d500c13ff9981ac088cc73ffc2268a5e 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 device has updated the custom roaming region of device. + * 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/interfaces/kits/ndk/include/oh_commonevent_support.h b/interfaces/kits/ndk/include/oh_commonevent_support.h index b8a00bc52dd1e859548218586b88497b35feafbd..9b149ea5b12a4fbd89f9b5a291e57bc6ef0ea80c 100644 --- a/interfaces/kits/ndk/include/oh_commonevent_support.h +++ b/interfaces/kits/ndk/include/oh_commonevent_support.h @@ -438,6 +438,11 @@ static const char* const COMMON_EVENT_KIOSK_MODE_ON = "usual.event.KIOSK_MODE_ON */ static const char* const COMMON_EVENT_KIOSK_MODE_OFF = "usual.event.KIOSK_MODE_OFF"; +/** + * Indicates that the device has exited kiosk mode. + * This is a protected common event that can only be sent by system. + */ +static const char* const COMMON_EVENT_SCREEN_SHARE = "usual.event.SCREEN_SHARE"; #ifdef __cplusplus } #endif