From 77dcdce942fda4f6e5120450f5ffff19dd052f0d Mon Sep 17 00:00:00 2001 From: lvzhuoyao Date: Tue, 7 Nov 2023 19:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BA=8B=E4=BB=B6=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=9C=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?SlotType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvzhuoyao Change-Id: I462ad9d8a6fbd8993d0020fa35a53da0a58bd466 --- frameworks/js/napi/include/common.h | 1 + frameworks/js/napi/src/common.cpp | 7 +++++++ frameworks/js/napi/src/constant.cpp | 1 + interfaces/inner_api/notification_constant.h | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frameworks/js/napi/include/common.h b/frameworks/js/napi/include/common.h index feb8a40ce..141a01747 100644 --- a/frameworks/js/napi/include/common.h +++ b/frameworks/js/napi/include/common.h @@ -52,6 +52,7 @@ enum class SlotType { SERVICE_INFORMATION = 2, CONTENT_INFORMATION = 3, LIVE_VIEW = 4, + CUSTOMER_SERVICE = 5, OTHER_TYPES = 0xFFFF, }; diff --git a/frameworks/js/napi/src/common.cpp b/frameworks/js/napi/src/common.cpp index 628615589..f0e7d9160 100644 --- a/frameworks/js/napi/src/common.cpp +++ b/frameworks/js/napi/src/common.cpp @@ -18,6 +18,7 @@ #include "napi_common.h" #include "notification_action_button.h" #include "notification_capsule.h" +#include "notification_constant.h" #include "notification_progress.h" #include "notification_time.h" #include "pixel_map_napi.h" @@ -5100,6 +5101,9 @@ bool Common::SlotTypeJSToC(const SlotType &inType, NotificationConstant::SlotTyp case SlotType::LIVE_VIEW: outType = NotificationConstant::SlotType::LIVE_VIEW; break; + case SlotType::CUSTOMER_SERVICE: + outType = NotificationConstant::SlotType::CUSTOMER_SERVICE; + break; case SlotType::UNKNOWN_TYPE: case SlotType::OTHER_TYPES: outType = NotificationConstant::SlotType::OTHER; @@ -5129,6 +5133,9 @@ bool Common::SlotTypeCToJS(const NotificationConstant::SlotType &inType, SlotTyp case NotificationConstant::SlotType::LIVE_VIEW: outType = SlotType::LIVE_VIEW; break; + case NotificationConstant::SlotType::CUSTOMER_SERVICE: + outType = SlotType::CUSTOMER_SERVICE; + break; case NotificationConstant::SlotType::OTHER: outType = SlotType::OTHER_TYPES; break; diff --git a/frameworks/js/napi/src/constant.cpp b/frameworks/js/napi/src/constant.cpp index fa6711cec..c5d6fcd7b 100644 --- a/frameworks/js/napi/src/constant.cpp +++ b/frameworks/js/napi/src/constant.cpp @@ -57,6 +57,7 @@ napi_value SlotTypeInit(napi_env env, napi_value exports) SetNamedPropertyByInteger(env, obj, (int32_t)SlotType::SERVICE_INFORMATION, "SERVICE_INFORMATION"); SetNamedPropertyByInteger(env, obj, (int32_t)SlotType::CONTENT_INFORMATION, "CONTENT_INFORMATION"); SetNamedPropertyByInteger(env, obj, (int32_t)SlotType::LIVE_VIEW, "LIVE_VIEW"); + SetNamedPropertyByInteger(env, obj, (int32_t)SlotType::CUSTOMER_SERVICE, "CUSTOMER_SERVICE"); SetNamedPropertyByInteger(env, obj, (int32_t)SlotType::OTHER_TYPES, "OTHER_TYPES"); napi_property_descriptor exportFuncs[] = { diff --git a/interfaces/inner_api/notification_constant.h b/interfaces/inner_api/notification_constant.h index 3413024da..564e87bb3 100644 --- a/interfaces/inner_api/notification_constant.h +++ b/interfaces/inner_api/notification_constant.h @@ -63,6 +63,7 @@ public: OTHER, // the notificatin type is other CUSTOM, // the notification type is custom LIVE_VIEW, // the notification type is live view + CUSTOMER_SERVICE, // the notification type is customer service }; enum class VisiblenessType { @@ -193,4 +194,4 @@ public: } // namespace Notification } // namespace OHOS -#endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_CONSTANT_H \ No newline at end of file +#endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_CONSTANT_H -- Gitee