diff --git a/global/resource_management/include/resourcemanager/ohresmgr.h b/global/resource_management/include/resourcemanager/ohresmgr.h index ea4c2b7aed217284d8a526b4481503398aea92ea..3e606ba8355b8704dc90f5e9d8a7c6998851a3b0 100644 --- a/global/resource_management/include/resourcemanager/ohresmgr.h +++ b/global/resource_management/include/resourcemanager/ohresmgr.h @@ -410,10 +410,29 @@ ResourceManager_ErrorCode OH_ResourceManager_GetLocalesData(const NativeResource {@link ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED} 9001009 - If failed to access the system resource. {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. * @since 12 + * @deprecated since 20 + * @useinstead OH_ResourceManager_GetResourceConfiguration */ ResourceManager_ErrorCode OH_ResourceManager_GetConfiguration(const NativeResourceManager *mgr, ResourceManager_Configuration *configuration); +/** + * @brief Obtains the device configuration. + * + * You need to call the OH_ResourceManager_ReleaseConfiguration() method to release the memory. + * If you use malloc to create a ResourceManager_Configuration object, you also need to call free to release it. + * + * @param {NativeResourceManager} mgr Indicates the pointer to {@link NativeResourceManager} + * {@link OH_ResourceManager_InitNativeResourceManager}. + * @param {ResourceManager_Configuration} configuration the result write to ResourceManager_Configuration. + * @return {@link SUCCESS} 0 - Success. + {@link ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED} 9001009 - If failed to access the system resource. + {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. + * @since 20 + */ +ResourceManager_ErrorCode OH_ResourceManager_GetResourceConfiguration(const NativeResourceManager *mgr, + ResourceManager_Configuration *configuration); + /** * @brief Release the device configuration. * @param configuration the object need to release. diff --git a/global/resource_management/libnative_resmgr.ndk.json b/global/resource_management/libnative_resmgr.ndk.json index ecf4734743c4b9741c0cb551afffa01c07ab82e2..4ce47e3e1e297ff7ea2392e55dc12f88fcf1fe6a 100644 --- a/global/resource_management/libnative_resmgr.ndk.json +++ b/global/resource_management/libnative_resmgr.ndk.json @@ -154,5 +154,9 @@ { "first_introduced": "18", "name": "OH_ResourceManager_GetDoublePluralStringByName" + }, + { + "first_introduced": "20", + "name": "OH_ResourceManager_GetResourceConfiguration" } ] \ No newline at end of file