From 55d94d87ef1f204f23c68b4f1f88dca9c23e01c2 Mon Sep 17 00:00:00 2001 From: liumingyue Date: Fri, 18 Oct 2024 16:09:21 +0800 Subject: [PATCH] add OH_NativeBundle_GetCompatibleDeviceType Signed-off-by: liumingyue --- .../bundle/include/native_interface_bundle.h | 14 ++++++++++++++ .../bundle_framework/bundle/libbundle.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 2cc076408..04bb5d331 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -145,6 +145,20 @@ char* OH_NativeBundle_GetAppIdentifier(); * @since 13 */ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); + +/** + * @brief Obtains the compatible device type of the current application. + * After utilizing this interface, to prevent memory leaks, + * it is necessary to manually release the pointer returned by the interface. + * + * @return Returns the newly created string that indicates the compatible device type, + * if the returned object is NULL, it indicates creation failure. + * The possible cause of failure could be that the application address space is full, + * leading to space allocation failure. + * @since 14 + * @version 1.0 + */ +char* OH_NativeBundle_GetCompatibleDeviceType(); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index a9db17ede..f61863508 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -14,5 +14,9 @@ { "first_introduced": "13", "name": "OH_NativeBundle_GetMainElementName" + }, + { + "first_introduced": "14", + "name": "OH_NativeBundle_GetCompatibleDeviceType" } ]