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 dedcee74c15bc28295dec290af34f9f70e6bf679..2f7b9fdb333729297afb007dc1c3557b3e31b00f 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 c7391afd44990686569072f9725f5b7f8848213d..bf25034a61d82cf55b1df389e7e3940396eb96d5 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 32cb02b4857c92ac16b851f86340ada6aedb6c37..28f5911ce46d6de11f1cab8ad4d6dc4166491539 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