From 7e9b1e49181331177984f0881d5f02a0a5405826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Mon, 4 Aug 2025 16:56:36 +0800 Subject: [PATCH 01/10] add OH_AbilityRuntime_ApplicationContextGetVersionCode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../src/application_context.cpp | 21 +++++++++++++++++++ .../ability_runtime/ability_runtime_common.h | 5 +++++ .../c/ability_runtime/application_context.h | 15 ++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/frameworks/c/ability_runtime/src/application_context.cpp b/frameworks/c/ability_runtime/src/application_context.cpp index b4a34372ee4..4ba8ed2bf28 100644 --- a/frameworks/c/ability_runtime/src/application_context.cpp +++ b/frameworks/c/ability_runtime/src/application_context.cpp @@ -342,4 +342,25 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab OHOS::AAFwk::StartOptions startOptions = options->GetInnerStartOptions(); return ConvertToAPI18BusinessErrorCode(AbilityManagerClient::GetInstance()->StartSelfUIAbilityWithStartOptions( abilityWant, startOptions)); +} + +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode) +{ + TAG_LOGD(AAFwkTag::APPKIT, "getVersionCode called"); + if (versionCode == nullptr) { + TAG_LOGE(AAFwkTag::APPKIT, "versionCode is null"); + return ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID; + } + const auto appContext = Context::GetApplicationContext(); + if (appContext == nullptr) { + TAG_LOGE(AAFwkTag::APPKIT, "appContext is null"); + return ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST; + } + const auto appApplicationInfo = appContext->GetApplicationInfo(); + if (appApplicationInfo == nullptr) { + TAG_LOGE(AAFwkTag::APPKIT, "applicationInfo is null"); + return ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST; + } + *versionCode = static_cast(appApplicationInfo->versionCode); + return ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; } \ No newline at end of file diff --git a/interfaces/kits/c/ability_runtime/ability_runtime_common.h b/interfaces/kits/c/ability_runtime/ability_runtime_common.h index 704d6c80fb9..caf011d345d 100644 --- a/interfaces/kits/c/ability_runtime/ability_runtime_common.h +++ b/interfaces/kits/c/ability_runtime/ability_runtime_common.h @@ -138,6 +138,11 @@ typedef enum { * @since 17 */ ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED = 16000079, + /** + * @error The application info does not exist. + * @since 17 + */ + ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST = 16000080, } AbilityRuntime_ErrorCode; #ifdef __cplusplus diff --git a/interfaces/kits/c/ability_runtime/application_context.h b/interfaces/kits/c/ability_runtime/application_context.h index 95356eb1266..22211790aa4 100644 --- a/interfaces/kits/c/ability_runtime/application_context.h +++ b/interfaces/kits/c/ability_runtime/application_context.h @@ -292,11 +292,24 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab * {@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 18 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(const char* moduleName, char* buffer, const int32_t bufferSize, int32_t* writeLength); +/** + * @brief Obtain the version code of the application. + * + * @param versionCode The version code of the application. + * @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 versionCode is null. + * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. + * {@link ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST} if the application info does not exist. + * @since 18 + */ +AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); + #ifdef __cplusplus } // extern "C" #endif -- Gitee From 4c2951984458d11254482277333e028ba32cac45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 8 Aug 2025 16:07:28 +0800 Subject: [PATCH 02/10] add tdd GetVersionCode_001 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- ...ility_runtime_application_context_test.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp index 97c9b3d77f9..3989b8a3aaf 100644 --- a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp +++ b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp @@ -2624,4 +2624,28 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, ConvertToAPI18BusinessErrorCo errCode = ConvertToAPI18BusinessErrorCode(abilityManagerError); EXPECT_EQ(errCode, ABILITY_RUNTIME_ERROR_CODE_INTERNAL); } + +/** + * @tc.number: GetVersionCode_001 + * @tc.desc: Function test with applicationContextImpl is nullptr + * @tc.type: FUNC + */ +HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize.Level2) +{ + auto contextImpl = InitApplicationContextImpl(); + auto applicationInfo = std::make_shared(); + applicationInfo->versionCode = 111; + ContextImpl->SetApplicationInfo(&applicationInfo); + + int64_t* versionCode; + AbilityRuntime_ErrorCode code = OH_AbilityRuntime_ApplicationContextGetVersionCode(NULL); + ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); + + code = OH_AbilityRuntime_ApplicationContextGetVersionCode(nullptr); + ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); + + code = OH_AbilityRuntime_ApplicationContextGetVersionCode(&versionCode); + ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); + ASSERT_EQ(mode, 111); +} } // namespace OHOS::AbilityRuntime -- Gitee From 0e705886bf2928e492eb3dda576610e1674cb4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 8 Aug 2025 17:12:54 +0800 Subject: [PATCH 03/10] fix InitApplicationContextImpl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../capi_ability_runtime_application_context_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp index 3989b8a3aaf..354b5ec6255 100644 --- a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp +++ b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp @@ -2632,7 +2632,7 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, ConvertToAPI18BusinessErrorCo */ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize.Level2) { - auto contextImpl = InitApplicationContextImpl(); + auto contextImpl = InitApplicationContextImpl(TEST_BUNDLE_NAME); auto applicationInfo = std::make_shared(); applicationInfo->versionCode = 111; ContextImpl->SetApplicationInfo(&applicationInfo); -- Gitee From 8ef0b3fb127c0ae22fe11e78794b74708ae4d181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 8 Aug 2025 17:19:33 +0800 Subject: [PATCH 04/10] fix ContextImpl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../capi_ability_runtime_application_context_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp index 354b5ec6255..557f25d84df 100644 --- a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp +++ b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp @@ -2635,7 +2635,7 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize. auto contextImpl = InitApplicationContextImpl(TEST_BUNDLE_NAME); auto applicationInfo = std::make_shared(); applicationInfo->versionCode = 111; - ContextImpl->SetApplicationInfo(&applicationInfo); + contextImpl->SetApplicationInfo(&applicationInfo); int64_t* versionCode; AbilityRuntime_ErrorCode code = OH_AbilityRuntime_ApplicationContextGetVersionCode(NULL); -- Gitee From 979f99a8d1add0bf732f8039017c13ee3ec7ff5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Sat, 9 Aug 2025 16:37:22 +0800 Subject: [PATCH 05/10] fix tdd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../capi_ability_runtime_application_context_test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp index 557f25d84df..bcf927eb4d8 100644 --- a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp +++ b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp @@ -2633,8 +2633,10 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, ConvertToAPI18BusinessErrorCo HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize.Level2) { auto contextImpl = InitApplicationContextImpl(TEST_BUNDLE_NAME); + ASSERT_NE(contextImpl, nullptr); + auto applicationInfo = std::make_shared(); - applicationInfo->versionCode = 111; + applicationInfo ->versionCode = 111; contextImpl->SetApplicationInfo(&applicationInfo); int64_t* versionCode; @@ -2644,8 +2646,8 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize. code = OH_AbilityRuntime_ApplicationContextGetVersionCode(nullptr); ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); - code = OH_AbilityRuntime_ApplicationContextGetVersionCode(&versionCode); + code = OH_AbilityRuntime_ApplicationContextGetVersionCode(versionCode); ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); - ASSERT_EQ(mode, 111); + ASSERT_EQ(*versionCode, 111); } } // namespace OHOS::AbilityRuntime -- Gitee From 1d31d68848609038d3e89076dc630f2862bd2f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Sat, 9 Aug 2025 17:24:12 +0800 Subject: [PATCH 06/10] code optimization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- ...i_ability_runtime_application_context_test.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp index bcf927eb4d8..2571a5e36c8 100644 --- a/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp +++ b/test/unittest/capi_ability_runtime_application_context_test/capi_ability_runtime_application_context_test.cpp @@ -2636,18 +2636,15 @@ HWTEST_F(CapiAbilityRuntimeApplicationContextTest, GetVersionCode_001, TestSize. ASSERT_NE(contextImpl, nullptr); auto applicationInfo = std::make_shared(); - applicationInfo ->versionCode = 111; - contextImpl->SetApplicationInfo(&applicationInfo); + applicationInfo->versionCode = 111; + contextImpl->SetApplicationInfo(applicationInfo); - int64_t* versionCode; - AbilityRuntime_ErrorCode code = OH_AbilityRuntime_ApplicationContextGetVersionCode(NULL); + int64_t versionCode; + AbilityRuntime_ErrorCode code = OH_AbilityRuntime_ApplicationContextGetVersionCode(nullptr); ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); - code = OH_AbilityRuntime_ApplicationContextGetVersionCode(nullptr); - ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); - - code = OH_AbilityRuntime_ApplicationContextGetVersionCode(versionCode); + code = OH_AbilityRuntime_ApplicationContextGetVersionCode(&versionCode); ASSERT_EQ(code, ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); - ASSERT_EQ(*versionCode, 111); + ASSERT_EQ(versionCode, 111); } } // namespace OHOS::AbilityRuntime -- Gitee From 3e64d5fa68fe65f0d8a061e22475dcb237ecb459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Sat, 9 Aug 2025 17:26:35 +0800 Subject: [PATCH 07/10] update since MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- interfaces/kits/c/ability_runtime/ability_runtime_common.h | 2 +- interfaces/kits/c/ability_runtime/application_context.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interfaces/kits/c/ability_runtime/ability_runtime_common.h b/interfaces/kits/c/ability_runtime/ability_runtime_common.h index caf011d345d..3f18459f01d 100644 --- a/interfaces/kits/c/ability_runtime/ability_runtime_common.h +++ b/interfaces/kits/c/ability_runtime/ability_runtime_common.h @@ -140,7 +140,7 @@ typedef enum { ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED = 16000079, /** * @error The application info does not exist. - * @since 17 + * @since 20 */ ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST = 16000080, } AbilityRuntime_ErrorCode; diff --git a/interfaces/kits/c/ability_runtime/application_context.h b/interfaces/kits/c/ability_runtime/application_context.h index 22211790aa4..236a696b9ae 100644 --- a/interfaces/kits/c/ability_runtime/application_context.h +++ b/interfaces/kits/c/ability_runtime/application_context.h @@ -292,7 +292,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(Ab * {@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 18 + * @since 20 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(const char* moduleName, char* buffer, const int32_t bufferSize, int32_t* writeLength); @@ -306,7 +306,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(cons * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the versionCode is null. * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. * {@link ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST} if the application info does not exist. - * @since 18 + * @since 20 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); -- Gitee From f90878f14a31e69a706f8a8c3a12b055061032bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F=E5=B3=B0?= Date: Tue, 12 Aug 2025 01:15:14 +0000 Subject: [PATCH 08/10] Update interfaces/kits/c/ability_runtime/application_context.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- interfaces/kits/c/ability_runtime/application_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/kits/c/ability_runtime/application_context.h b/interfaces/kits/c/ability_runtime/application_context.h index 236a696b9ae..2816a41b068 100644 --- a/interfaces/kits/c/ability_runtime/application_context.h +++ b/interfaces/kits/c/ability_runtime/application_context.h @@ -306,7 +306,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(cons * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the versionCode is null. * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. * {@link ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST} if the application info does not exist. - * @since 20 + * @since 21 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); -- Gitee From 3356702b5efb0488f4493c7b886c986696c2d771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Tue, 12 Aug 2025 09:18:15 +0800 Subject: [PATCH 09/10] update since MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- interfaces/kits/c/ability_runtime/ability_runtime_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/kits/c/ability_runtime/ability_runtime_common.h b/interfaces/kits/c/ability_runtime/ability_runtime_common.h index 3f18459f01d..c19a1ef4f46 100644 --- a/interfaces/kits/c/ability_runtime/ability_runtime_common.h +++ b/interfaces/kits/c/ability_runtime/ability_runtime_common.h @@ -140,7 +140,7 @@ typedef enum { ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED = 16000079, /** * @error The application info does not exist. - * @since 20 + * @since 21 */ ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST = 16000080, } AbilityRuntime_ErrorCode; -- Gitee From c7c9f91ab3ea87618b739432357128e82d71cdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Tue, 12 Aug 2025 11:12:19 +0800 Subject: [PATCH 10/10] format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- frameworks/c/ability_runtime/src/application_context.cpp | 2 +- interfaces/kits/c/ability_runtime/ability_runtime_common.h | 2 +- interfaces/kits/c/ability_runtime/application_context.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/c/ability_runtime/src/application_context.cpp b/frameworks/c/ability_runtime/src/application_context.cpp index 4ba8ed2bf28..cd2a9e5ceb3 100644 --- a/frameworks/c/ability_runtime/src/application_context.cpp +++ b/frameworks/c/ability_runtime/src/application_context.cpp @@ -359,7 +359,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int6 const auto appApplicationInfo = appContext->GetApplicationInfo(); if (appApplicationInfo == nullptr) { TAG_LOGE(AAFwkTag::APPKIT, "applicationInfo is null"); - return ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST; + return ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED; } *versionCode = static_cast(appApplicationInfo->versionCode); return ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; diff --git a/interfaces/kits/c/ability_runtime/ability_runtime_common.h b/interfaces/kits/c/ability_runtime/ability_runtime_common.h index c19a1ef4f46..673e6f8cb64 100644 --- a/interfaces/kits/c/ability_runtime/ability_runtime_common.h +++ b/interfaces/kits/c/ability_runtime/ability_runtime_common.h @@ -142,7 +142,7 @@ typedef enum { * @error The application info does not exist. * @since 21 */ - ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST = 16000080, + ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED = 16000080, } AbilityRuntime_ErrorCode; #ifdef __cplusplus diff --git a/interfaces/kits/c/ability_runtime/application_context.h b/interfaces/kits/c/ability_runtime/application_context.h index 2816a41b068..0fcab7b5023 100644 --- a/interfaces/kits/c/ability_runtime/application_context.h +++ b/interfaces/kits/c/ability_runtime/application_context.h @@ -305,7 +305,7 @@ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetResourceDir(cons * {@link ABILITY_RUNTIME_ERROR_CODE_NO_ERROR} if the operation is successful. * {@link ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID} if the versionCode is null. * {@link ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST} if the application context does not exist. - * {@link ABILITY_RUNTIME_ERROR_CODE_APP_INFO_NOT_EXIST} if the application info does not exist. + * {@link ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED} if the application info does not exist. * @since 21 */ AbilityRuntime_ErrorCode OH_AbilityRuntime_ApplicationContextGetVersionCode(int64_t* versionCode); -- Gitee