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..5cf662b863fc51508cbdd8e1fded867b0225a27e 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -466,19 +466,6 @@ bool BundleMgrHelper::GetGroupDir(const std::string &dataGroupId, std::string &d return bundleMgr->GetGroupDir(dataGroupId, dir); } -sptr BundleMgrHelper::GetOverlayManagerProxy() -{ - 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->GetOverlayManagerProxy(); -} - bool BundleMgrHelper::QueryAbilityInfo(const Want &want, AbilityInfo &abilityInfo) { TAG_LOGD(AAFwkTag::BUNDLEMGRHELPER, "called"); diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index cab45fda83e5708c1886400a060eb4b40b7a5b53..eba6aa4aebfb3d1f216210b38d64c1d3b7031b65 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -1435,42 +1435,14 @@ Global::Resource::DeviceType ContextImpl::GetDeviceType() const return deviceType_; } -ErrCode ContextImpl::GetOverlayMgrProxy() -{ - HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - int errCode = GetBundleManager(); - if (errCode != ERR_OK) { - TAG_LOGE(AAFwkTag::APPKIT, "failed, errCode: %{public}d", errCode); - return errCode; - } - - std::lock_guard lock(overlayMgrProxyMutex_); - if (overlayMgrProxy_ != nullptr) { - return ERR_OK; - } - - overlayMgrProxy_ = bundleMgr_->GetOverlayManagerProxy(); - if (overlayMgrProxy_ == nullptr) { - TAG_LOGE(AAFwkTag::APPKIT, "null overlayMgrProxy"); - return ERR_NULL_OBJECT; - } - - TAG_LOGD(AAFwkTag::APPKIT, "Success."); - return ERR_OK; -} - int ContextImpl::GetOverlayModuleInfos(const std::string &bundleName, const std::string &moduleName, std::vector &overlayModuleInfos) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - int errCode = GetOverlayMgrProxy(); - if (errCode != ERR_OK) { - TAG_LOGE(AAFwkTag::APPKIT, "failed, errCode: %{public}d", errCode); - return errCode; - } { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, "overlayMgrProxy_->GetTargetOverlayModuleInfo"); - auto ret = overlayMgrProxy_->GetTargetOverlayModuleInfo(moduleName, overlayModuleInfos); + auto ret = + AppExecFwk::OverlayManagerClient::GetInstance().GetTargetOverlayModuleInfo(moduleName, overlayModuleInfos); if (ret != ERR_OK) { TAG_LOGD(AAFwkTag::APPKIT, "GetOverlayModuleInfo form bms failed"); return ret; @@ -1634,10 +1606,6 @@ void ContextImpl::ShallowCopySelf(std::shared_ptr &contextImpl) std::lock_guard lock(bundleManagerMutex_); contextImpl->bundleMgr_ = bundleMgr_; } - { - std::lock_guard lock(overlayMgrProxyMutex_); - contextImpl->overlayMgrProxy_ = overlayMgrProxy_; - } contextImpl->resetFlag_ = resetFlag_; contextImpl->processName_ = processName_; } diff --git a/frameworks/native/appkit/app/main_thread.cpp b/frameworks/native/appkit/app/main_thread.cpp index 7b446e28799ebc360b221485c030e72e97c85706..c6deafe7047f47a71ff59aa48ffd26ee12269748 100644 --- a/frameworks/native/appkit/app/main_thread.cpp +++ b/frameworks/native/appkit/app/main_thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -3694,13 +3694,7 @@ int MainThread::GetOverlayModuleInfos(const std::string &bundleName, const std:: return ERR_INVALID_VALUE; } - auto overlayMgrProxy = bundleMgrHelper->GetOverlayManagerProxy(); - if (overlayMgrProxy == nullptr) { - TAG_LOGE(AAFwkTag::APPKIT, "null overlayMgrProxy"); - return ERR_INVALID_VALUE; - } - - auto ret = overlayMgrProxy->GetTargetOverlayModuleInfo(moduleName, overlayModuleInfos); + auto ret = OverlayManagerClient::GetInstance().GetTargetOverlayModuleInfo(moduleName, overlayModuleInfos); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::APPKIT, "failed"); return ret; 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..0760249732f0e6f456c32986d81398e56e785282 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -60,7 +60,6 @@ public: ErrCode GetDependentBundleInfo(const std::string &sharedBundleName, BundleInfo &sharedBundleInfo, GetDependentBundleInfoFlag flag = GetDependentBundleInfoFlag::GET_APP_CROSS_HSP_BUNDLE_INFO); bool GetGroupDir(const std::string &dataGroupId, std::string &dir); - sptr GetOverlayManagerProxy(); bool QueryAbilityInfo(const Want &want, AbilityInfo &abilityInfo); bool QueryAbilityInfo(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo); bool GetBundleInfos(int32_t flags, 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 5e82b637987ce000e210450b4170ec3d3f177291..04efb58a890f85f75264aaf2b2171ae6f5f82117 100644 --- a/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h +++ b/interfaces/kits/native/appkit/ability_runtime/context/context_impl.h @@ -19,6 +19,7 @@ #include "context.h" #include "bundle_mgr_interface.h" +#include "overlay_manager_client.h" namespace OHOS { namespace AppExecFwk { @@ -522,7 +523,6 @@ private: int32_t GetBundleInfo(const std::string &bundleName, AppExecFwk::BundleInfo &bundleInfo, bool ¤tBundle); void GetBundleInfo(const std::string &bundleName, AppExecFwk::BundleInfo &bundleInfo, std::shared_ptr inputContext = nullptr); - ErrCode GetOverlayMgrProxy(); void UnsubscribeToOverlayEvents(); void ShallowCopySelf(std::shared_ptr &contextImpl); bool UpdateDisplayConfiguration(std::shared_ptr &contextImpl, uint64_t displayId, @@ -546,8 +546,6 @@ private: std::mutex bundleManagerMutex_; std::shared_ptr bundleMgr_; - std::mutex overlayMgrProxyMutex_; - sptr overlayMgrProxy_ = nullptr; // True: need to get a new fms remote object, // False: no need to get a new fms remote object. diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index 9bc66b07c2fc058a1746443ac4414a907518663c..d38e2d4972d4c817fa4dd4b123886ce62749bc23 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -67,6 +67,7 @@ #include "kia_interceptor_interface.h" #include "kill_process_config.h" #include "killed_process_info.h" +#include "overlay_manager_client.h" #include "process_memory_state.h" #include "process_util.h" #include "record_query_result.h" diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index d0e90aca3f71158ffb4e2c2ce6c973b691d9af71..e8cc1b6440247d5312bc475a1d3ccb8974dacde7 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -3664,22 +3664,19 @@ void AppMgrServiceInner::SetOverlayInfo(const std::string &bundleName, TAG_LOGE(AAFwkTag::APPMGR, "bundleMgrHelper null"); return; } - auto overlayMgrProxy = bundleMgrHelper->GetOverlayManagerProxy(); - if (overlayMgrProxy != nullptr) { - std::vector overlayModuleInfo; - TAG_LOGD(AAFwkTag::APPMGR, "Check overlay app begin."); - HITRACE_METER_NAME(HITRACE_TAG_APP, "BMS->GetOverlayModuleInfoForTarget"); - auto targetRet = IN_PROCESS_CALL(overlayMgrProxy->GetOverlayModuleInfoForTarget( - bundleName, "", overlayModuleInfo, userId)); - if (targetRet == ERR_OK && overlayModuleInfo.size() != 0) { - TAG_LOGD(AAFwkTag::APPMGR, "Start an overlay app process."); - startMsg.flags = startMsg.flags | APP_OVERLAY_FLAG; - std::string overlayInfoPaths; - for (auto it : overlayModuleInfo) { - overlayInfoPaths += (it.hapPath + "|"); - } - startMsg.overlayInfo = overlayInfoPaths; - } + std::vector overlayModuleInfo; + TAG_LOGD(AAFwkTag::APPMGR, "Check overlay app begin."); + HITRACE_METER_NAME(HITRACE_TAG_APP, "BMS->GetOverlayModuleInfoForTarget"); + auto targetRet = IN_PROCESS_CALL(AppExecFwk::OverlayManagerClient::GetInstance().GetOverlayModuleInfoForTarget( + bundleName, "", overlayModuleInfo, userId)); + if (targetRet == ERR_OK && overlayModuleInfo.size() != 0) { + TAG_LOGD(AAFwkTag::APPMGR, "Start an overlay app process."); + startMsg.flags = startMsg.flags | APP_OVERLAY_FLAG; + std::string overlayInfoPaths; + for (auto it : overlayModuleInfo) { + overlayInfoPaths += (it.hapPath + "|"); + } + startMsg.overlayInfo = overlayInfoPaths; } } diff --git a/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp b/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp index a6731b31a3925d34cb6bb0a3527a3e698c8d3eee..738d1effdcc5f1c4168bdc9b6c871a175bfeda5d 100755 --- a/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp +++ b/test/fuzztest/bundlemgrhelper_fuzzer/bundlemgrhelper_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -93,7 +93,6 @@ void BundleMgrHelperFuzztest1(bool boolParam, std::string &stringParam, int32_t bmHelper->GetBundleInfoForSelf(int32Param, bundleInfo); bmHelper->GetDependentBundleInfo(stringParam, bundleInfo, static_cast(int32Param)); bmHelper->GetGroupDir(stringParam, stringParam); - bmHelper->GetOverlayManagerProxy(); bmHelper->QueryAbilityInfo(want, abilityInfo); bmHelper->QueryAbilityInfo(want, int32Param, int32Param, abilityInfo); std::vector bundleInfos; diff --git a/test/mock/common/include/mock_bundle_manager_proxy.h b/test/mock/common/include/mock_bundle_manager_proxy.h index 830968bdb9e8182d056a56894a1ff9e580b04db8..44dd69a1ab1ee8dbe255beba97d3ce1291682a8f 100644 --- a/test/mock/common/include/mock_bundle_manager_proxy.h +++ b/test/mock/common/include/mock_bundle_manager_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,7 +22,6 @@ #include "iremote_object.h" #include "iremote_stub.h" #include "module_info.h" -#include "mock_overlay_manager.h" namespace OHOS { constexpr int32_t BASE_USER_RANGE = 200000; @@ -55,13 +54,6 @@ public: MOCK_METHOD5(ImplicitQueryInfoByPriority, bool(const Want&, int32_t, int32_t, AppExecFwk::AbilityInfo&, AppExecFwk::ExtensionAbilityInfo&)); - sptr GetOverlayManagerProxy() - { - sptr overlayModuleProxy = - new (std::nothrow) AppExecFwk::OverlayManagerProxy(nullptr); - return overlayModuleProxy; - } - bool GetBundleInfo(const std::string &bundleName, const AppExecFwk::BundleFlag flag, AppExecFwk::BundleInfo &bundleInfo, int32_t userId) override { diff --git a/test/mock/common/include/mock_bundle_manager_service.h b/test/mock/common/include/mock_bundle_manager_service.h index 3250f6078bc939ddf6ed680b008235a74f5fe6c2..b52197a356225d04c212cd42e5af25710894bd51 100644 --- a/test/mock/common/include/mock_bundle_manager_service.h +++ b/test/mock/common/include/mock_bundle_manager_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,7 +22,6 @@ #include "iremote_object.h" #include "iremote_stub.h" #include "module_info.h" -#include "mock_overlay_manager.h" namespace OHOS { namespace { @@ -57,13 +56,6 @@ public: MOCK_METHOD5(ImplicitQueryInfoByPriority, bool(const Want&, int32_t, int32_t, AppExecFwk::AbilityInfo&, AppExecFwk::ExtensionAbilityInfo&)); - sptr GetOverlayManagerProxy() - { - sptr overlayModuleProxy = - new (std::nothrow) AppExecFwk::OverlayManagerProxy(nullptr); - return overlayModuleProxy; - } - bool GetBundleInfo(const std::string &bundleName, const AppExecFwk::BundleFlag flag, AppExecFwk::BundleInfo &bundleInfo, int32_t userId) override { diff --git a/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp b/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp index 40cf3503eacc7bc4e2d84b6bdafd91c892dca249..69554c0a7ca585fd381d3d5a1940c335cdcb5140 100644 --- a/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp +++ b/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,6 @@ #include #include "ability_info.h" #include "application_info.h" -#include "mock_overlay_manager.h" namespace OHOS { namespace AppExecFwk { @@ -67,12 +66,6 @@ bool BundleMgrProxy::GetHapModuleInfo(const AbilityInfo& abilityInfo, int32_t us return true; } -sptr BundleMgrProxy::GetOverlayManagerProxy() -{ - sptr overlayModuleProxy = new (std::nothrow) OverlayManagerProxy(nullptr); - return overlayModuleProxy; -} - int BundleMgrStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { GTEST_LOG_(INFO) << " BundleMgrStub::OnRemoteRequest"; @@ -137,11 +130,5 @@ bool BundleMgrService::GetHapModuleInfo(const AbilityInfo& abilityInfo, int32_t hapModuleInfo.name = abilityInfo.package; return true; } - -sptr BundleMgrService::GetOverlayManagerProxy() -{ - sptr overlayManagerProxy = new (std::nothrow) OverlayManagerProxy(nullptr); - return overlayManagerProxy; -} } // namespace AppExecFwk } // namespace OHOS diff --git a/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.h b/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.h index 5a5bbd01101e6c3a2b0fe3acadb5bf8f141b2caa..4b6207b85a8c8799553b2872e63f0f83e55b2a5c 100644 --- a/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.h +++ b/test/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -62,8 +62,6 @@ public: { return ERR_OK; } - - sptr GetOverlayManagerProxy() override; }; class BundleMgrStub : public IRemoteStub { @@ -99,7 +97,6 @@ public: { return ERR_OK; } - sptr GetOverlayManagerProxy() override; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp b/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp deleted file mode 100644 index bc5914a250b8402409d23264a63ba03217cae354..0000000000000000000000000000000000000000 --- a/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "mock_overlay_manager.h" - -#include "ability_info.h" -#include "application_info.h" - -namespace OHOS { -namespace AppExecFwk { -OverlayManagerProxy::OverlayManagerProxy(const sptr &object) : IRemoteProxy(object) -{} - -ErrCode OverlayManagerProxy::GetTargetOverlayModuleInfo(const std::string &targetModuleName, - std::vector &overlayModuleInfos, int32_t userId) -{ - return ERR_OK; -} - -int OverlayManagerHost::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) -{ - return 0; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.h b/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.h deleted file mode 100644 index 2f855928b8c760f5d475170ad6082a893057e431..0000000000000000000000000000000000000000 --- a/test/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H -#define MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H - -#include -#include "ability_info.h" -#include "application_info.h" -#include "want.h" -#include "iremote_proxy.h" -#include "iremote_stub.h" -#include "overlay_manager_interface.h" - -namespace OHOS { -namespace AppExecFwk { -class OverlayManagerProxy : public IRemoteProxy { -public: - explicit OverlayManagerProxy(const sptr &object); - virtual ~OverlayManagerProxy() - {} - - virtual ErrCode GetTargetOverlayModuleInfo(const std::string &targetModuleName, - std::vector &overlayModuleInfos, int32_t userId = Constants::UNSPECIFIED_USERID) override; -}; - -class OverlayManagerHost : public IRemoteStub { -public: - int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; -}; -} // namespace AppExecFwk -} // namespace OHOS - -#endif // MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H diff --git a/test/mock/services_appmgr_test/include/mock_bundle_manager.h b/test/mock/services_appmgr_test/include/mock_bundle_manager.h index 78c15388e177f92387845f22850b8b587e653bae..2b629d9c0c08cecb37d83e5ebf432d340d7cded5 100644 --- a/test/mock/services_appmgr_test/include/mock_bundle_manager.h +++ b/test/mock/services_appmgr_test/include/mock_bundle_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -76,8 +76,6 @@ public: { return ERR_OK; } - - sptr GetOverlayManagerProxy() override; }; class BundleMgrStub : public IRemoteStub { @@ -155,7 +153,6 @@ public: { return ERR_OK; } - sptr GetOverlayManagerProxy() override; private: std::vector bundleInfos_; sptr quickFixManager_ = nullptr; diff --git a/test/mock/services_appmgr_test/include/mock_overlay_manager.h b/test/mock/services_appmgr_test/include/mock_overlay_manager.h deleted file mode 100644 index 2f855928b8c760f5d475170ad6082a893057e431..0000000000000000000000000000000000000000 --- a/test/mock/services_appmgr_test/include/mock_overlay_manager.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H -#define MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H - -#include -#include "ability_info.h" -#include "application_info.h" -#include "want.h" -#include "iremote_proxy.h" -#include "iremote_stub.h" -#include "overlay_manager_interface.h" - -namespace OHOS { -namespace AppExecFwk { -class OverlayManagerProxy : public IRemoteProxy { -public: - explicit OverlayManagerProxy(const sptr &object); - virtual ~OverlayManagerProxy() - {} - - virtual ErrCode GetTargetOverlayModuleInfo(const std::string &targetModuleName, - std::vector &overlayModuleInfos, int32_t userId = Constants::UNSPECIFIED_USERID) override; -}; - -class OverlayManagerHost : public IRemoteStub { -public: - int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; -}; -} // namespace AppExecFwk -} // namespace OHOS - -#endif // MOCK_OHOS_ABILITY_RUNTIME_MOCK_OVERLAY_MANAGER_H diff --git a/test/mock/services_appmgr_test/src/mock_bundle_manager.cpp b/test/mock/services_appmgr_test/src/mock_bundle_manager.cpp index 63e480a21e4e4c6d292467e1c45a4de9a2f92edf..0b503c781f8caee754e041bed35a0ea4a2a3cdfe 100644 --- a/test/mock/services_appmgr_test/src/mock_bundle_manager.cpp +++ b/test/mock/services_appmgr_test/src/mock_bundle_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,6 @@ #include "ability_info.h" #include "application_info.h" #include "hilog_tag_wrapper.h" -#include "mock_overlay_manager.h" namespace { const int32_t HQF_VERSION_CODE = 1000; } @@ -123,12 +122,6 @@ std::string BundleMgrProxy::GetAppType(const std::string& bundleName) return "system"; } -sptr BundleMgrProxy::GetOverlayManagerProxy() -{ - sptr overlayModuleProxy = new (std::nothrow) OverlayManagerProxy(nullptr); - return overlayModuleProxy; -} - int BundleMgrStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { return 0; @@ -385,11 +378,5 @@ ErrCode BundleMgrService::GetBundleInfoForSelf(int32_t flags, BundleInfo &bundle } return ERR_OK; } - -sptr BundleMgrService::GetOverlayManagerProxy() -{ - sptr overlayManagerProxy = new (std::nothrow) OverlayManagerProxy(nullptr); - return overlayManagerProxy; -} } // namespace AppExecFwk } // namespace OHOS diff --git a/test/mock/services_appmgr_test/src/mock_overlay_manager.cpp b/test/mock/services_appmgr_test/src/mock_overlay_manager.cpp index c8198657d0abff553dc34e751f7bc5c0edbb8f9e..5b84dd237db1b20898ddaab1c8ce76492b9f3ea3 100644 --- a/test/mock/services_appmgr_test/src/mock_overlay_manager.cpp +++ b/test/mock/services_appmgr_test/src/mock_overlay_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mock_overlay_manager.h" #include #include "mock_bundle_manager.h" @@ -22,15 +21,6 @@ namespace OHOS { namespace AppExecFwk { -OverlayManagerProxy::OverlayManagerProxy(const sptr &object) : IRemoteProxy(object) -{} - -ErrCode OverlayManagerProxy::GetTargetOverlayModuleInfo(const std::string &targetModuleName, - std::vector &overlayModuleInfos, int32_t userId) -{ - return ERR_OK; -} - int OverlayManagerHost::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { return 0; diff --git a/test/moduletest/ability_test/BUILD.gn b/test/moduletest/ability_test/BUILD.gn index b4490926194952e358e5ce407f1018596267669a..ce43f39d9a77dbd51f550d6883c87dce19d9dcbd 100644 --- a/test/moduletest/ability_test/BUILD.gn +++ b/test/moduletest/ability_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -41,7 +41,6 @@ ohos_moduletest("ability_moduletest") { module_out_path = module_output_path sources = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_ability_manager_client.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_ability_manager_service.cpp", @@ -103,7 +102,6 @@ ohos_moduletest("ability_conetxt_test") { module_out_path = module_output_path sources = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_ability_manager_client.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_serviceability_manager_service.cpp", @@ -194,7 +192,6 @@ ohos_moduletest("data_ability_operation_moduletest") { module_out_path = module_output_path sources = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_ability_manager_client.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_test/AMS/mock_ability_manager_service.cpp", diff --git a/test/moduletest/quick_fix/quick_fix_manager_module_test/BUILD.gn b/test/moduletest/quick_fix/quick_fix_manager_module_test/BUILD.gn index a81da9d4457722c2f23ecdb8aec8780d8ce6bd2a..e160c611d997663be6bffceb419b58a9a8d29c25 100644 --- a/test/moduletest/quick_fix/quick_fix_manager_module_test/BUILD.gn +++ b/test/moduletest/quick_fix/quick_fix_manager_module_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -26,7 +26,6 @@ ohos_moduletest("quick_fix_manager_module_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/unittest/quick_fix/mock/src/mock_quick_fix_util.cpp", "quick_fix_manager_module_test.cpp", ] 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..f7bed0b8e93e5b69e768591ef4a7c701e1008d8e 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 @@ -154,12 +154,6 @@ bool BundleMgrHelper::GetGroupDir(const std::string& dataGroupId, std::string& d return false; } -sptr BundleMgrHelper::GetOverlayManagerProxy() -{ - sptr getOverlay_ = nullptr; - return getOverlay_; -} - bool BundleMgrHelper::QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo) { return false; diff --git a/test/unittest/ams_app_death_recipient_test/BUILD.gn b/test/unittest/ams_app_death_recipient_test/BUILD.gn index 61c2a129d0f3abd65b18faec13b4257692a71543..c5a08449df58977f6d0e6a69ff8945133815b552 100644 --- a/test/unittest/ams_app_death_recipient_test/BUILD.gn +++ b/test/unittest/ams_app_death_recipient_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -21,7 +21,6 @@ ohos_unittest("AppDeathRecipientTest") { cflags_cc = [] sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "ams_app_death_recipient_test.cpp", ] diff --git a/test/unittest/ams_app_life_cycle_test/BUILD.gn b/test/unittest/ams_app_life_cycle_test/BUILD.gn index 384f8fa973a056b5d8c05f65f3ae99b718bbd778..110ee95a04eb718a740cc69f90538739fc098e1b 100644 --- a/test/unittest/ams_app_life_cycle_test/BUILD.gn +++ b/test/unittest/ams_app_life_cycle_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -40,7 +40,6 @@ ohos_unittest("AmsAppLifeCycleTest") { "${ability_runtime_services_path}/appmgr/src/module_running_record.cpp", "${ability_runtime_services_path}/appmgr/src/remote_client_manager.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", ] sources += [ "ams_app_life_cycle_test.cpp" ] diff --git a/test/unittest/ams_app_running_record_test/BUILD.gn b/test/unittest/ams_app_running_record_test/BUILD.gn index f14a268f81d77deda98a0cc84ea883387857bb53..6562bb822da141012e35abeb074c5ae5e81351e8 100644 --- a/test/unittest/ams_app_running_record_test/BUILD.gn +++ b/test/unittest/ams_app_running_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -36,7 +36,6 @@ ohos_unittest("AmsAppRunningRecordTest") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "ams_app_running_record_test.cpp", ] diff --git a/test/unittest/ams_mgr_scheduler_second_test/BUILD.gn b/test/unittest/ams_mgr_scheduler_second_test/BUILD.gn index 8f5da579d8d151d007610bd906b496e15f7fce43..d85efcc4375b39488b72aceadd15a7c508595993 100644 --- a/test/unittest/ams_mgr_scheduler_second_test/BUILD.gn +++ b/test/unittest/ams_mgr_scheduler_second_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -41,7 +41,6 @@ ohos_unittest("ams_mgr_scheduler_second_test") { "${ability_runtime_services_path}/appmgr/src/ams_mgr_scheduler.cpp", "${ability_runtime_test_path}/mock/common/src/mock_native_token.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "mock/src/mock_ipc_skeleton.cpp", "mock/src/mock_my_flag.cpp", "mock/src/mock_permission_verification.cpp", diff --git a/test/unittest/ams_mgr_scheduler_test/BUILD.gn b/test/unittest/ams_mgr_scheduler_test/BUILD.gn index 81afb0159e35cd9366917b57aa019cf92e37a564..bb7898607543853bec220519ebaa0db27a9fe515 100644 --- a/test/unittest/ams_mgr_scheduler_test/BUILD.gn +++ b/test/unittest/ams_mgr_scheduler_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -38,7 +38,6 @@ ohos_unittest("ams_mgr_scheduler_test") { sources = [ "${ability_runtime_services_path}/appmgr/src/ams_mgr_scheduler.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "mock/src/mock_my_flag.cpp", "mock/src/mock_permission_verification.cpp", ] diff --git a/test/unittest/ams_recent_app_list_test/BUILD.gn b/test/unittest/ams_recent_app_list_test/BUILD.gn index 1c4b9e155f4f5665de8cc582a5ef62c9b652c935..adc5b82f538c24584c7ed212bf9e7d214586e954 100644 --- a/test/unittest/ams_recent_app_list_test/BUILD.gn +++ b/test/unittest/ams_recent_app_list_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -49,7 +49,6 @@ ohos_unittest("AmsRecentAppListTest") { "${ability_runtime_services_path}/appmgr/src/window_focus_changed_listener.cpp", "${ability_runtime_services_path}/appmgr/src/window_visibility_changed_listener.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", ] sources += [ "ams_recent_app_list_test.cpp" ] diff --git a/test/unittest/ams_service_load_ability_process_test/BUILD.gn b/test/unittest/ams_service_load_ability_process_test/BUILD.gn index 6e21ffaa9de439eb1642d9d677d4a8ca5a62aca1..6644d751d2498551e2c261e55252eeb377a47de0 100644 --- a/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -56,7 +56,6 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { "${ability_runtime_services_path}/appmgr/src/window_focus_changed_listener.cpp", "${ability_runtime_services_path}/appmgr/src/window_visibility_changed_listener.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", ] sources += [ "ams_service_load_ability_process_test.cpp" ] 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..4a11faf87aeb183e1e2de2d39fdef05056ab5f9c 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 @@ -55,7 +55,6 @@ public: ErrCode GetDependentBundleInfo(const std::string& sharedBundleName, BundleInfo& sharedBundleInfo, GetDependentBundleInfoFlag flag = GetDependentBundleInfoFlag::GET_APP_CROSS_HSP_BUNDLE_INFO); bool GetGroupDir(const std::string& dataGroupId, std::string& dir); - sptr GetOverlayManagerProxy(); bool QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo); bool QueryAbilityInfo(const Want& want, int32_t flags, int32_t userId, AbilityInfo& abilityInfo); bool GetBundleInfos( diff --git a/test/unittest/app_mgr_service_inner_eighth_test/mock/include/mock_my_status.h b/test/unittest/app_mgr_service_inner_eighth_test/mock/include/mock_my_status.h index 5436fc4dbf6298e3764c906f08f13655d3075f9b..6a5fba1ad0568a25743ee17a4df3b0f8e2406c5e 100755 --- a/test/unittest/app_mgr_service_inner_eighth_test/mock/include/mock_my_status.h +++ b/test/unittest/app_mgr_service_inner_eighth_test/mock/include/mock_my_status.h @@ -92,7 +92,6 @@ public: bool getApplicationInfo_ = false; AppExecFwk::ApplicationInfo applicationInfo_; int getOverlayCall_ = 0; - sptr getOverlay_ = nullptr; int getBaseSharedBundleInfos_ = 0; std::vector baseSharedBundleInfos_; bool queryDataGroupInfos_ = false; 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..48fc8df834fb8caea721ed5054f7bc08e7ac5452 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 @@ -148,12 +148,6 @@ bool BundleMgrHelper::GetGroupDir(const std::string& dataGroupId, std::string& d return false; } -sptr BundleMgrHelper::GetOverlayManagerProxy() -{ - AAFwk::MyStatus::GetInstance().getOverlayCall_++; - return AAFwk::MyStatus::GetInstance().getOverlay_; -} - bool BundleMgrHelper::QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo) { return false; 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..48fc8df834fb8caea721ed5054f7bc08e7ac5452 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 @@ -148,12 +148,6 @@ bool BundleMgrHelper::GetGroupDir(const std::string& dataGroupId, std::string& d return false; } -sptr BundleMgrHelper::GetOverlayManagerProxy() -{ - AAFwk::MyStatus::GetInstance().getOverlayCall_++; - return AAFwk::MyStatus::GetInstance().getOverlay_; -} - bool BundleMgrHelper::QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo) { return false; diff --git a/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp b/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp index 65aa161005ff1c310678c365d9806260c3a0c296..cf5574d0d8625f03207ea85917223bb5e0a7e19d 100644 --- a/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp +++ b/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp @@ -1063,67 +1063,6 @@ HWTEST_F(AppMgrServiceInnerSeventhTest, StartPerfProcessByStartMsg_002, TestSize TAG_LOGI(AAFwkTag::TEST, "StartPerfProcessByStartMsg_002 end"); } -/** -* @tc.name: SetOverlayInfo_001 -* @tc.desc: test SetOverlayInfo_001 -* @tc.type: FUNC -*/ -HWTEST_F(AppMgrServiceInnerSeventhTest, SetOverlayInfo_001, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_001 start"); - auto appMgrServiceInner = std::make_shared(); - AAFwk::MyStatus::GetInstance().getBundleManagerHelper_ = nullptr; - AAFwk::MyStatus::GetInstance().getOverlayCall_ = 0; - - std::string bundleName = ""; - int32_t userId = 0; - AppSpawnStartMsg startMs; - appMgrServiceInner->SetOverlayInfo(bundleName, userId, startMs); - EXPECT_EQ(AAFwk::MyStatus::GetInstance().getOverlayCall_, 0); - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_001 end"); -} - -/** -* @tc.name: SetOverlayInfo_002 -* @tc.desc: test SetOverlayInfo_002 -* @tc.type: FUNC -*/ -HWTEST_F(AppMgrServiceInnerSeventhTest, SetOverlayInfo_002, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_002 start"); - auto appMgrServiceInner = std::make_shared(); - AAFwk::MyStatus::GetInstance().getBundleManagerHelper_ = std::make_shared(); - AAFwk::MyStatus::GetInstance().getOverlayCall_ = 0; - - std::string bundleName = ""; - int32_t userId = 0; - AppSpawnStartMsg startMs; - appMgrServiceInner->SetOverlayInfo(bundleName, userId, startMs); - EXPECT_EQ(AAFwk::MyStatus::GetInstance().getOverlayCall_, 1); - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_002 end"); -} - -/** -* @tc.name: SetOverlayInfo_003 -* @tc.desc: test SetOverlayInfo_003 -* @tc.type: FUNC -*/ -HWTEST_F(AppMgrServiceInnerSeventhTest, SetOverlayInfo_003, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_003 start"); - auto appMgrServiceInner = std::make_shared(); - AAFwk::MyStatus::GetInstance().getBundleManagerHelper_ = std::make_shared(); - AAFwk::MyStatus::GetInstance().getOverlayCall_ = 0; - AAFwk::MyStatus::GetInstance().getOverlay_ = new (std::nothrow) AppExecFwk::OverlayManagerProxy(nullptr); - - std::string bundleName = ""; - int32_t userId = 0; - AppSpawnStartMsg startMs; - appMgrServiceInner->SetOverlayInfo(bundleName, userId, startMs); - EXPECT_EQ(AAFwk::MyStatus::GetInstance().getOverlayCall_, 1); - TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_003 end"); -} - /** * @tc.name: CreatNewStartMsg_001 * @tc.desc: test CreatNewStartMsg_001 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..0ff691cc89a864c51da6c084fabd95c7ae1fa584 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 @@ -148,12 +148,6 @@ bool BundleMgrHelper::GetGroupDir(const std::string& dataGroupId, std::string& d return false; } -sptr BundleMgrHelper::GetOverlayManagerProxy() -{ - AAFwk::MyStatus::GetInstance().getOverlayCall_++; - return AAFwk::MyStatus::GetInstance().getOverlay_; -} - bool BundleMgrHelper::QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo) { return false; 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..babdbe4f78d250def757dc8776bb05ccc52260e8 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 @@ -57,7 +57,6 @@ public: ErrCode GetDependentBundleInfo(const std::string& sharedBundleName, BundleInfo& sharedBundleInfo, GetDependentBundleInfoFlag flag = GetDependentBundleInfoFlag::GET_APP_CROSS_HSP_BUNDLE_INFO); bool GetGroupDir(const std::string& dataGroupId, std::string& dir); - sptr GetOverlayManagerProxy(); bool QueryAbilityInfo(const Want& want, AbilityInfo& abilityInfo); bool QueryAbilityInfo(const Want& want, int32_t flags, int32_t userId, AbilityInfo& abilityInfo); bool GetBundleInfos( diff --git a/test/unittest/app_running_processes_info_test/BUILD.gn b/test/unittest/app_running_processes_info_test/BUILD.gn index 38ca4ebfca0f92315a2811c0068d58a9dd4fe282..4db7e2c0608bec04620d6dd346156dcd52a88951 100644 --- a/test/unittest/app_running_processes_info_test/BUILD.gn +++ b/test/unittest/app_running_processes_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -48,7 +48,6 @@ ohos_unittest("AppRunningProcessesInfoTest") { "${ability_runtime_services_path}/appmgr/src/user_record_manager.cpp", "${ability_runtime_test_path}/mock/common/src/mock_native_token.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", ] sources += [ "app_running_processes_info_test.cpp" ] diff --git a/test/unittest/appkit/main_fourth_test/BUILD.gn b/test/unittest/appkit/main_fourth_test/BUILD.gn index 1cca5d292567640e10550836e547b99be725bfef..dee45bc5b4e59510dba8258cef5e7145a8e9d991 100644 --- a/test/unittest/appkit/main_fourth_test/BUILD.gn +++ b/test/unittest/appkit/main_fourth_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -25,7 +25,6 @@ ohos_unittest("main_fourth_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/sys_mgr_client_mock.cpp", "main_fourth_test.cpp", ] @@ -83,7 +82,6 @@ ohos_unittest("main_fourth_by_mock_bms_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/sys_mgr_client_mock.cpp", "main_fourth_by_mock_bms_test.cpp", ] diff --git a/test/unittest/appkit/main_fourth_test/main_fourth_by_mock_bms_test.cpp b/test/unittest/appkit/main_fourth_test/main_fourth_by_mock_bms_test.cpp index 89e6fcd84650baa65286efce8a6e4f3e4a16199a..18d609163a82b4c36cf10035795f46e578b7354c 100644 --- a/test/unittest/appkit/main_fourth_test/main_fourth_by_mock_bms_test.cpp +++ b/test/unittest/appkit/main_fourth_test/main_fourth_by_mock_bms_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,6 @@ #include "main_thread.h" #include "mock_bundle_installer_service.h" #include "mock_bundle_manager.h" -#include "mock_overlay_manager.h" #include "mock_system_ability_manager.h" #include "ohos_application.h" #include "process_info.h" diff --git a/test/unittest/appkit/main_thread_test/BUILD.gn b/test/unittest/appkit/main_thread_test/BUILD.gn index a48709c3575f19922e96b9d8d213f4e267b1aad9..fd2c5f19767d5d8999327c140d53bbe6e6742113 100644 --- a/test/unittest/appkit/main_thread_test/BUILD.gn +++ b/test/unittest/appkit/main_thread_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -25,7 +25,6 @@ ohos_unittest("main_thread_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/sys_mgr_client_mock.cpp", "main_thread_test.cpp", ] @@ -83,7 +82,6 @@ ohos_unittest("main_thread_by_mock_bms_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/services_appmgr_test/src/sys_mgr_client_mock.cpp", "main_thread_by_mock_bms_test.cpp", ] diff --git a/test/unittest/appkit/main_thread_test/main_thread_by_mock_bms_test.cpp b/test/unittest/appkit/main_thread_test/main_thread_by_mock_bms_test.cpp index 89e6fcd84650baa65286efce8a6e4f3e4a16199a..18d609163a82b4c36cf10035795f46e578b7354c 100644 --- a/test/unittest/appkit/main_thread_test/main_thread_by_mock_bms_test.cpp +++ b/test/unittest/appkit/main_thread_test/main_thread_by_mock_bms_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,6 @@ #include "main_thread.h" #include "mock_bundle_installer_service.h" #include "mock_bundle_manager.h" -#include "mock_overlay_manager.h" #include "mock_system_ability_manager.h" #include "ohos_application.h" #include "process_info.h" 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..d8763e37d4c025dbc73521a7f46ab2fa293d16e3 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -167,17 +167,6 @@ HWTEST_F(BundleMgrHelperTest, BundleMgrHelperTest_GetGroupDir_001, TestSize.Leve EXPECT_EQ(ret, false); } -/** - * @tc.name: BundleMgrHelperTest_GetOverlayManagerProxy_001 - * @tc.desc: GetOverlayManagerProxy - * @tc.type: FUNC - */ -HWTEST_F(BundleMgrHelperTest, BundleMgrHelperTest_GetOverlayManagerProxy_001, TestSize.Level1) -{ - auto ret = bundleMgrHelper->GetOverlayManagerProxy(); - EXPECT_NE(ret, nullptr); -} - /** * @tc.name: BundleMgrHelperTest_QueryAbilityInfo_002 * @tc.desc: QueryAbilityInfo diff --git a/test/unittest/cj_ability_stage_object_test/BUILD.gn b/test/unittest/cj_ability_stage_object_test/BUILD.gn index 2f3502ed99cbe98ceb670fc22d370db3d1503d20..426e3e1f15051c684d813b1ddf3b194f54834bb0 100644 --- a/test/unittest/cj_ability_stage_object_test/BUILD.gn +++ b/test/unittest/cj_ability_stage_object_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -39,7 +39,6 @@ ohos_unittest("cj_ability_stage_object_test") { "${ability_runtime_path}/frameworks/native/appkit/ability_runtime/app/cj_ability_stage_context.cpp", "${ability_runtime_path}/frameworks/native/appkit/ability_runtime/app/cj_ability_stage_object.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "cj_ability_stage_object_test.cpp", ] diff --git a/test/unittest/cj_ability_stage_test/BUILD.gn b/test/unittest/cj_ability_stage_test/BUILD.gn index 65d21dfbae7f3ba0012fe27c12d5bee63c9da38c..770304f7ec03f654c19ccc9530bf92185d0dc299 100644 --- a/test/unittest/cj_ability_stage_test/BUILD.gn +++ b/test/unittest/cj_ability_stage_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -38,7 +38,6 @@ ohos_unittest("cj_ability_stage_test") { "${ability_runtime_path}/frameworks/native/appkit/ability_runtime/app/cj_ability_stage.cpp", "${ability_runtime_path}/frameworks/native/appkit/ability_runtime/app/cj_ability_stage_context.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "cj_ability_stage_test.cpp", ] diff --git a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn index 475cb31348ad87bfb25212c2eadea84272afab33..6864309cbf91d8b935cc7ca4fa26c4dd837c72e7 100644 --- a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn @@ -259,7 +259,6 @@ ohos_unittest("ability_context_test") { "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_clientex.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "ability_context_test.cpp", ] @@ -1863,7 +1862,6 @@ ohos_unittest("ability_permission_test") { sources = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_ability_manager_service.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "ability_permission_test.cpp", ] diff --git a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn index edff3a58eaa9403e39a0d777773e2327a2a30ce7..9b4e0f03fa0b2d664add9c401b50ea86e0e898eb 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn @@ -101,7 +101,6 @@ ohos_unittest("application_test") { "${ability_runtime_native_path}/appkit/app/application_cleaner.cpp", "${ability_runtime_native_path}/appkit/app/ohos_application.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "application_test.cpp", ] @@ -343,7 +342,6 @@ ohos_unittest("context_container_test") { "${ability_runtime_native_path}/appkit/app/application_cleaner.cpp", "${ability_runtime_native_path}/appkit/app/ohos_application.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "context_container_test.cpp", ] @@ -536,7 +534,6 @@ ohos_unittest("context_deal_test") { "${ability_runtime_native_path}/appkit/app/application_cleaner.cpp", "${ability_runtime_native_path}/appkit/app/ohos_application.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include/mock_ability_manager_client.cpp", "context_deal_test.cpp", @@ -692,7 +689,6 @@ ohos_unittest("ability_stage_test") { sources = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/mock_overlay_manager.cpp", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include/sys_mgr_client_mock.cpp", "ability_stage_test.cpp", "application_data_manager_test.cpp", diff --git a/test/unittest/quick_fix/quick_fix_manager_service_second_test/BUILD.gn b/test/unittest/quick_fix/quick_fix_manager_service_second_test/BUILD.gn index fae57fb64e6ba3112ec24b1c666bf0bec5bd1096..1392b0e33d8eeea0294d2c51d8ee70747bd154f2 100644 --- a/test/unittest/quick_fix/quick_fix_manager_service_second_test/BUILD.gn +++ b/test/unittest/quick_fix/quick_fix_manager_service_second_test/BUILD.gn @@ -28,7 +28,6 @@ ohos_unittest("quick_fix_manager_service_second_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/unittest/quick_fix/mock/src/mock_quick_fix_util.cpp", "mock/src/mock_my_flag.cpp", "mock/src/mock_permission_verification.cpp", diff --git a/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn b/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn index e35e6e9b2e2805d76a2f31464c1bbdc23962e566..c865b4176e72849d24ff95ede439b0c6ca2e2b4e 100644 --- a/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn +++ b/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -27,7 +27,6 @@ ohos_unittest("quick_fix_manager_service_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/unittest/quick_fix/mock/src/mock_quick_fix_util.cpp", "quick_fix_manager_service_test.cpp", ] @@ -77,7 +76,6 @@ ohos_unittest("quick_fix_manager_apply_task_test") { sources = [ "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_bundle_manager.cpp", - "${ability_runtime_test_path}/mock/services_appmgr_test/src/mock_overlay_manager.cpp", "${ability_runtime_test_path}/unittest/quick_fix/mock/src/mock_quick_fix_util.cpp", "quick_fix_manager_apply_task_test.cpp", ]