1e41f4b71Sopenharmony_ci# Resource Scheduler Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.backgroundtasks.1 Permission Control Added for reminderAgentManager.publishReminder 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci**Access Level** 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciPublic API 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci**Reason for Change** 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciApplications 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. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci**Change Impact** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciThis change is a non-compatible change. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciBefore change: An application uses reminderAgentManager to create a deferred reminder. The API is successfully called, and a reminder ID is returned. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci```ts 20e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_cilet timer: reminderAgentManager.ReminderRequestTimer = { 23e41f4b71Sopenharmony_ci reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER, 24e41f4b71Sopenharmony_ci triggerTimeInSeconds: 10 25e41f4b71Sopenharmony_ci} 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_cireminderAgentManager.publishReminder(timer, (err: BusinessError, reminderId: number) => { 28e41f4b71Sopenharmony_ci // Before the change, the API returns a success response, indicating that the reminder is successfully published. The value of reminderId is greater than 0. 29e41f4b71Sopenharmony_ci}); 30e41f4b71Sopenharmony_ci``` 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ciAfter change: The application attempts to uses reminderAgentManager to create a deferred reminder. The API fails to be called and error code 1700002 is returned. 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci```ts 35e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_cilet timer: reminderAgentManager.ReminderRequestTimer = { 38e41f4b71Sopenharmony_ci reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER, 39e41f4b71Sopenharmony_ci triggerTimeInSeconds: 10 40e41f4b71Sopenharmony_ci} 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_cireminderAgentManager.publishReminder(timer, (err: BusinessError, reminderId: number) => { 43e41f4b71Sopenharmony_ci // After the change, the API returns a failure message, with error code 1700002, indicating that the reminder fails to be published. 44e41f4b71Sopenharmony_ci if (err.code == 1700002) { 45e41f4b71Sopenharmony_ci // The application is not under control and cannot use reminderAgentManager. 46e41f4b71Sopenharmony_ci } 47e41f4b71Sopenharmony_ci}); 48e41f4b71Sopenharmony_ci``` 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci**Start API Level** 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci9 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci**Change Since** 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci**Key API/Component Changes** 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Adaptation Guide** 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ciSolution 1: 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ciYou can use the Calendar API to create a deferred reminder. For details, see [Calendar Kit Development](../../../application-dev/calendarmanager/calendarmanager-event-developer.md). 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ciSolution 2: 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ciIf 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). 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ciPermission name: Agent-powered Reminder. 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ciApplication name: value of the **label** field in the **module.json5** file. 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ciBundle name: value of **bundleName** in the **app.json** file. 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ciUsage scenario: Provide the reason, purpose, and necessity of using agent-powered reminders. Attach pictures (if any). 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci <!--no_check-->