
ReminderManager java.lang.Object |—ohos.event.notification.ReminderManager public class ReminderManager extends Object 为后台代理服务功能定义常量。 Since: 6 嵌套类摘要 修饰符和类型 类 描述 class ReminderManager.AppLimitExceedsException 当前应用的有效提醒次数超过限制值 ReminderDataManager#MAX_NUM_REMINDER_LIMIT_APP 时抛出此异常 class ReminderManager.SysLimitExceedsException 全系统有效提醒次数超过限制值ReminderDataManager#MAX_NUM_REMINDER_LIMIT_SYSTEM时抛出该异常 方法总结 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

ReminderHelper java.lang.Object |—ohos.event.notification.ReminderHelper public class ReminderHelper extends Object 提供管理提醒的静态方法,包括发布或取消提醒、添加或删除通知槽、获取或取消当前应用的所有提醒。 Since: 6 方法总结 修饰符和类型 方法 描述 static void addNotificationSlot(NotificationSlot slot) 创建一个 NotificationSlot。 static void cancelAllReminders() 取消当前第三方申请的所有提醒 static void cancelReminder(int reminderId) 取消指定的提醒。 static ListReminderRequest getValidReminders() 获取当前应用设置的所有有效提醒通知,即以后仍会触发的提醒。 static int publishReminder(ReminderRequest reminderReq) 发布计划提醒。 static void removeNotificationSlot(String slotId) 删除提醒使用的 NotificationSlot 实例。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 publishReminder public static int publishReminder(ReminderRequest reminderReq) throws ReminderManager.AppLimitExceedsException, ReminderManager.SysLimitExceedsException, RemoteException 发布计划提醒。 第三方应用可以调用该方法发布定时提醒。调用此方法后,调用应用程序的定时和弹出通知功能将由系统服务代理在后台执行,即使应用程序被冻结或退出。您可以调用 ReminderRequest#setIntentAgent(String, String) 方法来指定是否在录制弹出通知后启动应用程序。 后台代理维护所有第三方应用程序的有序提醒列表。该列表根据每个提醒的预定触发时间进行更新。系统一次仅启动一个最近的预定提醒。如果添加了触发时间较近的提醒,则新的预定提醒将放在列表顶部。只有在当前提醒完成后才会触发下一个提醒。 一个应用最多可以创建30个有效提醒,系统有效提醒总数不能超过2000个。提醒的最小贪睡间隔为5分钟。 权限:ohos.permission.PUBLISH_AGENT_REMINDER 参数: 参数名称 参数描述 reminderReq 指示要发布的提醒实例。 此参数不能为空。 否则会因为参数无效而抛出异常,导致应用程序崩溃。 返回: 返回唯一的提醒 ID。 Throws: Throw名称 Throw描述 RemoteException 在进程间通信错误时引发此异常。 ReminderManager.AppLimitExceedsException 如果系统中当前应用的有效提醒次数超过30次(不包括已过期不再触发的提醒),则抛出该异常。 ReminderManager.SysLimitExceedsException 系统有效提醒总数超过2000条(不包括已过期不再触发的提醒),则抛出该异常。 Since: 6 addNotificationSlot public static void addNotificationSlot(NotificationSlot slot) throws RemoteException 创建一个 NotificationSlot。 您可以调用 ReminderRequest#setSlotId(String) 方法来绑定用于发布提醒的槽。 当应用程序被卸载时,所有与应用程序相关的通知槽都将被删除。 参数: 参数名称 参数描述 slot 指示要添加的 NotificationSlot 实例。 Throws: Throw名称 Throw描述 RemoteException 在进程间通信错误时引发此异常。 Since: 6 cancelReminder public static void cancelReminder(int reminderId) throws RemoteException 取消指定的提醒。 参数: 参数名称 参数描述 reminderId 指示要取消的提醒实例的 ID。 Throws: Throw名称 Throw描述 RemoteException 在进程间通信错误时引发此异常。...

