From 2d5dfeec53d9ec9d35b42206d3f84f54448ee5f2 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Fri, 14 Mar 2025 15:32:42 +0800 Subject: [PATCH 1/5] 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 | 114 ++++++++++++++++++ 1 file changed, 114 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..1f68efe02 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -37,6 +37,8 @@ #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 + #ifdef __cplusplus extern "C" { #endif @@ -76,6 +78,82 @@ struct OH_NativeBundle_ElementName { char* abilityName; }; +/** + * @brief Indicates information of Metadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ +struct OH_NativeBundle_Metadata { + /** + * @brief Indicates information of name + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* name; + /** + * @brief Indicates information of value + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* value; + /** + * @brief Indicates information of resource + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* resource; +}; + +/** + * @brief Indicates information of Metadata + * + * @since 20 + * @version 1.0 + */ +typedef struct OH_NativeBundle_Metadata OH_NativeBundle_Metadata; + +/** + * @brief Indicates information of ModuleMetadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ +struct OH_NativeBundle_ModuleMetadata { + /** + * @brief Indicates the moduleName of ModuleMetadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* moduleName; + /** + * @brief Indicates the Metadata array of module + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + OH_NativeBundle_Metadata* metadataArray; + /** + * @brief Indicates the Metadata array size of module + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + size_t metadataArraySize; +}; + /** * @brief Indicates information of application * @@ -92,6 +170,14 @@ typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo; */ typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; +/** + * @brief Indicates information of ModuleMetadata + * + * @since 20 + * @version 1.0 + */ +typedef struct OH_NativeBundle_ModuleMetadata OH_NativeBundle_ModuleMetadata; + /** * @brief Obtains the application info based on the The current bundle. * @@ -159,6 +245,34 @@ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); * @version 1.0 */ char* OH_NativeBundle_GetCompatibleDeviceType(); + +/** + * @brief Obtains the debug information 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 debug information, + * 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 20 + * @version 1.0 + */ +char* OH_NativeBundle_GetDebug(); + +/** + * @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 size of the module metadata array. + * @return Returns the newly created OH_NativeBundle_ModuleMetadata 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. + * @since 20 + * @version 1.0 + */ +OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); #ifdef __cplusplus }; #endif -- Gitee From 075bac7947b750910957d46a71f2fabe1f488225 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 15 Mar 2025 09:52:20 +0800 Subject: [PATCH 2/5] 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 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 1f68efe02..4f9b885ec 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -247,18 +247,13 @@ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); char* OH_NativeBundle_GetCompatibleDeviceType(); /** - * @brief Obtains the debug information of the current application. - * After utilizing this interface, to prevent memory leaks, - * it is necessary to manually release the pointer returned by the interface. + * @brief Obtains the application debug mode. * - * @return Returns the newly created string that indicates the debug information, - * 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. + * @return Returns true if the application is in debug mode; returns false otherwise. * @since 20 * @version 1.0 */ -char* OH_NativeBundle_GetDebug(); +bool OH_NativeBundle_IsDebugMode(); /** * @brief Obtains the module metadata array of the current application. -- Gitee From ec25f3ffb753cb54ff2da8269e4c7198d447194a Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 15 Mar 2025 09:58:14 +0800 Subject: [PATCH 3/5] 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 4f9b885ec..6d090d874 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -87,7 +87,7 @@ struct OH_NativeBundle_ElementName { */ struct OH_NativeBundle_Metadata { /** - * @brief Indicates information of name + * @brief Indicates the metadata name * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 20 @@ -95,7 +95,7 @@ struct OH_NativeBundle_Metadata { */ char* name; /** - * @brief Indicates information of value + * @brief Indicates the metadata value * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 20 @@ -103,7 +103,7 @@ struct OH_NativeBundle_Metadata { */ char* value; /** - * @brief Indicates information of resource + * @brief Indicates the metadata resource * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 20 -- Gitee From 2b0699f3d9d50260bb61379e047f658907eea22c Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 15 Mar 2025 10:06:32 +0800 Subject: [PATCH 4/5] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 6d090d874..9efa36d28 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -256,11 +256,11 @@ char* OH_NativeBundle_GetCompatibleDeviceType(); bool OH_NativeBundle_IsDebugMode(); /** - * @brief Obtains the module metadata array of the current application. + * @brief Obtains the OH_NativeBundle_ModuleMetadata 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 size of the module metadata array. + * @param size Indicates the OH_NativeBundle_ModuleMetadata array size. * @return Returns the newly created OH_NativeBundle_ModuleMetadata 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. -- Gitee From b87eafae064591e032f02fea37471d695fefcf1a Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 15 Mar 2025 10:14:52 +0800 Subject: [PATCH 5/5] 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 9efa36d28..8e0e2424d 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -37,6 +37,7 @@ #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 -- Gitee