From 183ad8c4b4e44f123c3876551d6d775a748b3f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Mon, 31 Mar 2025 03:44:31 +0000 Subject: [PATCH 1/4] update backgroundtasks/transient/libtransient_task.ndk.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- backgroundtasks/transient/libtransient_task.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backgroundtasks/transient/libtransient_task.ndk.json b/backgroundtasks/transient/libtransient_task.ndk.json index df952bfe1..5d777b019 100644 --- a/backgroundtasks/transient/libtransient_task.ndk.json +++ b/backgroundtasks/transient/libtransient_task.ndk.json @@ -10,5 +10,9 @@ { "first_introduced": "13", "name": "OH_BackgroundTaskManager_CancelSuspendDelay" + }, + { + "first_introduced": "20", + "name": "OH_BackgroundTaskManager_GetAllTransientTasks" } ] \ No newline at end of file -- Gitee From 93943c854de2d16c8639fc76c4f1b75fceaa34a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Mon, 31 Mar 2025 03:45:58 +0000 Subject: [PATCH 2/4] update backgroundtasks/transient/include/transient_task_api.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- .../transient/include/transient_task_api.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index 874e64734..df2299322 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -100,6 +100,21 @@ int32_t OH_BackgroundTaskManager_GetRemainingDelayTime(int32_t requestId, int32_ */ int32_t OH_BackgroundTaskManager_CancelSuspendDelay(int32_t requestId); +/** + * @brief Obtains all the transient task before an application enters the suspended state. + * + * @param transientTaskInfo Indicates the transient task info of an application. + * @return {@link ERR_TRANSIENT_TASK_OK} 0 - Success. + * {@link ERR_TRANSIENT_TASK_INVALID_PARAM} 401 - Invalid parameter. + * {@link ERR_TRANSIENT_TASK_PARCEL_FAILED} 9800001 - Memory operation failed. + * {@link ERR_TRANSIENT_TASK_PARCEL_FAILED} 9800002 - Parcelable failed. + * {@link ERR_TRANSIENT_TASK_SYS_NOT_READY} 9800004 - System service not ready. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 20 + * @version 1.0 + */ +int32_t OH_BackgroundTaskManager_GetAllTransientTasks(TransientTask_TransientTaskInfo *transientTaskInfo); + #ifdef __cplusplus } #endif -- Gitee From 1b1c56ebb0a40997bb827814e7de8ab5a7e0859c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Mon, 31 Mar 2025 03:47:09 +0000 Subject: [PATCH 3/4] update backgroundtasks/transient/include/transient_task_type.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- .../transient/include/transient_task_type.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 7a19adf75..94d86593e 100644 --- a/backgroundtasks/transient/include/transient_task_type.h +++ b/backgroundtasks/transient/include/transient_task_type.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -91,6 +91,19 @@ typedef struct TransientTask_DelaySuspendInfo { int32_t actualDelayTime; } TransientTask_DelaySuspendInfo; +/** + * @brief Define CallBack Info for an application. + * + * @since 20 + * @version 1.0 + */ +typedef struct TransientTask_TransientTaskInfo { + /** The remaining quota of the delay request */ + int32_t remainingQuota; + /** The info of delay suspend */ + std::vector transientTask; +} TransientTask_TransientTaskInfo; + /** * @brief Define a callback function when delay time expired. * @since 13 -- Gitee From b8fbd9025c1516940bd6b243e1f27fdefd67bedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Mon, 31 Mar 2025 03:47:26 +0000 Subject: [PATCH 4/4] update backgroundtasks/transient/include/transient_task_api.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡伟 --- backgroundtasks/transient/include/transient_task_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index df2299322..7fcc0c23a 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee