From 60483544edfcb4117b02d2455eb9eb127ccf284b Mon Sep 17 00:00:00 2001 From: c00576431 Date: Tue, 30 May 2023 16:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: c00576431 --- .../appexecfwk_base/include/erms_mgr_param.h | 3 -- .../free_install/bundle_connect_ability_mgr.h | 1 - .../bundle_connect_ability_mgr.cpp | 48 ------------------- 3 files changed, 52 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_base/include/erms_mgr_param.h b/interfaces/inner_api/appexecfwk_base/include/erms_mgr_param.h index dedcee74c1..2f7b9fdb33 100644 --- a/interfaces/inner_api/appexecfwk_base/include/erms_mgr_param.h +++ b/interfaces/inner_api/appexecfwk_base/include/erms_mgr_param.h @@ -45,9 +45,6 @@ struct CallerInfo : public Parcelable { int64_t uid = 0L; int64_t pid = 0L; - int32_t callerAppType = 0; - int32_t targetAppType = 0; - bool ReadFromParcel(Parcel &parcel); bool Marshalling(Parcel &parcel) const override; diff --git a/services/bundlemgr/include/free_install/bundle_connect_ability_mgr.h b/services/bundlemgr/include/free_install/bundle_connect_ability_mgr.h index c7391afd44..bf25034a61 100644 --- a/services/bundlemgr/include/free_install/bundle_connect_ability_mgr.h +++ b/services/bundlemgr/include/free_install/bundle_connect_ability_mgr.h @@ -250,7 +250,6 @@ private: void PreloadRequest(int32_t flag, const TargetAbilityInfo &targetAbilityInfo); bool ProcessPreloadCheck(const TargetAbilityInfo &targetAbilityInfo); void ProcessPreloadRequestToServiceCenter(int32_t flag, const TargetAbilityInfo &targetAbilityInfo); - void GetEcologicalCallerInfo(const Want &want, ErmsCallerInfo &callerInfo, int32_t userId); int32_t GetPreloadFlag(); bool GetPreloadList(const std::string &bundleName, const std::string &moduleName, 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 32cb02b485..28f5911ce4 100644 --- a/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp +++ b/services/bundlemgr/src/free_install/bundle_connect_ability_mgr.cpp @@ -61,9 +61,6 @@ constexpr uint32_t OUT_TIME = 30000; const std::u16string ATOMIC_SERVICE_STATUS_CALLBACK_TOKEN = u"ohos.IAtomicServiceStatusCallback"; const std::u16string SERVICE_CENTER_TOKEN = u"abilitydispatcherhm.openapi.hapinstall.IHapInstall"; constexpr uint32_t FREE_INSTALL_DONE = 0; -constexpr int32_t TYPE_HARMONEY_INVALID = 0; -constexpr int32_t TYPE_HARMONEY_APP = 1; -constexpr int32_t TYPE_HARMONEY_SERVICE = 2; void SendSysEvent(int32_t resultCode, const AAFwk::Want &want, int32_t userId) { @@ -295,7 +292,6 @@ bool BundleConnectAbilityMgr::SilentInstall(TargetAbilityInfo &targetAbilityInfo } ErmsCallerInfo callerInfo; - GetEcologicalCallerInfo(want, callerInfo, userId); ExperienceRule rule; bool ret = CheckEcologicalRule(want, callerInfo, rule); if (!ret) { @@ -1134,49 +1130,5 @@ bool BundleConnectAbilityMgr::CheckEcologicalRule(const Want &want, ErmsCallerIn } return true; } - -void BundleConnectAbilityMgr::GetEcologicalCallerInfo(const Want &want, ErmsCallerInfo &callerInfo, int32_t userId) -{ - callerInfo.packageName = want.GetStringParam(Want::PARAM_RESV_CALLER_BUNDLE_NAME); - callerInfo.uid = want.GetIntParam(Want::PARAM_RESV_CALLER_UID, IPCSkeleton::GetCallingUid()); - callerInfo.pid = want.GetIntParam(Want::PARAM_RESV_CALLER_PID, -1); - callerInfo.targetAppType = TYPE_HARMONEY_SERVICE; - callerInfo.callerAppType = TYPE_HARMONEY_INVALID; - - std::shared_ptr bms = DelayedSingleton::GetInstance(); - std::shared_ptr bundleDataMgr_ = bms->GetDataMgr(); - if (bundleDataMgr_ == nullptr) { - APP_LOGE("GetDataMgr failed, bundleDataMgr_ is nullptr"); - return; - } - - std::string callerBundleName; - ErrCode err = bundleDataMgr_->GetNameForUid(callerInfo.uid, callerBundleName); - if (err != ERR_OK) { - APP_LOGE("Get callerBundleName failed."); - return; - } - AppExecFwk::ApplicationInfo callerAppInfo; - bool getCallerResult = bundleDataMgr_->GetApplicationInfo(callerBundleName, - AppExecFwk::ApplicationFlag::GET_BASIC_APPLICATION_INFO, userId, callerAppInfo); - if (!getCallerResult) { - APP_LOGE("Get callerAppInfo failed."); - return; - } - - switch (callerAppInfo.bundleType) { - case AppExecFwk::BundleType::ATOMIC_SERVICE: - APP_LOGD("the caller type is atomic service"); - callerInfo.callerAppType = TYPE_HARMONEY_SERVICE; - break; - case AppExecFwk::BundleType::APP: - APP_LOGD("the caller type is app"); - callerInfo.callerAppType = TYPE_HARMONEY_APP; - break; - default: - APP_LOGD("the caller type is invalid type"); - break; - } -} } // namespace AppExecFwk } // namespace OHOS -- Gitee