From 1c1ee699670341d8428ed909cee5703b230f3179 Mon Sep 17 00:00:00 2001 From: dingyao Date: Sat, 16 Apr 2022 15:48:40 +0800 Subject: [PATCH] bmsforcut Signed-off-by: dingyao --- .../include/free_install/free_install_params.h | 2 -- .../free_install/bundle_connect_ability_mgr.cpp | 14 ++------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/interfaces/innerkits/appexecfwk_base/include/free_install/free_install_params.h b/interfaces/innerkits/appexecfwk_base/include/free_install/free_install_params.h index 19697cd4..ce81d1af 100644 --- a/interfaces/innerkits/appexecfwk_base/include/free_install/free_install_params.h +++ b/interfaces/innerkits/appexecfwk_base/include/free_install/free_install_params.h @@ -18,7 +18,6 @@ #include -#include "event_handler.h" #include "iremote_object.h" #include "service_center_code.h" #include "want.h" @@ -30,7 +29,6 @@ struct FreeInstallParams : public virtual RefBase { OHOS::AAFwk::Want want; int32_t userId; ServiceCenterFunction serviceCenterFunction; - std::shared_ptr handler; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp b/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp index 08edf4db..963cf645 100644 --- a/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp +++ b/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp @@ -287,9 +287,6 @@ void BundleConnectAbilityMgr::OnServiceCenterCall(std::string installResultStr) return; } freeInstallParams = node->second; - if (freeInstallParams.handler != nullptr) { - freeInstallParams.handler.reset(); - } if (installResult.result.retCode == ServiceCenterResultCode::FREE_INSTALL_DOWNLOADING) { APP_LOGI("ServiceCenter is downloading, downloadSize = %{public}d, totalSize = %{public}d", installResult.progress.downloadSize, installResult.progress.totalSize); @@ -311,8 +308,7 @@ void BundleConnectAbilityMgr::OutTimeMonitor(std::string transactId) return; } freeInstallParams = node->second; - std::shared_ptr handler = freeInstallParams.handler; - if (handler == nullptr) { + if (handler_ == nullptr) { APP_LOGE("OutTimeMonitor, handler is nullptr"); return; } @@ -321,7 +317,7 @@ void BundleConnectAbilityMgr::OutTimeMonitor(std::string transactId) freeInstallParams.want, freeInstallParams.userId, transactId); APP_LOGI("RegisterEventListenerFunc"); }; - handler->PostTask(RegisterEventListenerFunc, OUT_TIME, AppExecFwk::EventQueue::Priority::LOW); + handler_->PostTask(RegisterEventListenerFunc, OUT_TIME, AppExecFwk::EventQueue::Priority::LOW); } void BundleConnectAbilityMgr::SendRequest( @@ -481,8 +477,6 @@ bool BundleConnectAbilityMgr::CheckIsModuleNeedUpdate( freeInstallParams->want = want; freeInstallParams->userId = userId; freeInstallParams->serviceCenterFunction = ServiceCenterFunction::SERVICE_CENTER_CONNECT_UPGRADE_INSTALL; - auto runner = EventRunner::Create(true); - freeInstallParams->handler = std::make_shared(runner); auto ret = freeInstallParamsMap_.emplace(targetInfo->transactId, *freeInstallParams); if (!ret.second) { APP_LOGE("BundleConnectAbilityMgr::QueryAbilityInfo map emplace error"); @@ -548,8 +542,6 @@ bool BundleConnectAbilityMgr::QueryAbilityInfo(const Want &want, int32_t flags, return false; } GetTargetAbilityInfo(want, innerBundleInfo, targetAbilityInfo, targetInfo); - auto runner = EventRunner::Create(true); - freeInstallParams->handler = std::make_shared(runner); freeInstallParams->serviceCenterFunction = ServiceCenterFunction::SERVICE_CENTER_CONNECT_SILENT_INSTALL; auto ret = freeInstallParamsMap_.emplace(targetInfo->transactId, *freeInstallParams); if (!ret.second) { @@ -589,8 +581,6 @@ void BundleConnectAbilityMgr::UpgradeAtomicService(const Want &want, int32_t use freeInstallParams->want = want; freeInstallParams->userId = userId; freeInstallParams->serviceCenterFunction = ServiceCenterFunction::SERVICE_CENTER_CONNECT_UPGRADE_CHECK; - auto runner = EventRunner::Create(true); - freeInstallParams->handler = std::make_shared(runner); auto ret = freeInstallParamsMap_.emplace(targetInfo->transactId, *freeInstallParams); if (!ret.second) { APP_LOGE("BundleConnectAbilityMgr::QueryAbilityInfo map emplace error");