From 30e9416582f8bd817af5210f30b1e9e29f3da684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 9 Jan 2026 10:02:23 +0800 Subject: [PATCH 1/4] add createModuleOrPluginContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../ability_runtime/context/context_impl.cpp | 15 +++++++++++++++ .../appkit/ability_runtime/context/context_impl.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index 32097377b4..9bf564a688 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -1986,5 +1986,20 @@ std::shared_ptr ContextImpl::CreateTargetPluginContext(const std::strin return WrapContext(pluginBundleName, moduleName, inputContext, pluginBundleInfo, hostBundName); } + +std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, const std::string &moduleName) +{ + if (bundleName .empty() || moduleName.empty()) { + TAG_LOGE(AAFwkTag::APPKIT, "input params is null"); + return nullptr; + } + + auto appContext = CreateModuleContext(bundleName, moduleName, this); + if (appContext == nullptr) { + appContext = CreatePluginContext(bundleName, moduleName, this); + } + + return appContext; +} } // namespace AbilityRuntime } // namespace OHOS diff --git a/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h b/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h index 19d85d96c0..947f91e4ad 100644 --- a/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h @@ -228,6 +228,8 @@ public: std::string GetBundleNameWithContext(std::shared_ptr inputContext = nullptr) const; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, const std::string &moduleName); + /** * @brief Get file area * From 7b461ac464aa1f10a36bc5cf2124c3568717368c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 9 Jan 2026 11:48:53 +0800 Subject: [PATCH 2/4] update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../ability_runtime/context/context_impl.cpp | 5 +- .../context_impl_second_test.cpp | 76 +++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index 9bf564a688..8729127ad1 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -1994,9 +1994,10 @@ std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::str return nullptr; } - auto appContext = CreateModuleContext(bundleName, moduleName, this); + std::shared_ptr currentContext = shared_from_this(); + std::shared_ptr appContext = CreateModuleContext(bundleName, moduleName, currentContext); if (appContext == nullptr) { - appContext = CreatePluginContext(bundleName, moduleName, this); + appContext = CreatePluginContext(bundleName, moduleName, currentContext); } return appContext; diff --git a/test/unittest/frameworks_kits_appkit_native_test/context_impl_second_test.cpp b/test/unittest/frameworks_kits_appkit_native_test/context_impl_second_test.cpp index eb2fc9c41f..d33670dfba 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/context_impl_second_test.cpp +++ b/test/unittest/frameworks_kits_appkit_native_test/context_impl_second_test.cpp @@ -576,5 +576,81 @@ HWTEST_F(ContextImplSecondTest, AppExecFwk_AppContext_CreatePluginContext_002, F GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreatePluginContext_002 end"; } + +/** + * @tc.number: AppExecFwk_AppContext_CreateModuleOrPluginContext_001 + * @tc.name: CreateModuleOrPluginContext + * @tc.desc: Test CreateModuleOrPluginContext. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ContextImplSecondTest, AppExecFwk_AppContext_CreateModuleOrPluginContext_001, Function | MediumTest | Level1) +{ + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_001 start"; + auto contextImpl = std::make_shared(); + std::string bundleName = "com.example.bundleName"; + std::string moduleName = "moduleName"; + + auto context = contextImpl->CreateModuleOrPluginContext(bundleName, moduleName); + EXPECT_EQ(context, nullptr); + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_001 end"; +} + +/** + * @tc.number: AppExecFwk_AppContext_CreateModuleOrPluginContext_002 + * @tc.name: CreateModuleOrPluginContext + * @tc.desc: Test CreateModuleOrPluginContext. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ContextImplSecondTest, AppExecFwk_AppContext_CreateModuleOrPluginContext_002, Function | MediumTest | Level1) +{ + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_002 start"; + auto contextImpl = std::make_shared(); + std::string bundleName = ""; + std::string moduleName = "moduleName"; + + auto context = contextImpl->CreateModuleOrPluginContext(bundleName, moduleName); + EXPECT_EQ(context, nullptr); + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_002 end"; +} + +/** + * @tc.number: AppExecFwk_AppContext_CreateModuleOrPluginContext_003 + * @tc.name: CreateModuleOrPluginContext + * @tc.desc: Test CreateModuleOrPluginContext. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ContextImplSecondTest, AppExecFwk_AppContext_CreateModuleOrPluginContext_003, Function | MediumTest | Level1) +{ + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_003 start"; + auto contextImpl = std::make_shared(); + std::string bundleName = "com.example.hostBundleName"; + std::string moduleName = ""; + + auto context = contextImpl->CreateModuleOrPluginContext(bundleName, moduleName); + EXPECT_EQ(context, nullptr); + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_003 end"; +} + +/** + * @tc.number: AppExecFwk_AppContext_CreateModuleOrPluginContext_004 + * @tc.name: CreateModuleOrPluginContext + * @tc.desc: Test CreateModuleOrPluginContext. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(ContextImplSecondTest, AppExecFwk_AppContext_CreateModuleOrPluginContext_004, Function | MediumTest | Level1) +{ + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_004 start"; + auto contextImpl = std::make_shared(); + std::string bundleName = ""; + std::string moduleName = ""; + + auto context = contextImpl->CreateModuleOrPluginContext(bundleName, moduleName); + EXPECT_EQ(context, nullptr); + GTEST_LOG_(INFO) << "AppExecFwk_AppContext_CreateModuleOrPluginContext_004 end"; +} } // namespace AppExecFwk } From 922cc1e417551b460be4f0e6cc1418e4e791a63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Fri, 9 Jan 2026 14:17:14 +0800 Subject: [PATCH 3/4] format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../native/appkit/ability_runtime/context/context_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index 8729127ad1..4c8faa2f54 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -1987,7 +1987,8 @@ std::shared_ptr ContextImpl::CreateTargetPluginContext(const std::strin return WrapContext(pluginBundleName, moduleName, inputContext, pluginBundleInfo, hostBundName); } -std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, const std::string &moduleName) +std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) { if (bundleName .empty() || moduleName.empty()) { TAG_LOGE(AAFwkTag::APPKIT, "input params is null"); From 16b10473492b6b2e01c52a28e79729cc2238a4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Tue, 13 Jan 2026 15:00:06 +0800 Subject: [PATCH 4/4] update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- .../ability/ability_runtime/ability_context_impl.cpp | 6 ++++++ .../context/ability_stage_context.cpp | 11 +++++++++++ .../ability_runtime/context/application_context.cpp | 6 ++++++ .../appkit/ability_runtime/context/context_impl.cpp | 7 +++++-- .../ability/ability_runtime/ability_context_impl.h | 2 ++ .../ability_runtime/context/ability_stage_context.h | 2 ++ .../ability_runtime/context/application_context.h | 2 ++ .../native/appkit/ability_runtime/context/context.h | 12 ++++++++++++ .../appkit/ability_runtime/context/context_impl.h | 3 ++- .../application_context_test/mock_context_impl.cpp | 6 ++++++ .../application_context_test/mock_context_impl.h | 3 +++ .../ability_context_test.cpp | 6 ++++++ .../mock_context.cpp | 6 ++++++ .../mock_context.h | 3 +++ .../mock_ability_runtime_context.cpp | 6 ++++++ .../mock_ability_runtime_context.h | 2 ++ 16 files changed, 80 insertions(+), 3 deletions(-) diff --git a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp index f5b277214c..dd1d0d6484 100644 --- a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp +++ b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp @@ -1366,6 +1366,12 @@ std::shared_ptr AbilityContextImpl::CreateAreaModeContext(int areaMode) return stageContext_ ? stageContext_->CreateAreaModeContext(areaMode) : nullptr; } +std::shared_ptr AbilityContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + return stageContext_ ? stageContext_->CreateModuleOrPluginContext(bundleName, moduleName) : nullptr; +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr AbilityContextImpl::CreateDisplayContext(uint64_t displayId) { diff --git a/frameworks/native/appkit/ability_runtime/context/ability_stage_context.cpp b/frameworks/native/appkit/ability_runtime/context/ability_stage_context.cpp index df8b934af7..ef3af68d68 100755 --- a/frameworks/native/appkit/ability_runtime/context/ability_stage_context.cpp +++ b/frameworks/native/appkit/ability_runtime/context/ability_stage_context.cpp @@ -464,6 +464,17 @@ std::shared_ptr AbilityStageContext::CreateAreaModeContext(int areaMode return contextImpl_->CreateAreaModeContext(areaMode); } +std::shared_ptr AbilityStageContext::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + if (contextImpl_ == nullptr) { + TAG_LOGE(AAFwkTag::APPKIT, "invalid contextImpl"); + return nullptr; + } + + return contextImpl_->CreateModuleOrPluginContext(bundleName, moduleName); +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr AbilityStageContext::CreateDisplayContext(uint64_t displayId) { diff --git a/frameworks/native/appkit/ability_runtime/context/application_context.cpp b/frameworks/native/appkit/ability_runtime/context/application_context.cpp index e72135c4e2..bf9d4d93b5 100644 --- a/frameworks/native/appkit/ability_runtime/context/application_context.cpp +++ b/frameworks/native/appkit/ability_runtime/context/application_context.cpp @@ -1247,6 +1247,12 @@ std::shared_ptr ApplicationContext::CreateAreaModeContext(int areaMode) return contextImpl_ ? contextImpl_->CreateAreaModeContext(areaMode) : nullptr; } +std::shared_ptr ApplicationContext::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + return contextImpl_ ? contextImpl_->CreateModuleOrPluginContext(bundleName, moduleName) : nullptr; +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr ApplicationContext::CreateDisplayContext(uint64_t displayId) { diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index 4c8faa2f54..68a982125b 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -1990,7 +1990,7 @@ std::shared_ptr ContextImpl::CreateTargetPluginContext(const std::strin std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, const std::string &moduleName) { - if (bundleName .empty() || moduleName.empty()) { + if (bundleName.empty() || moduleName.empty()) { TAG_LOGE(AAFwkTag::APPKIT, "input params is null"); return nullptr; } @@ -1998,7 +1998,10 @@ std::shared_ptr ContextImpl::CreateModuleOrPluginContext(const std::str std::shared_ptr currentContext = shared_from_this(); std::shared_ptr appContext = CreateModuleContext(bundleName, moduleName, currentContext); if (appContext == nullptr) { - appContext = CreatePluginContext(bundleName, moduleName, currentContext); + auto appInfo = GetApplicationInfo(); + if (appInfo && appInfo->hasPlugin) { + appContext = CreatePluginContext(bundleName, moduleName, currentContext); + } } return appContext; diff --git a/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h b/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h index 1c12cd25ec..0f31410690 100644 --- a/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h +++ b/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h @@ -74,6 +74,8 @@ public: int32_t CreateSystemHspModuleResourceManager(const std::string &bundleName, const std::string &moduleName, std::shared_ptr &resourceManager) override; std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif diff --git a/interfaces/kits/native/appkit/ability_runtime/context/ability_stage_context.h b/interfaces/kits/native/appkit/ability_runtime/context/ability_stage_context.h index a2da1c780b..cde2e6c460 100755 --- a/interfaces/kits/native/appkit/ability_runtime/context/ability_stage_context.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/ability_stage_context.h @@ -53,6 +53,8 @@ public: int32_t CreateSystemHspModuleResourceManager(const std::string &bundleName, const std::string &moduleName, std::shared_ptr &resourceManager) override; std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif diff --git a/interfaces/kits/native/appkit/ability_runtime/context/application_context.h b/interfaces/kits/native/appkit/ability_runtime/context/application_context.h index 9725522c3b..7dfc1b1a71 100644 --- a/interfaces/kits/native/appkit/ability_runtime/context/application_context.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/application_context.h @@ -101,6 +101,8 @@ public: int32_t CreateSystemHspModuleResourceManager(const std::string &bundleName, const std::string &moduleName, std::shared_ptr &resourceManager) override; std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif diff --git a/interfaces/kits/native/appkit/ability_runtime/context/context.h b/interfaces/kits/native/appkit/ability_runtime/context/context.h index 69eca77269..b91e33c4f4 100644 --- a/interfaces/kits/native/appkit/ability_runtime/context/context.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/context.h @@ -304,6 +304,18 @@ public: */ virtual std::shared_ptr CreateAreaModeContext(int areaMode) = 0; + /** + * @brief Creates a module or plugin context with the given bundleName and moduleName. + * + * @param bundleName Indicates the app name of the application. + + * @param moduleName Indicates the module name of the hap. + * + * @return Returns a module or plugin context created for the specified hap and app. + */ + virtual std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) = 0; + virtual ConfigUpdateReason GetConfigUpdateReason() { return ConfigUpdateReason::CONFIG_UPDATE_REASON_DEFAULT; diff --git a/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h b/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h index 947f91e4ad..41ce33a400 100644 --- a/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h @@ -228,7 +228,8 @@ public: std::string GetBundleNameWithContext(std::shared_ptr inputContext = nullptr) const; - std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, const std::string &moduleName); + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; /** * @brief Get file area diff --git a/test/unittest/application_context_test/mock_context_impl.cpp b/test/unittest/application_context_test/mock_context_impl.cpp index 0947acc994..d60d6c5e87 100644 --- a/test/unittest/application_context_test/mock_context_impl.cpp +++ b/test/unittest/application_context_test/mock_context_impl.cpp @@ -198,6 +198,12 @@ std::shared_ptr MockContextImpl::CreateAreaModeContext(int areaMode) return nullptr; } +std::shared_ptr MockContextImpl::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + return nullptr; +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr MockContextImpl::CreateDisplayContext(uint64_t displayId) { diff --git a/test/unittest/application_context_test/mock_context_impl.h b/test/unittest/application_context_test/mock_context_impl.h index ceb8b406b3..d9cdcb28f7 100644 --- a/test/unittest/application_context_test/mock_context_impl.h +++ b/test/unittest/application_context_test/mock_context_impl.h @@ -96,6 +96,9 @@ public: std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; + #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp index 9fcb7a385f..66b6f72427 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp @@ -289,6 +289,12 @@ public: { return nullptr; } + + virtual std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) + { + return nullptr; + } virtual std::shared_ptr CreateDisplayContext(uint64_t displayId) { return nullptr; diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.cpp index 056b9b351f..e89a3ed7a6 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.cpp @@ -212,6 +212,12 @@ std::shared_ptr MockContext::CreateAreaModeContext(int areaMode) return nullptr; } +std::shared_ptr MockContext::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + return nullptr; +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr MockContext::CreateDisplayContext(uint64_t displayId) { diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.h b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.h index 2d7357b9d0..f0e69a45f1 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.h +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_context.h @@ -113,6 +113,9 @@ public: std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; + #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif diff --git a/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.cpp b/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.cpp index 0fdfc69b06..ea1ad3e363 100644 --- a/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.cpp @@ -198,6 +198,12 @@ std::shared_ptr MockAbilityRuntimeContext::CreateAreaModeContext(int ar return {}; } +std::shared_ptr MockAbilityRuntimeContext::CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) +{ + return {}; +} + #ifdef SUPPORT_GRAPHICS std::shared_ptr MockAbilityRuntimeContext::CreateDisplayContext(uint64_t displayId) { diff --git a/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.h b/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.h index 52dc091ea5..229afaba06 100644 --- a/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.h +++ b/test/unittest/frameworks_kits_ability_native_test/mock_ability_runtime_context.h @@ -68,6 +68,8 @@ public: int32_t GetSystemDatabaseDir(const std::string &groupId, bool checkExist, std::string &databaseDir) override; int32_t GetSystemPreferencesDir(const std::string &groupId, bool checkExist, std::string &preferencesDir) override; std::shared_ptr CreateAreaModeContext(int areaMode) override; + std::shared_ptr CreateModuleOrPluginContext(const std::string &bundleName, + const std::string &moduleName) override; #ifdef SUPPORT_GRAPHICS std::shared_ptr CreateDisplayContext(uint64_t displayId) override; #endif