From a43f213f756b846290bdf3946ee872b279425560 Mon Sep 17 00:00:00 2001 From: zhuhan Date: Mon, 31 Mar 2025 09:29:55 +0800 Subject: [PATCH] resource dir Signed-off-by: zhuhan Change-Id: I33cdd724c3447d479f50ffed6b3859505e2f234a --- .../ability_runtime/application_context.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index bb39d5978..ed62cf402 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -213,6 +213,24 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetDistributedFiles AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetCloudFileDir( char* buffer, const int32_t bufferSize, int32_t* writeLength); +/** + * @brief Obtain the resource directory of the target module. + * + * @param moduleName The module name. + * @param buffer A pointer to a buffer that receives the resource directory of the target module. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(const char* moduleName, + char* buffer, const int32_t bufferSize, int32_t* writeLength); + /** * @brief Starts self UIAbility. * -- Gitee