diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index c5bb4124f4bb894623f87175af8b2e33235dca47..eb58db030083410dd10c8510daf4bfcb5fe28599 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -273,6 +273,13 @@ declare namespace backgroundTaskManager { * @since 20 */ wantAgentAbilityName: string; + /** + * The suspend state of apply continuous task. + * @type { boolean } + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 20 + */ + suspendState: boolean; } /** @@ -735,7 +742,8 @@ declare namespace backgroundTaskManager { function stopBackgroundRunning(context: Context): Promise; /** - * Obtains all the continuous tasks before an application enters the suspended state. + * Obtains all the continuous tasks before an application enters the suspended state, + * including continuous tasks in suspended state. * * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. @@ -750,6 +758,23 @@ declare namespace backgroundTaskManager { */ function getAllContinuousTasks(context: Context): Promise; + /** + * Obtains all the continuous tasks before an application enters the suspended state. + * + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param { Context } context - App running context. + * @param { boolean } includeSuspended - Return the suspended continuous tasks. + * @returns { Promise } The promise returns the continuous task info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters; + *
2. Failed to apply for memory. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9800005 - Continuous task verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 20 + */ + function getAllContinuousTasks(context: Context, includeSuspended: boolean): Promise; + /** * Apply or unapply efficiency resources. *