From fd5554cb752a950a6d664a221638668876387487 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 15 Mar 2025 10:17:28 +0800 Subject: [PATCH 1/2] Issue:#IBTEWL Description:add debug and metadata interface Sig: SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source: No Signed-off-by: SoftSquirrel --- .../bundle/include/native_interface_bundle.h | 102 ++++++++++++++++++ .../bundle/libbundle.ndk.json | 8 ++ 2 files changed, 110 insertions(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 04bb5d331..a090cf6c2 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -37,6 +37,9 @@ #ifndef FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H #define FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -76,6 +79,74 @@ struct OH_NativeBundle_ElementName { char* abilityName; }; +/** + * @brief Indicates information of metadata + * + * @atomicservice + * @since 20 + */ +struct OH_NativeBundle_Metadata { + /** + * @brief Indicates the metadata name + * + * @atomicservice + * @since 20 + */ + char* name; + /** + * @brief Indicates the metadata value + * + * @atomicservice + * @since 20 + */ + char* value; + /** + * @brief Indicates the metadata resource + * + * @atomicservice + * @since 20 + */ + char* resource; +}; + +/** + * @brief Indicates information of metadata + * + * @atomicservice + * @since 20 + */ +typedef struct OH_NativeBundle_Metadata OH_NativeBundle_Metadata; + +/** + * @brief Indicates information of module metadata + * + * @atomicservice + * @since 20 + */ +struct OH_NativeBundle_ModuleMetadata { + /** + * @brief Indicates the moduleName of module + * + * @atomicservice + * @since 20 + */ + char* moduleName; + /** + * @brief Indicates the metadata array of module + * + * @atomicservice + * @since 20 + */ + OH_NativeBundle_Metadata* metadataArray; + /** + * @brief Indicates the metadata array size of module + * + * @atomicservice + * @since 20 + */ + size_t metadataArraySize; +}; + /** * @brief Indicates information of application * @@ -92,6 +163,13 @@ typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo; */ typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; +/** + * @brief Indicates information of module metadata + * + * @since 20 + */ +typedef struct OH_NativeBundle_ModuleMetadata OH_NativeBundle_ModuleMetadata; + /** * @brief Obtains the application info based on the The current bundle. * @@ -159,6 +237,30 @@ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); * @version 1.0 */ char* OH_NativeBundle_GetCompatibleDeviceType(); + +/** + * @brief Obtains the application debug mode. + * + * @param isDebugMode Indicates whether the application is in debug mode. + * @return Returns true if call successful, false otherwise. + * @atomicservice + * @since 20 + */ +bool OH_NativeBundle_IsDebugMode(bool* isDebugMode); + +/** + * @brief Obtains the module metadata array of the current application. + * After utilizing this interface, to prevent memory leaks, + * it is necessary to manually release the pointer returned by the interface. + * + * @param size Indicates the module metadata array size. + * @return Returns the newly created module metadata array, 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. + * @atomicservice + * @since 20 + */ +OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); #ifdef __cplusplus }; #endif diff --git a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json index f61863508..7c05eef7b 100644 --- a/bundlemanager/bundle_framework/bundle/libbundle.ndk.json +++ b/bundlemanager/bundle_framework/bundle/libbundle.ndk.json @@ -18,5 +18,13 @@ { "first_introduced": "14", "name": "OH_NativeBundle_GetCompatibleDeviceType" + }, + { + "first_introduced": "20", + "name": "OH_NativeBundle_IsDebugMode" + }, + { + "first_introduced": "20", + "name": "OH_NativeBundle_GetModuleMetadata" } ] -- Gitee From 15544f42af65001a5699ae63a99a7fa7e8f64776 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Wed, 26 Mar 2025 16:58:14 +0800 Subject: [PATCH 2/2] Issue:#IBTEWL Description:add debug and metadata interface Sig: SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source: No Signed-off-by: SoftSquirrel --- .../bundle_framework/bundle/include/native_interface_bundle.h | 1 + 1 file changed, 1 insertion(+) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index a090cf6c2..e82033fb4 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -166,6 +166,7 @@ typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; /** * @brief Indicates information of module metadata * + * @atomicservice * @since 20 */ typedef struct OH_NativeBundle_ModuleMetadata OH_NativeBundle_ModuleMetadata; -- Gitee