NotificationUserInput.Builder java.lang.Object |—ohos.event.notification.NotificationUserInput.Builder public static final class NotificationUserInput.Builder extends Object NotificationUserInput 对象的构建器类。 Since: 3 构造函数摘要 构造函数 描述 Builder(String inputKey) 用于创建用于创建 NotificationUserInput 对象的 Builder 实例的构造函数。 方法总结 修饰符和类型 方法 描述 NotificationUserInput.Builder addAdditionalData(PacMap pacMap) 将附加数据添加到此 Builder。 NotificationUserInput build() 使用所有设置创建一个新的 NotificationUserInput 对象。 NotificationUserInput.Builder setEditType(NotificationConstant.InputEditType editType) 设置此 NotificationUserInput 对象提供的选项的编辑类型。 NotificationUserInput.Builder setOptions(ListString options) 设置提供给用户的选项以满足用户输入需求。 NotificationUserInput.Builder setPermitFreeFormInput(boolean permitFreeFormInput) 设置用户是否可以输入任意文本值。 NotificationUserInput.Builder setPermitMimeTypes(String mimeType, boolean doPermit) 设置用户是否可以输入给定 MIME 类型的值。 NotificationUserInput.Builder setTag(String tag) 设置从用户收集此输入时显示给用户的标签。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 Builder public Builder(String inputKey) 用于创建用于创建 NotificationUserInput 对象的 Builder 实例的构造函数。 参数: 参数名称 参数描述 inputKey 指示从用户收集输入时用于识别此输入的 PacMap 键。 Throws: Throw名称 Throw描述 IllegalArgumentException 如果 inputKey 为 null,则引发此异常。 Since: 3 方法详情 setTag public NotificationUserInput.Builder setTag(String tag) 设置从用户收集此输入时显示给用户的标签。 参数: 参数名称 参数描述 tag 表示要显示的标签。 返回: 返回此 Builder 对象。 Since: 3 setOptions public NotificationUserInput.Builder setOptions(ListString options) 设置提供给用户的选项以满足用户输入需求。 所有选项都显示在一行中。 由于篇幅有限,如果选项太长或选项太多,可能会隐藏部分或全部选项。 参数: 参数名称 参数描述 options 指示要为用户输入提供的预定义选项列表。 返回: 返回此 Builder 对象。 Since: 3 setPermitMimeTypes public NotificationUserInput.Builder setPermitMimeTypes(String mimeType, boolean doPermit) 设置用户是否可以输入给定 MIME 类型的值。 参数: 参数名称 参数描述...

NotificationUserInput java.lang.Object |—ohos.event.notification.NotificationUserInput public class NotificationUserInput extends Object implements Sequenceable 定义用户输入,它将与发送的 IntentAgent 中的意图一起传递。 您应该始终使用 NotificationUserInput.Builder 创建此类的实例。 您可以调用 NotificationActionButton.Builder#addNotificationUserInput(NotificationUserInput) 将 NotificationUserInput 对象添加到 NotificationActionButton。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static class NotificationUserInput.Builder NotificationUserInput 对象的构建器类。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationUserInput PRODUCER 从 Parcel 创建 NotificationUserInput 实例。 方法总结 修饰符和类型 方法 描述 static void addInputsToIntent(ListNotificationUserInput userInputs, Intent intent, PacMap pacMap) 将 NotificationUserInput 对象列表添加到 Intent。 static void addMimeInputToIntent(NotificationUserInput userInput, Intent intent, MapString,Uri results) 将指定 MIME 类型的给定 NotificationUserInput 对象添加到 Intent。 PacMap getAdditionalData() 获取包含在此 NotificationUserInput 对象中的附加数据。 int getEditType() 获取此 NotificationUserInput 对象提供的选项的编辑类型。 String getInputKey() 获取此 NotificationUserInput 对象的键。 static PacMap getInputsFromIntent(Intent intent) 从指定的 ohos.aafwk.content.Intent 获取输入文本结果。 static int getInputsSource(Intent intent) 获取此 NotificationUserInput 对象的输入源。 static MapString,Uri getMimeInputsFromIntent(Intent intent, String inputKey) 从指定的 ohos.aafwk.content.Intent 获取特定 MIME 类型的输入结果。 ListString getOptions() 获取提供给用户的选项以满足用户输入需求。 SetString getPermitMimeTypes() 获取此 NotificationUserInput 对象允许的 MIME 类型。 String getTag() 当从用户那里收集这个输入时,获取要显示给用户的标签。 boolean isMimeTypeOnly() 检查此 NotificationUserInput 对象是否仅允许特定 MIME 类型的值。 boolean isPermitFreeFormInput() 检查用户是否可以为此 NotificationUserInput 对象提供任意值。 boolean marshalling(Parcel out) 将 NotificationUserInput 对象编组到 Parcel 中。 static void setInputsSource(Intent intent, NotificationConstant.InputsSource source) 设置此 NotificationUserInput 对象的输入源。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationUserInput 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationUserInput PRODUCER 从 Parcel 创建 NotificationUserInput 实例。 Since: 4 方法详情...

NotificationSubscriber java.lang.Object |—ohos.event.notification.NotificationSubscriber public abstract class NotificationSubscriber extends Object 提供当订阅者收到新通知或通知被取消时将被回调的方法。 NotificationSubscriber 是一个抽象类。 如果你想在你的应用程序中监听通知,你必须首先继承这个类并实现相关的方法。 例如,如果您想在收到通知时收到通知,请覆盖 onConsumed(ohos.event.notification.NotificationRequest); 如果您想在取消通知时收到通知,请覆盖 onCanceled(ohos.event.notification.NotificationRequest) 方法。 请注意,您的应用程序必须具有系统级权限才能订阅通知。 Since: 1 构造函数摘要 构造函数 描述 NotificationSubscriber() 方法总结 修饰符和类型 方法 描述 abstract void onCanceled(NotificationRequest request) 取消通知时回调。 abstract void onCanceled(NotificationRequest request, NotificationSortingMap sortingMap, int deleteReason) 取消通知时回调。 abstract void onConnected() 当订阅者连接到高级通知服务 (ANS) 时回调。 abstract void onConsumed(NotificationRequest request) 当订阅者收到新通知时回调。 abstract void onConsumed(NotificationRequest request, NotificationSortingMap sortingMap) 当订阅者收到新通知时回调。 abstract void onDied() 当与 ANS 的连接中断时回调。 abstract void onDisConnect() 当订阅者与 ANS 断开连接时回调。 abstract void onDisturbModeChanged(int disturbMode) 当请勿打扰模式类型更改时调用。 abstract void onUpdate(NotificationSortingMap sortingMap) 当前通知的排名信息发生变化时回调。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 NotificationSubscriber public NotificationSubscriber() 方法详情 onConsumed public abstract void onConsumed(NotificationRequest request) 当订阅者收到新通知时回调。 您需要继承 NotificationSubscriber 类并重写该方法来订阅和接收通知。 参数: 参数名称 参数描述 request 表示接收到的 NotificationRequest 对象。 Since: 1 onConsumed public abstract void onConsumed(NotificationRequest request, NotificationSortingMap sortingMap) 当订阅者收到新通知时回调。 您需要继承 NotificationSubscriber 类并重写该方法来订阅和接收通知。 参数: 参数名称 参数描述 request 表示接收到的 NotificationRequest 对象。 sortingMap 表示当前订阅者获取通知排名信息所使用的排序图。 Since: 2 onCanceled public abstract void onCanceled(NotificationRequest request, NotificationSortingMap sortingMap, int deleteReason) 取消通知时回调。 如果要在取消通知时收到通知,则需要继承 NotificationSubscriber 类并重写此方法。 参数: 参数名称 参数描述...

