diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index b51fc8ae8b526c6c23963ce94d4ddead65d2e0a2..160df00771a4c6192e4bb1c65ded2f0c4bca3d01 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -1333,6 +1333,13 @@ const std::string CommonEventSupport::COMMON_EVENT_SCREEN_LOCKED = "usual.event. */ const std::string CommonEventSupport::COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED"; +/** + * Indicates the action of a common event that the call audio quality information has been updated. + * This is a protected common event that can only be sent by system. + */ +const std::string CommonEventSupport::COMMON_EVENT_AUDIO_QUALITY_CHANGE = + "usual.event.AUDIO_QUALITY_CHANGE"; + CommonEventSupport::CommonEventSupport() { Init(); @@ -1664,6 +1671,9 @@ void CommonEventSupport::Init() commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_LOCKED); commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_UNLOCKED); + + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_AUDIO_QUALITY_CHANGE); + return; } diff --git a/interfaces/inner_api/common_event_support.h b/interfaces/inner_api/common_event_support.h index 3ceea09f332e698f61ab1fe2485ce929e8e3b224..994f259ac6f98fc2601800dabe2262d8825bc253 100644 --- a/interfaces/inner_api/common_event_support.h +++ b/interfaces/inner_api/common_event_support.h @@ -1210,6 +1210,12 @@ public: */ static const std::string COMMON_EVENT_SCREEN_UNLOCKED; + /** + * Indicates the action of a common event that the call audio quality information has been updated. + * This is a protected common event that can only be sent by system. + */ + static const std::string COMMON_EVENT_AUDIO_QUALITY_CHANGE; + public: CommonEventSupport(); diff --git a/interfaces/kits/js/@ohos.commonEvent.d.ts b/interfaces/kits/js/@ohos.commonEvent.d.ts index b1fe4ed11cf6a77cb3da56ddedca464691828d59..9d52fb509b39a5bff5b144478d744acdeb790697 100644 --- a/interfaces/kits/js/@ohos.commonEvent.d.ts +++ b/interfaces/kits/js/@ohos.commonEvent.d.ts @@ -1120,7 +1120,14 @@ declare namespace commonEvent { * To subscribe to this protected common event that can only be sent by system. * @since 10 */ - COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE" + COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE", + + /** + * Indicates the action of a common event that the call audio quality information has been updated. + * This is a protected common event that can only be sent by system. + * @since 10 + */ + COMMON_EVENT_AUDIO_QUALITY_CHANGE = "usual.event.AUDIO_QUALITY_CHANGE" } } diff --git a/interfaces/kits/napi/support/src/support.cpp b/interfaces/kits/napi/support/src/support.cpp index c44fc4d255c9ae28f64a36aa93dbd46f6bafe43e..0287d692ee9c861a4e8bb07a4f3980bc26f6f745 100644 --- a/interfaces/kits/napi/support/src/support.cpp +++ b/interfaces/kits/napi/support/src/support.cpp @@ -574,6 +574,10 @@ napi_value SupportInit(napi_env env, napi_value exports) obj, EventFwk::CommonEventSupport::COMMON_EVENT_SCREEN_UNLOCKED, "COMMON_EVENT_SCREEN_UNLOCKED"); + SetNamedPropertyByStr(env, + obj, + EventFwk::CommonEventSupport::COMMON_EVENT_AUDIO_QUALITY_CHANGE, + "COMMON_EVENT_AUDIO_QUALITY_CHANGE"); napi_property_descriptor exportFuncs[] = {DECLARE_NAPI_PROPERTY("Support", obj)}; napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs);