diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_4.1.5.2/changelogs-notification.md b/zh-cn/release-notes/changelogs/OpenHarmony_4.1.5.2/changelogs-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd97bcaa291d005e352aac52ca908ab875446a8 --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_4.1.5.2/changelogs-notification.md @@ -0,0 +1,332 @@ +# 通知子系统-通知服务ChangeLog + +## cl.notification.1 实况通知相关字段变更为SystemAPI + +实况通知相关仅允许系统应用使用,需要为实况通知对应的SlotType和NotificationContent增加SystemAPI注解。 + +**变更影响** + +只有系统应用允许发送实况通知。 + +- 涉及接口 + +```js + export interface NotificationContent; + export enum SlotType; +``` + +- 变更前: + +NotificationContent中的systemLiveView无@systemapi注解,SlotType中的liveView无@systemapi注解。 + +```js + /** + * Describes notification types. + * + * @typedef NotificationContent + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ +export interface NotificationContent { + /** + * Notification content type. + * + * @type { ?notification.ContentType } + * @syscap SystemCapability.Notification.Notification + * @since 7 + * @deprecated since 11 + * @useinstead NotificationContent#notificationContentType + */ + contentType?: notification.ContentType; + + /** + * Notification content type. + * + * @type { ?notificationManager.ContentType } + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + notificationContentType?: notificationManager.ContentType; + + /** + * Normal text notification. + * + * @type { ?NotificationBasicContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + normal?: NotificationBasicContent; + + /** + * Long text notification. + * + * @type { ?NotificationLongTextContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + longText?: NotificationLongTextContent; + + /** + * Multi-line text notification. + * + * @type { ?NotificationMultiLineContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + multiLine?: NotificationMultiLineContent; + + /** + * Picture-attached notification. + * + * @type { ?NotificationPictureContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + picture?: NotificationPictureContent; + + /** + * System-live-view notification. + * + * @type { ?NotificationSystemLiveViewContent } + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 11 + */ + systemLiveView?: NotificationSystemLiveViewContent; + + /** + * live-view notification. + * + * @type { ?NotificationLiveViewContent } + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + liveView?: NotificationLiveViewContent; +} + +/** + * Describes NotificationSlot types. + * + * @enum { number } + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + export enum SlotType { + /** + * NotificationSlot of an unknown type. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + UNKNOWN_TYPE = 0, + + /** + * NotificationSlot for social communication. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + SOCIAL_COMMUNICATION = 1, + + /** + * NotificationSlot for service information. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + SERVICE_INFORMATION = 2, + + /** + * NotificationSlot for content information. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + CONTENT_INFORMATION = 3, + + /** + * NotificationSlot for live view. + * + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + LIVE_VIEW = 4, + + /** + * NotificationSlot for customer service. + * + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + CUSTOMER_SERVICE = 5, + + /** + * NotificationSlot for other purposes. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + OTHER_TYPES = 0xFFFF + } +``` + +- 变更后: + +NotificationContent中的systemLiveView增加@systemapi注解,SlotType中的liveView增加@systemapi注解。 + +```js + /** + * Describes notification types. + * + * @typedef NotificationContent + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ +export interface NotificationContent { + /** + * Notification content type. + * + * @type { ?notification.ContentType } + * @syscap SystemCapability.Notification.Notification + * @since 7 + * @deprecated since 11 + * @useinstead NotificationContent#notificationContentType + */ + contentType?: notification.ContentType; + + /** + * Notification content type. + * + * @type { ?notificationManager.ContentType } + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + notificationContentType?: notificationManager.ContentType; + + /** + * Normal text notification. + * + * @type { ?NotificationBasicContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + normal?: NotificationBasicContent; + + /** + * Long text notification. + * + * @type { ?NotificationLongTextContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + longText?: NotificationLongTextContent; + + /** + * Multi-line text notification. + * + * @type { ?NotificationMultiLineContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + multiLine?: NotificationMultiLineContent; + + /** + * Picture-attached notification. + * + * @type { ?NotificationPictureContent } + * @syscap SystemCapability.Notification.Notification + * @since 7 + */ + picture?: NotificationPictureContent; + + /** + * System-live-view notification. + * + * @type { ?NotificationSystemLiveViewContent } + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 11 + */ + systemLiveView?: NotificationSystemLiveViewContent; + + /** + * live-view notification. + * + * @type { ?NotificationLiveViewContent } + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 11 + */ + liveView?: NotificationLiveViewContent; +} + +/** + * Describes NotificationSlot types. + * + * @enum { number } + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + export enum SlotType { + /** + * NotificationSlot of an unknown type. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + UNKNOWN_TYPE = 0, + + /** + * NotificationSlot for social communication. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + SOCIAL_COMMUNICATION = 1, + + /** + * NotificationSlot for service information. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + SERVICE_INFORMATION = 2, + + /** + * NotificationSlot for content information. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + CONTENT_INFORMATION = 3, + + /** + * NotificationSlot for live view. + * + * @syscap SystemCapability.Notification.Notification + * @since 11 + * @systemapi + */ + LIVE_VIEW = 4, + + /** + * NotificationSlot for customer service. + * + * @syscap SystemCapability.Notification.Notification + * @since 11 + */ + CUSTOMER_SERVICE = 5, + + /** + * NotificationSlot for other purposes. + * + * @syscap SystemCapability.Notification.Notification + * @since 9 + */ + OTHER_TYPES = 0xFFFF + } +``` + +**适配指导** + +实况通知仅支持系统应用使用。