diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 67fcee95add3784728a2d1bde59e09215829fb64..2cc076408560ac4b5c248b480ab3760879a53bbd 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 f27f556889a6ed45be8813d4364241f33e5ad44a..a9db17ede55a4bedd17b04a0584461c3da418284 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" } ]