From 3e0dcb0f0624a6caea92c0d3b69e890648a10b1b Mon Sep 17 00:00:00 2001 From: chengshichang Date: Mon, 14 Jul 2025 14:50:12 +0800 Subject: [PATCH] Signed-off-by: csc --- ...esourceschedule.backgroundTaskManager.d.ts | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index c5bb4124f4..eb58db0300 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. * -- Gitee