From 0a35cbc3945282dc70830478950af7146e09d6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Thu, 24 Apr 2025 01:27:18 +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 d8dfecc5e41f8801c061e5293d6504187b61225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Thu, 24 Apr 2025 01:28:44 +0000 Subject: [PATCH 2/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 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_type.h b/backgroundtasks/transient/include/transient_task_type.h index 7a19adf75..6cca71caf 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 @@ -37,6 +37,7 @@ #define OHOS_BACKGROUOND_TASK_MANAGER_TRANSIENT_TASK_TYPE_H #include +#include #ifdef __cplusplus extern "C" { @@ -91,6 +92,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 transientTasks; +} TransientTask_TransientTaskInfo; + /** * @brief Define a callback function when delay time expired. * @since 13 -- Gitee From 22a97981f498c92531f8ebd04140f2bdb36de167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Thu, 24 Apr 2025 01:29:47 +0000 Subject: [PATCH 3/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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index 874e64734..f93002bbb 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 @@ -100,6 +100,18 @@ 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_CLIENT_INFO_VERIFICATION_FAILED} 9900001 - uid or pid info verify failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 20 + * @version 1.0 + */ +int32_t OH_BackgroundTaskManager_GetAllTransientTasks(TransientTask_TransientTaskInfo *transientTaskInfo); + #ifdef __cplusplus } #endif -- Gitee From cb5c69ac34d77b5f7bf4f1e859d951da1436bccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BC=9F?= Date: Thu, 24 Apr 2025 01:46:23 +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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backgroundtasks/transient/include/transient_task_api.h b/backgroundtasks/transient/include/transient_task_api.h index f93002bbb..7fcc0c23a 100644 --- a/backgroundtasks/transient/include/transient_task_api.h +++ b/backgroundtasks/transient/include/transient_task_api.h @@ -105,7 +105,10 @@ int32_t OH_BackgroundTaskManager_CancelSuspendDelay(int32_t requestId); * * @param transientTaskInfo Indicates the transient task info of an application. * @return {@link ERR_TRANSIENT_TASK_OK} 0 - Success. - * {@link ERR_TRANSIENT_TASK_CLIENT_INFO_VERIFICATION_FAILED} 9900001 - uid or pid info verify failed. + * {@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 -- Gitee