NotificationSubscribeInfo java.lang.Object |—ohos.event.notification.NotificationSubscribeInfo public class NotificationSubscribeInfo extends Object implements Sequenceable 设置发布者的过滤条件以订阅所需的通知。 在 NotificationSubscribeInfo 对象中设置过滤条件后,您可以使用它仅订阅或取消订阅来自满足过滤条件的发布者的通知。 只有系统应用可以订阅或取消订阅通知。 Since: 1 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationSubscribeInfo PRODUCER 从 Parcel 创建 NotificationSubscribeInfo 实例。 构造函数摘要 构造函数 描述 NotificationSubscribeInfo() 用于创建空 NotificationSubscribeInfo 实例的默认构造函数。 NotificationSubscribeInfo(NotificationSubscribeInfo subscribeInfo) 用于通过从现有参数复制参数来创建 NotificationSubscribeInfo 实例的构造函数。 方法总结 修饰符和类型 方法 描述 NotificationSubscribeInfo addAppName(String appName) 设置单个应用名称作为过滤条件,即订阅该应用的通知。 NotificationSubscribeInfo addAppNames(String[] appNames) 设置多个应用名称作为过滤条件,即订阅这些应用的通知。 SetString getAppNames() 获取当前 NotificationSubscribeInfo 对象中的应用程序名称。 boolean marshalling(Parcel out) 将 NotificationSubscribeInfo 对象编组到 Parcel 中。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationSubscribeInfo 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationSubscribeInfo PRODUCER 从 Parcel 创建 NotificationSubscribeInfo 实例。 Since: 4 构造函数详细信息 NotificationSubscribeInfo public NotificationSubscribeInfo() 用于创建空 NotificationSubscribeInfo 实例的默认构造函数。 Since: 1 NotificationSubscribeInfo public NotificationSubscribeInfo(NotificationSubscribeInfo subscribeInfo) 用于通过从现有参数复制参数来创建 NotificationSubscribeInfo 实例的构造函数。 参数: 参数名称 参数描述 subscribeInfo 指示 NotificationSubscribeInfo 对象。 Since: 1 方法详情 getAppNames public SetString getAppNames() 获取当前 NotificationSubscribeInfo 对象中的应用程序名称。 应用程序名称可以通过调用 addAppName(java.lang.String) 或 [addAppNames(java.lang.String]) 来设置。 返回: 返回应用程序名称集。 Since: 1...

NotificationSortingMap java.lang.Object |—ohos.event.notification.NotificationSortingMap public class NotificationSortingMap extends Object implements Sequenceable 提供所有已订阅通知中的活动通知的排序信息。 Since: 2 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationSortingMap PRODUCER 从 Parcel 创建 NotificationSortingMap 实例。 构造函数摘要 构造函数 描述 NotificationSortingMap() 用于创建 NotificationSortingMap 实例的默认构造函数。 方法总结 修饰符和类型 方法 描述 ListString getHashCode() 获取已排序的哈希码列表。 boolean getNotificationSorting(String hashCode, NotificationSorting sorting) 根据哈希码获取 NotificationSorting。 boolean marshalling(Parcel out) 将 NotificationSortingMap 对象编组到 Parcel 中。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationSortingMap 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationSortingMap PRODUCER 从 Parcel 创建 NotificationSortingMap 实例。 Since: 4 构造函数详细信息 NotificationSortingMap public NotificationSortingMap() 用于创建 NotificationSortingMap 实例的默认构造函数。 方法详情 getHashCode public ListString getHashCode() 获取已排序的哈希码列表。 返回: 返回已排序的哈希码列表。 Since: 2 getNotificationSorting public boolean getNotificationSorting(String hashCode, NotificationSorting sorting) 根据哈希码获取 NotificationSorting。 参数: 参数名称 参数描述 hashCode 表示使用getHashCode()获取的哈希码。 sorting 表示哈希码的排序信息。 返回: 如果根据哈希码获取 NotificationSorting,则返回 true; 否则返回 false。 Since: 2 marshalling public boolean marshalling(Parcel out) 将 NotificationSortingMap 对象编组到...

NotificationSorting java.lang.Object |—ohos.event.notification.NotificationSorting public class NotificationSorting extends Object implements Sequenceable 提供有关活动通知的排序信息。 当有新的通知到来时,现有的活动通知的优先级或时间顺序等排序会发生变化,当前通知的排序信息也会随之发生变化。 这些信息只是一个快照并且是实时变化的。 该类只能获取信息,不能设置信息。 Since: 2 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationSorting PRODUCER 从 Parcel 创建 NotificationSorting 实例。 构造函数摘要 构造函数 描述 NotificationSorting() 方法总结 修饰符和类型 方法 描述 String getGroupKeyOverride() 获取覆盖的通知组密钥。 String getHashCode() 获取通知哈希码,在当前应用中是唯一的。 int getImportance() 获取当前通知集在对应的NotificationSlot中的重要性级别。 int getRanking() 获取所有活动通知中通知的序号。 NotificationSlot getSlot() 获取当前通知所属的 NotificationSlot。 int getVisiblenessOverride() 获取当前通知在相应 NotificationSlot 中设置的锁屏上的可见性。 boolean isDisplayBadge() 检查是否为当前通知显示徽章。 boolean isHiddenNotification() 检查当前通知是否隐藏。 boolean marshalling(Parcel out) 将 NotificationSorting 对象编组到 Parcel 中。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationSorting 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationSorting PRODUCER 从 Parcel 创建 NotificationSorting 实例。 Since: 4 构造函数详细信息 NotificationSorting public NotificationSorting() 方法详情 getHashCode public String getHashCode() 获取通知哈希码,在当前应用中是唯一的。 一般来说,通知哈希码是一个字符串,格式为 Notification IDCreator package nameCreator UID_Owner package name。 返回: 返回通知哈希码。 Since: 2 getRanking public int getRanking() 获取所有活动通知中通知的序号。 返回: 返回通知的序列号。...

NotificationSlotGroup java.lang.Object |—ohos.event.notification.NotificationSlotGroup public final class NotificationSlotGroup extends Object implements Sequenceable 管理应用程序中具有相同名称的多个通知槽。 例如,社交网络服务 (SNS) 应用程序可能同时支持个人和企业帐户,并且每个帐户可能需要具有相同功能和名称的多个通知槽。 您可以将属于单个帐户的同名通知槽绑定到一个通知槽组,以管理它们各自的信息。 Since: 3 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationSlotGroup PRODUCER 从 Parcel 创建 NotificationSlotGroup 实例。 构造函数摘要 构造函数 描述 NotificationSlotGroup() 用于创建 NotificationSlotGroup 实例的默认构造函数。 NotificationSlotGroup(String id, String name) 一个构造函数,用于创建具有初始化组 ID 和名称的 NotificationSlotGroup 实例。 方法总结 修饰符和类型 方法 描述 String getDescription() 获取此 NotificationSlotGroup 对象的描述,由 setDescription(java.lang.String) 设置。 String getId() 获取此 NotificationSlotGroup 对象的 ID,由 NotificationSlotGroup(java.lang.String,java.lang.String) 设置。 String getName() 获取此 NotificationSlotGroup 对象的名称,由 NotificationSlotGroup(java.lang.String,java.lang.String) 设置。 ListNotificationSlot getSlots() 获取绑定到此 NotificationSlotGroup 对象的通知槽列表。 boolean isDisabled() 检查此 NotificationSlotGroup 是否已禁用。 boolean marshalling(Parcel out) Marshalls NotificationS 不是 Group 对象并将它们写入 Parcel。 void setDescription(String desc) 设置此 NotificationSlotGroup 对象的描述。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationSlotGroup 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationSlotGroup PRODUCER 从 Parcel 创建 NotificationSlotGroup 实例。 Since: 4 构造函数详细信息 NotificationSlotGroup public NotificationSlotGroup(String id, String name) 一个构造函数,用于创建具有初始化组 ID 和名称的 NotificationSlotGroup 实例。 参数: 参数名称 参数描述 id NotificationSlotGroup的ID。 ID 必须是唯一的,并且它的长度不能超过 1000 个字符(超出的部分会被自动截断)。 name 表示 NotificationSlotGroup 的名称。 其长度不得超过 1000 个字符(超出部分将自动截断)。 Since: 3 NotificationSlotGroup public NotificationSlotGroup() 用于创建 NotificationSlotGroup 实例的默认构造函数。 Since: 3 方法详情...

