diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index bf513bd703437d579d3f9538bf25bfad6645bac8..9135465930acc6c7843dab336dda838b4be685e9 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -1523,6 +1523,12 @@ const std::string CommonEventSupport::COMMON_EVENT_SECOND_MOUNTED = "usual.event */ const std::string CommonEventSupport::COMMON_EVENT_RESTORE_START = "usual.event.RESTORE_START"; +/** + * Indicates that an application finished restore. + * This is a protected common event that can only be sent by system. + */ +const std::string CommonEventSupport::COMMON_EVENT_RESTORE_END = "usual.event.RESTORE_END"; + /** * Indicates that the managed browser policy is changed. * This is a protected common event that can only be sent by system. @@ -2961,6 +2967,12 @@ void CommonEventSupport::Init() */ commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_RESTORE_START); + /** + * Indicates that an application finished restore. + * This is a protected common event that can only be sent by system. + */ + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_RESTORE_END); + /** * Indicates that the managed browser policy is changed. * This is a protected common event that can only be sent by system. diff --git a/interfaces/inner_api/common_event_support.h b/interfaces/inner_api/common_event_support.h index 5fb0581f55626fb96e90fb385fad1a1d46faf68f..e1392ab090163d605641612145a48a4b831aa376 100644 --- a/interfaces/inner_api/common_event_support.h +++ b/interfaces/inner_api/common_event_support.h @@ -1380,6 +1380,12 @@ public: */ static const std::string COMMON_EVENT_RESTORE_START; + /** + * Indicates that an application finished restore. + * This is a protected common event that can only be sent by system. + */ + static const std::string COMMON_EVENT_RESTORE_END; + /** * Indicates that the managed browser policy is changed. * This is a protected common event that can only be sent by system. diff --git a/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets b/interfaces/kits/ani/common_event/ets/@ohos.commonEventManager.ets index 96ba18f22af7fa93346cac6c261d296a0db13b60..34aeae0a6e277c8ad234272ce787549b229bc57f 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_RESTORE_END = 'usual.event.RESTORE_END', } } diff --git a/interfaces/kits/napi/support/src/support.cpp b/interfaces/kits/napi/support/src/support.cpp index b3bda289645479239c1dfe05439c055e9ae9cea9..a05b0dc25b3615dc5177b8a7d29fa605782bf711 100644 --- a/interfaces/kits/napi/support/src/support.cpp +++ b/interfaces/kits/napi/support/src/support.cpp @@ -674,6 +674,10 @@ napi_value SupportInit(napi_env env, napi_value exports) obj, EventFwk::CommonEventSupport::COMMON_EVENT_RESTORE_START, "COMMON_EVENT_RESTORE_START"); + SetNamedPropertyByStr(env, + obj, + EventFwk::CommonEventSupport::COMMON_EVENT_RESTORE_END, + "COMMON_EVENT_RESTORE_END"); SetNamedPropertyByStr(env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_MANAGED_BROWSER_POLICY_CHANGED, diff --git a/services/src/common_event_permission_manager.cpp b/services/src/common_event_permission_manager.cpp index 3d22070d7ea264c5a8b82255e3f7b055ae33b5b7..e6f70a2e7a03fbe859ed0982ded7ea0799732f63 100644 --- a/services/src/common_event_permission_manager.cpp +++ b/services/src/common_event_permission_manager.cpp @@ -166,6 +166,9 @@ static const std::unordered_map SYSTEM_API_COMMON_EVENTS { CommonEventSupport::COMMON_EVENT_CHARGE_TYPE_CHANGED, CommonEventSupport::COMMON_EVENT_DYNAMIC_ICON_CHANGED, CommonEventSupport::COMMON_EVENT_RESTORE_START, + CommonEventSupport::COMMON_EVENT_RESTORE_END, CommonEventSupport::COMMON_EVENT_DEFAULT_APPLICATION_CHANGED, CommonEventSupport::COMMON_EVENT_SHORTCUT_CHANGED, CommonEventSupport::COMMON_EVENT_TRUSTED_RING_CHECKIN,