diff --git a/frameworks/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp b/frameworks/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp index 94c8a8e6dde48e88e30a7a71b00a403e3e690acf..e2c139fe30cd61b6dee57179a0d55250f865ad96 100644 --- a/frameworks/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp +++ b/frameworks/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp @@ -900,19 +900,6 @@ ErrCode BundleMgrHelper::QueryExtensionAbilityInfosOnlyWithTypeName(const std::s return bundleMgr->QueryExtensionAbilityInfosOnlyWithTypeName(extensionTypeName, flag, userId, extensionInfos); } -sptr BundleMgrHelper::GetDefaultAppProxy() -{ - TAG_LOGD(AAFwkTag::BUNDLEMGRHELPER, "called"); - auto bundleMgr = Connect(); - if (bundleMgr == nullptr) { - TAG_LOGE(AAFwkTag::BUNDLEMGRHELPER, "null bundleMgr"); - return nullptr; - } - - HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - return bundleMgr->GetDefaultAppProxy(); -} - ErrCode BundleMgrHelper::GetJsonProfile(ProfileType profileType, const std::string &bundleName, const std::string &moduleName, std::string &profile, int32_t userId) { diff --git a/interfaces/kits/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.h b/interfaces/kits/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.h index 3862786ed6c4f836224d8800ce8b9c26fbaa2b73..1181ca97211a143d2e75ab6deb756a35ab82f449 100644 --- a/interfaces/kits/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.h +++ b/interfaces/kits/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.h @@ -101,7 +101,6 @@ public: ErrCode GetUidByBundleName(const std::string &bundleName, int32_t userId, int32_t appCloneIndex); ErrCode QueryExtensionAbilityInfosOnlyWithTypeName(const std::string &extensionTypeName, const uint32_t flag, const int32_t userId, std::vector &extensionInfos); - sptr GetDefaultAppProxy(); ErrCode GetLaunchWantForBundle(const std::string &bundleName, Want &want, int32_t userId); ErrCode QueryCloneAbilityInfo(const ElementName &element, int32_t flags, int32_t appCloneIndex, AbilityInfo &abilityInfo, int32_t userId); diff --git a/services/abilitymgr/include/implicit_start_processor.h b/services/abilitymgr/include/implicit_start_processor.h index fe0f546095f51dee0365d89446a3f939fb2a73fe..6a0407526d8ab147e3881a6d863e4816ee7b4b45 100644 --- a/services/abilitymgr/include/implicit_start_processor.h +++ b/services/abilitymgr/include/implicit_start_processor.h @@ -106,7 +106,6 @@ private: bool FilterAbilityList(const Want &want, std::vector &abilityInfos, std::vector extensionInfos, int32_t userId); - sptr GetDefaultAppProxy(); void GetEcologicalCallerInfo(const Want &want, ErmsCallerInfo &callerInfo, int32_t userId); diff --git a/services/abilitymgr/src/implicit_start_processor.cpp b/services/abilitymgr/src/implicit_start_processor.cpp index 9ad8163c34b5700d7a9b8c9f2e96ee6946053d3b..4fad9f6dd188830d8c0182860544390f3b38b0cb 100644 --- a/services/abilitymgr/src/implicit_start_processor.cpp +++ b/services/abilitymgr/src/implicit_start_processor.cpp @@ -17,6 +17,7 @@ #include "ability_manager_service.h" #include "ability_util.h" #include "app_utils.h" +#include "default_app_client.h" #include "dialog_session_manager.h" #include "ecological_rule/ability_ecological_rule_mgr_service.h" #include "global_constant.h" @@ -823,21 +824,6 @@ std::shared_ptr ImplicitStartProcessor::GetBundleMa return iBundleManagerHelper_; } -sptr ImplicitStartProcessor::GetDefaultAppProxy() -{ - auto bundleMgrHelper = GetBundleManagerHelper(); - if (bundleMgrHelper == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null bundleMgrHelper"); - return nullptr; - } - auto defaultAppProxy = bundleMgrHelper->GetDefaultAppProxy(); - if (defaultAppProxy == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null defaultAppProxy"); - return nullptr; - } - return defaultAppProxy; -} - bool ImplicitStartProcessor::FilterAbilityList(const Want &want, std::vector &abilityInfos, std::vector extensionInfos, int32_t userId) { @@ -973,12 +959,10 @@ void ImplicitStartProcessor::AddAbilityInfoToDialogInfos(const AddInfoParam &par bool ImplicitStartProcessor::IsExistDefaultApp(int32_t userId, const std::string &typeName) { - auto defaultMgr = GetDefaultAppProxy(); - CHECK_POINTER_AND_RETURN_LOG(defaultMgr, false, "defaultMgr null"); AppExecFwk::BundleInfo bundleInfo; TAG_LOGD(AAFwkTag::ABILITYMGR, "userId: %{public}d, typeName: %{public}s", userId, typeName.c_str()); - ErrCode ret = - IN_PROCESS_CALL(defaultMgr->GetDefaultApplication(userId, typeName, bundleInfo)); + ErrCode ret = IN_PROCESS_CALL( + AppExecFwk::DefaultAppClient::GetInstance().GetDefaultApplication(userId, typeName, bundleInfo)); if (ret != ERR_OK) { return false; } diff --git a/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp b/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp index a6731b31a3925d34cb6bb0a3527a3e698c8d3eee..c3ab84d991d729f38406b7715ab57003d535309a 100755 --- a/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp +++ b/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp @@ -134,7 +134,6 @@ void BundleMgrHelperFuzztest2(bool boolParam, std::string &stringParam, int32_t bmHelper->QueryAppGalleryBundleName(stringParam); bmHelper->GetUidByBundleName(stringParam, int32Param, int32Param); bmHelper->QueryExtensionAbilityInfosOnlyWithTypeName(stringParam, int32Param, int32Param, extensionInfos); - bmHelper->GetDefaultAppProxy(); bmHelper->GetJsonProfile(static_cast(int32Param), stringParam, stringParam, stringParam, int32Param); bmHelper->GetLaunchWantForBundle(stringParam, want, int32Param); ElementName element; diff --git a/test/unittest/ability_permission_util_second_test/mock/src/mock_bundle_mgr_helper.cpp b/test/unittest/ability_permission_util_second_test/mock/src/mock_bundle_mgr_helper.cpp index b49f03f696fb1b8240fe062f8cbccfac97a4c42c..8f809aa3b7280eed671aebe5bc1df73678140434 100755 --- a/test/unittest/ability_permission_util_second_test/mock/src/mock_bundle_mgr_helper.cpp +++ b/test/unittest/ability_permission_util_second_test/mock/src/mock_bundle_mgr_helper.cpp @@ -307,11 +307,6 @@ ErrCode BundleMgrHelper::QueryExtensionAbilityInfosOnlyWithTypeName(const std::s return ERR_OK; } -sptr BundleMgrHelper::GetDefaultAppProxy() -{ - return nullptr; -} - ErrCode BundleMgrHelper::GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId) { return ERR_OK; diff --git a/test/unittest/app_mgr_service_fourth_test/mock/include/mock_bundle_mgr_helper.h b/test/unittest/app_mgr_service_fourth_test/mock/include/mock_bundle_mgr_helper.h index 68693fbcd7d6e32a11ef338cd87f39219bfe2ae3..ff966aa338987083d4d4a1847b431702c6d6f41c 100755 --- a/test/unittest/app_mgr_service_fourth_test/mock/include/mock_bundle_mgr_helper.h +++ b/test/unittest/app_mgr_service_fourth_test/mock/include/mock_bundle_mgr_helper.h @@ -95,7 +95,6 @@ public: ErrCode GetUidByBundleName(const std::string& bundleName, int32_t userId, int32_t appCloneIndex); ErrCode QueryExtensionAbilityInfosOnlyWithTypeName(const std::string& extensionTypeName, const uint32_t flag, const int32_t userId, std::vector& extensionInfos); - sptr GetDefaultAppProxy(); ErrCode GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId); ErrCode QueryCloneAbilityInfo( const ElementName& element, int32_t flags, int32_t appCloneIndex, AbilityInfo& abilityInfo, int32_t userId); diff --git a/test/unittest/app_mgr_service_inner_eighth_test/mock/src/mock_bundle_mgr_helper.cpp b/test/unittest/app_mgr_service_inner_eighth_test/mock/src/mock_bundle_mgr_helper.cpp index 817574298de80de1e658e041752c21587e2c3061..62337df0ce060d3af0e2cbd76565637b8b34cf9d 100755 --- a/test/unittest/app_mgr_service_inner_eighth_test/mock/src/mock_bundle_mgr_helper.cpp +++ b/test/unittest/app_mgr_service_inner_eighth_test/mock/src/mock_bundle_mgr_helper.cpp @@ -305,11 +305,6 @@ ErrCode BundleMgrHelper::QueryExtensionAbilityInfosOnlyWithTypeName(const std::s return ERR_OK; } -sptr BundleMgrHelper::GetDefaultAppProxy() -{ - return nullptr; -} - ErrCode BundleMgrHelper::GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId) { return ERR_OK; diff --git a/test/unittest/app_mgr_service_inner_ninth_test/mock/src/mock_bundle_mgr_helper.cpp b/test/unittest/app_mgr_service_inner_ninth_test/mock/src/mock_bundle_mgr_helper.cpp index 817574298de80de1e658e041752c21587e2c3061..62337df0ce060d3af0e2cbd76565637b8b34cf9d 100644 --- a/test/unittest/app_mgr_service_inner_ninth_test/mock/src/mock_bundle_mgr_helper.cpp +++ b/test/unittest/app_mgr_service_inner_ninth_test/mock/src/mock_bundle_mgr_helper.cpp @@ -305,11 +305,6 @@ ErrCode BundleMgrHelper::QueryExtensionAbilityInfosOnlyWithTypeName(const std::s return ERR_OK; } -sptr BundleMgrHelper::GetDefaultAppProxy() -{ - return nullptr; -} - ErrCode BundleMgrHelper::GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId) { return ERR_OK; diff --git a/test/unittest/app_mgr_service_inner_seventh_test/mock/src/mock_bundle_mgr_helper.cpp b/test/unittest/app_mgr_service_inner_seventh_test/mock/src/mock_bundle_mgr_helper.cpp index 88fbfdea14d87ce20d537b56ad6b06392a34dcc6..bf2507b34a5d9c7ac326892de3da523af623aa72 100755 --- a/test/unittest/app_mgr_service_inner_seventh_test/mock/src/mock_bundle_mgr_helper.cpp +++ b/test/unittest/app_mgr_service_inner_seventh_test/mock/src/mock_bundle_mgr_helper.cpp @@ -303,11 +303,6 @@ ErrCode BundleMgrHelper::QueryExtensionAbilityInfosOnlyWithTypeName(const std::s return ERR_OK; } -sptr BundleMgrHelper::GetDefaultAppProxy() -{ - return nullptr; -} - ErrCode BundleMgrHelper::GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId) { return ERR_OK; diff --git a/test/unittest/app_mgr_service_inner_sixth_test/mock/include/mock_bundle_mgr_helper.h b/test/unittest/app_mgr_service_inner_sixth_test/mock/include/mock_bundle_mgr_helper.h index e6862802f30c3093f9b542b163cf9676a2902c7e..46930a2f25184eff97e76df47c24ea00933c2924 100755 --- a/test/unittest/app_mgr_service_inner_sixth_test/mock/include/mock_bundle_mgr_helper.h +++ b/test/unittest/app_mgr_service_inner_sixth_test/mock/include/mock_bundle_mgr_helper.h @@ -97,7 +97,6 @@ public: ErrCode GetUidByBundleName(const std::string& bundleName, int32_t userId, int32_t appCloneIndex); ErrCode QueryExtensionAbilityInfosOnlyWithTypeName(const std::string& extensionTypeName, const uint32_t flag, const int32_t userId, std::vector& extensionInfos); - sptr GetDefaultAppProxy(); ErrCode GetLaunchWantForBundle(const std::string& bundleName, Want& want, int32_t userId); ErrCode QueryCloneAbilityInfo( const ElementName& element, int32_t flags, int32_t appCloneIndex, AbilityInfo& abilityInfo, int32_t userId); diff --git a/test/unittest/bundle_mgr_helper_test/bundle_mgr_helper_test.cpp b/test/unittest/bundle_mgr_helper_test/bundle_mgr_helper_test.cpp index 7624899366b7e2f1f1c5bc89b700a0e696273706..a674dc5872b37077df8bc954c1f774307d4587c1 100644 --- a/test/unittest/bundle_mgr_helper_test/bundle_mgr_helper_test.cpp +++ b/test/unittest/bundle_mgr_helper_test/bundle_mgr_helper_test.cpp @@ -498,17 +498,6 @@ HWTEST_F(BundleMgrHelperTest, BundleMgrHelperTest_QueryAbilityInfo_003, TestSize EXPECT_EQ(ret, false); } -/** - * @tc.name: BundleMgrHelperTest_GetDefaultAppProxy_001 - * @tc.desc: GetDefaultAppProxy - * @tc.type: FUNC - */ -HWTEST_F(BundleMgrHelperTest, BundleMgrHelperTest_GetDefaultAppProxy_001, TestSize.Level1) -{ - auto ret = bundleMgrHelper->GetDefaultAppProxy(); - EXPECT_NE(ret, nullptr); -} - #ifdef WITH_DLP /** * @tc.name: BundleMgrHelperTest_InstallSandboxApp_001 diff --git a/test/unittest/implicit_start_processor_test/implicit_start_processor_test.cpp b/test/unittest/implicit_start_processor_test/implicit_start_processor_test.cpp index 6cdb8fee6884fd94beb65995404fda6d9c9f5d42..a240b3d1bc390a0a4132f2d6aece86be9b22c717 100644 --- a/test/unittest/implicit_start_processor_test/implicit_start_processor_test.cpp +++ b/test/unittest/implicit_start_processor_test/implicit_start_processor_test.cpp @@ -990,21 +990,6 @@ HWTEST_F(ImplicitStartProcessorTest, OnlyKeepReserveApp_005, TestSize.Level1) } } -/* - * Feature: ImplicitStartProcessor - * Function: GetDefaultAppProxy - * SubFunction: NA - * FunctionPoints:ImplicitStartProcessor GetDefaultAppProxy - * EnvConditions: NA - * CaseDescription: Verify GetDefaultAppProxy etc. - */ -HWTEST_F(ImplicitStartProcessorTest, GetDefaultAppProxy_001, TestSize.Level1) -{ - auto processor = std::make_shared(); - auto result = processor->GetDefaultAppProxy(); - EXPECT_EQ(result, nullptr); -} - /* * Feature: ImplicitStartProcessor * Function: FilterAbilityList