NotificationSlot java.lang.Object |—ohos.event.notification.NotificationSlot public final class NotificationSlot extends Object implements Sequenceable 定义了一个公共通知主题,它是一个包含通知音、振动、锁屏显示和级别的功能的集合。 您可以将这个类与一个应用程序关联起来,使应用程序发布的所有通知都具有通知主题的特性。 一个应用程序可以与一个或多个 NotificationSlot 实例相关联。 Since: 1 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static int LEVEL_DEFAULT 表示开启通知功能,状态栏显示通知图标,不带横幅,但有提示音。 static int LEVEL_HIGH 表示开启通知功能,状态栏显示通知图标,带有横幅和提示音。 static int LEVEL_LOW 表示通知功能开启,状态栏显示通知图标,无横幅或提示音。 static int LEVEL_MIN 表示开启了通知功能,但状态栏中不显示通知图标,没有横幅或提示音。 static int LEVEL_NONE 表示通知功能已关闭。 static int LEVEL_UNDEFINED 表示用户未定义级别。 static Sequenceable.ProducerNotificationSlot PRODUCER 从 Parcel 创建一个 NotificationSlot 实例。 构造函数摘要 构造函数 描述 NotificationSlot(String id, String name, int level) 用于初始化 NotificationSlot 对象的 ID、名称和级别的构造函数。 方法总结 修饰符和类型 方法 描述 boolean canEnableLight() 获取NotificationSlot对象中是否开启通知灯,由setEnableLight(boolean)设置。 boolean canVibrate() 获取 NotificationSlot 对象的振动状态,由 setEnableVibration(boolean) 设置。 void enableBadge(boolean isShowBadge) 设置收到通知后是否在主屏幕上显示应用程序图标标记(应用程序图标角落的数字或点)。 void enableBypassDnd(boolean bypassDnd) 设置是否绕过系统中的请勿打扰 (DND) 模式。 String getDescription() 获取一个 NotificationSlot 对象的描述,由 setDescription(java.lang.String) 设置。 String getId() 获取 NotificationSlot 对象的 ID。 int getLedLightColor() 获取 NotificationSlot 对象中通知灯的颜色,由 setLedLightColor(int) 设置。 int getLevel() 获取 NotificationSlot 对象的级别,由 setLevel(int) 设置。 int getLockscreenVisibleness() 获取一个NotificationSlot对象在锁屏上的通知显示效果,由setLockscreenVisibleness(int)设置。 String getName() 获取 NotificationSlot 对象的名称。 String getSlotGroup() 获取该NotificationSlot对象所属的NotificationSlotGroup对象的ID,由setSlotGroup(java.lang.String)设置。 Uri getSound() 获取NotificationSlot对象的提示音,由setSound(ohos.utils.net.Uri)设置。 long[] getVibrationStyle() 获取此 NotificationSlot 中通知的振动样式。 boolean isEnableBypassDnd() 获取 NotificationSlot 对象是否绕过免打扰模式,由 enableBypassDnd(boolean) 设置。 boolean isShowBadge() 获取 NotificationSlot 对象的应用程序图标徽章状态,该状态由 enableBadge(boolean) 设置。 boolean marshalling(Parcel out) 将 NotificationSlot 对象编组到 Parcel 中。 void setDescription(String description) 设置 NotificationSlot 对象的描述。 void setEnableLight(boolean isLightEnabled) 指定在设备上收到通知时是否启用通知灯,前提是此设备有通知灯。 void setEnableVibration(boolean vibration) 设置是否在收到通知时启用振动。 void setLedLightColor(int color) 将通知灯的颜色设置为在设备上接收到通知时闪烁,前提是此设备具有通知灯并且使用值 true 调用 setEnableLight(boolean)。 void setLevel(int level) 设置 NotificationSlot 对象的级别。...