From a5830e21bdde5d2960a95967979e35f2870ff6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 18 Aug 2025 15:10:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?descritpion:UIAbility=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0&?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0ndk?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../ability_runtime/application_context.h | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 00c5d579d45..d8adee954a1 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -307,6 +307,40 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); +/** + * @brief Obtain the launch parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the launch parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the latest parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the latest parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + #ifdef __cplusplus } // extern "C" #endif -- Gitee From 376f1dd4538d5c12916cee89a1660488f7d26a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 18 Aug 2025 15:10:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?descritpion:UIAbility=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0&?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0ndk?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../ability_runtime/application_context.h | 34 +++++++++++++++++++ .../libability_runtime.ndk.json | 8 +++++ 2 files changed, 42 insertions(+) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 00c5d579d45..d8adee954a1 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -307,6 +307,40 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); +/** + * @brief Obtain the launch parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the launch parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief Obtain the latest parameter of starting UIAbility. + * + * @param buffer A pointer to a buffer that receives the latest parameter of starting UIAbility. + * @param bufferSize The length of the buffer. + * @param writeLength The string length actually written to the buffer, + * when returning {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR}. + * @return The error code. + * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, + * or the buffer size is less than the minimum buffer size. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * @since 20 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( + char* buffer, const int32_t bufferSize, int32_t* writeLength); + #ifdef __cplusplus } // extern "C" #endif diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index f7939128e40..5874cdc39af 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -178,6 +178,14 @@ { "first_introduced": "20", "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" + }, + { + "first_introduced": "20", + "name": "OH_AbilityRuntime_ApplicationContextGetLaunchParameter" + }, + { + "first_introduced": "20", + "name": "OH_AbilityRuntime_ApplicationContextGetLatestParameter" }, { "first_introduced": "21", -- Gitee From 2881baac82c6a2ec6ee7273d9fb33bc51be3a63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 25 Aug 2025 09:41:02 +0000 Subject: [PATCH 3/5] update AbilityKit/ability_runtime/application_context.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- AbilityKit/ability_runtime/application_context.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index d8adee954a1..11f2c26c3af 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -319,7 +319,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int6 * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, * or the buffer size is less than the minimum buffer size. * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. - * @since 20 + * @since 21 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( char* buffer, const int32_t bufferSize, int32_t* writeLength); @@ -336,7 +336,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the buffer or writeLength is null, * or the buffer size is less than the minimum buffer size. * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. - * @since 20 + * @since 21 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( char* buffer, const int32_t bufferSize, int32_t* writeLength); -- Gitee From ebab64868e900d72f4d6e82130839320adfeebfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 25 Aug 2025 09:42:04 +0000 Subject: [PATCH 4/5] update AbilityKit/ability_runtime/libability_runtime.ndk.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- AbilityKit/ability_runtime/libability_runtime.ndk.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AbilityKit/ability_runtime/libability_runtime.ndk.json b/AbilityKit/ability_runtime/libability_runtime.ndk.json index 5874cdc39af..7be5ba100fe 100644 --- a/AbilityKit/ability_runtime/libability_runtime.ndk.json +++ b/AbilityKit/ability_runtime/libability_runtime.ndk.json @@ -180,11 +180,11 @@ "name": "OH_AbilityRuntime_ApplicationContextGetResourceDir" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_AbilityRuntime_ApplicationContextGetLaunchParameter" }, { - "first_introduced": "20", + "first_introduced": "21", "name": "OH_AbilityRuntime_ApplicationContextGetLatestParameter" }, { -- Gitee From 262789e182e0e76d6c96ba957d0f66861c041001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Fri, 5 Sep 2025 09:33:54 +0000 Subject: [PATCH 5/5] update AbilityKit/ability_runtime/application_context.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- AbilityKit/ability_runtime/application_context.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AbilityKit/ability_runtime/application_context.h b/AbilityKit/ability_runtime/application_context.h index 4336a37c75f..af2d128fc67 100644 --- a/AbilityKit/ability_runtime/application_context.h +++ b/AbilityKit/ability_runtime/application_context.h @@ -294,7 +294,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbility(AbilityBase_Want * AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(AbilityBase_Want *want, AbilityRuntime_StartOptions *options); - /** +/** * @brief Obtain the version code of the application. * * @param versionCode The version code of the application. @@ -340,6 +340,8 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLaunchParameter( */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetLatestParameter( char* buffer, const int32_t bufferSize, int32_t* writeLength); + +/** * @brief Starts self UIAbility with start options and receives the process ID. * * @permission ohos.permission.NDK_START_SELF_UI_ABILITY -- Gitee