diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index bb39d5978ceb309b96b786f17d09c83505e0a98b..ed62cf40293ae91ec6ccbeaefa601c04a514f874 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. * diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index 3ae8eaeeed597d289170a04a44f9ccb054ebd6c8..6790d7d683b7cd97f6cc22c4bbe81b71f9080e18 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -174,5 +174,9 @@ { "first_introduced": "17", "name": "OH_AbilityRuntime_GetStartOptionsMaxWindowHeight" + }, + { + "first_introduced": "20", + "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" } ] \ No newline at end of file