1# Resource Scheduler Subsystem Changelog 2 3## cl.backgroundtasks.1 Permission Control Added for reminderAgentManager.publishReminder 4 5**Access Level** 6 7Public API 8 9**Reason for Change** 10 11Applications may abuse reminderAgentManager to send deferred advertisements and marketing activities, affecting user experience. A control mechanism is introduced, preventing applications that are not under control from using reminderAgentManager. 12 13**Change Impact** 14 15This change is a non-compatible change. 16 17Before change: An application uses reminderAgentManager to create a deferred reminder. The API is successfully called, and a reminder ID is returned. 18 19```ts 20import { BusinessError } from '@kit.BasicServicesKit'; 21 22let timer: reminderAgentManager.ReminderRequestTimer = { 23 reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER, 24 triggerTimeInSeconds: 10 25} 26 27reminderAgentManager.publishReminder(timer, (err: BusinessError, reminderId: number) => { 28 // Before the change, the API returns a success response, indicating that the reminder is successfully published. The value of reminderId is greater than 0. 29}); 30``` 31 32After change: The application attempts to uses reminderAgentManager to create a deferred reminder. The API fails to be called and error code 1700002 is returned. 33 34```ts 35import { BusinessError } from '@kit.BasicServicesKit'; 36 37let timer: reminderAgentManager.ReminderRequestTimer = { 38 reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER, 39 triggerTimeInSeconds: 10 40} 41 42reminderAgentManager.publishReminder(timer, (err: BusinessError, reminderId: number) => { 43 // After the change, the API returns a failure message, with error code 1700002, indicating that the reminder fails to be published. 44 if (err.code == 1700002) { 45 // The application is not under control and cannot use reminderAgentManager. 46 } 47}); 48``` 49 50**Start API Level** 51 529 53 54**Change Since** 55 56OpenHarmony SDK 5.0.0.38 57 58**Key API/Component Changes** 59 60**Adaptation Guide** 61 62Solution 1: 63 64You can use the Calendar API to create a deferred reminder. For details, see [Calendar Kit Development](../../../application-dev/calendarmanager/calendarmanager-event-developer.md). 65 66Solution 2: 67 68If you want to use reminderAgentManager to send a deferred reminder, provide the following information for a request. For details, see [Agent-Powered Reminders](../../../application-dev/task-management/agent-powered-reminder.md). 69 70Permission name: Agent-powered Reminder. 71 72Application name: value of the **label** field in the **module.json5** file. 73 74Bundle name: value of **bundleName** in the **app.json** file. 75 76Usage scenario: Provide the reason, purpose, and necessity of using agent-powered reminders. Attach pictures (if any). 77 78 <!--no_check-->