openharmony 鸿蒙 changelog-resourceschedule

2023-06-24 浏览 (421)

Resource Scheduler Subsystem Changelog

cl.resourceschedule.reminderAgent.1

The reminder agent allows you to customize buttons for system applications. Clicking a custom button will redirect you to the specified application page.

Change Impact

For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set custom buttons for reminders.

Key API/Component Changes

ModuleClassMethod/Attribute/Enum/ConstantChange Type
reminderAgentManagerActionButtonTypeACTION_BUTTON_TYPE_CUSTOM = 2Added
reminderAgentManagerActionButtonwantAgent?: WantAgentAdded
reminderAgentManagerWantAgenturi?: stringAdded
reminderAgentManagerReminderRequestactionButton?: [ActionButton?, ActionButton?, ActionButton?]Changed

Adaptation Guide

import reminderAgentManager from '@ohos.reminderAgentManager';

let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = {
    reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // The reminder type is alarm clock.
    ...
    actionButton: [
        {
            title: 'Remind later',
            type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE
        },
        {
            title: 'Close',
            type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE
        },
        {
            title: 'Custom',
            type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CUSTOM,
            wantAgent: {
                pkgName: "com.example.myapplication",
                abilityName: "EntryAbility",
            }
        },
    ]
}

cl.resourceschedule.reminderAgent.2

The reminder agent allows you to set reminders to automatically disappear at the given time.

Change Impact

For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set the reminders to disappear automatically.

Key API/Component Changes

ModuleClassMethod/Attribute/Enum/ConstantChange Type
reminderAgentManagerReminderRequesttapDismissed?: booleanAdded
reminderAgentManagerReminderRequestautoDeletedTime?: numberAdded

Adaptation Guide

import reminderAgentManager from '@ohos.reminderAgentManager';

let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = {
    reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // The reminder type is alarm clock.
    ...
    tapDismissed: true,
    autoDeletedTime: 300,
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙HUKS Changelog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/43d90105432c40a680d348af026293ed