From 86a030b6b21b9cea99de0fb2019a4a6b31aa2370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=AC=A3=E5=AE=87?= Date: Mon, 2 Sep 2024 02:48:24 +0000 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9BNDK=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BA=94=E7=94=A8=E5=85=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?MainElement=E4=BF=A1=E6=81=AF-=E6=8C=91=E5=8D=955.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张欣宇 Change-Id: If58be9c2d2a2b39e8218a5b0ed07b85ae4d76c34 --- .../bundle/include/native_interface_bundle.h | 35 +++++++++++++++++++ .../bundle/libbundle.ndk.json | 4 +++ 2 files changed, 39 insertions(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 67fcee95a..2cc076408 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -62,6 +62,20 @@ struct OH_NativeBundle_ApplicationInfo { char* fingerprint; }; +/** + * @brief Indicates information of elementName. + * + * @since 13 + */ +struct OH_NativeBundle_ElementName { + /** Indicates the name of application. */ + char* bundleName; + /** Indicates the name of module. */ + char* moduleName; + /** Indicates the name of ability. */ + char* abilityName; +}; + /** * @brief Indicates information of application * @@ -70,6 +84,14 @@ struct OH_NativeBundle_ApplicationInfo { */ typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo; +/** + * @brief Indicates information of elementName + * + * @since 13 + * @version 1.0 + */ +typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; + /** * @brief Obtains the application info based on the The current bundle. * @@ -110,6 +132,19 @@ char* OH_NativeBundle_GetAppId(); * @version 1.0 */ char* OH_NativeBundle_GetAppIdentifier(); + +/** +* @brief Obtains information of the entry mainElement based on the current application, including bundle name, + * module name, and ability name. + * 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 OH_NativeBundle_ElementName object, 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 13 + */ +OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index f27f55688..a9db17ede 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -10,5 +10,9 @@ { "first_introduced": "11", "name": "OH_NativeBundle_GetAppIdentifier" + }, + { + "first_introduced": "13", + "name": "OH_NativeBundle_GetMainElementName" } ] -- Gitee