mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-23 07:09:53 +00:00
add method GetBundleNameByAppIdOrAppIdentifier
Signed-off-by: jiangminsen <jiangminsen@huawei.com>
This commit is contained in:
parent
b3ced90a97
commit
1b89b78901
@ -5370,7 +5370,7 @@ ErrCode BundleMgrProxy::GetCompatibleDeviceType(const std::string &bundleName, s
|
||||
|
||||
ErrCode BundleMgrProxy::GetBundleNameByAppIdOrAppIdentifier(const std::string &appId, std::string &bundleName)
|
||||
{
|
||||
APP_LOGD("GetBundleNameByAppIdOrAppIdentifier: appId: %{public}s", ret, appId.c_str());
|
||||
APP_LOGD("GetBundleNameByAppIdOrAppIdentifier: appId: %{public}s", appId.c_str());
|
||||
HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__);
|
||||
MessageParcel data;
|
||||
if (appId.empty()) {
|
||||
|
@ -8861,12 +8861,12 @@ ErrCode BundleDataMgr::GetBundleNameByAppIdOrAppIdentifier(const std::string &ap
|
||||
}
|
||||
std::unique_lock<std::shared_mutex> lock(bundleInfoMutex_);
|
||||
for (const auto &[key, innerInfo] : bundleInfos_) {
|
||||
if (innerInfo->GetAppId() == appId || innerInfo->GetAppIdentifier() == appId) {
|
||||
if (innerInfo.GetAppId() == appId || innerInfo.GetAppIdentifier() == appId) {
|
||||
bundleName = key;
|
||||
return ERR_OK;
|
||||
}
|
||||
}
|
||||
APP_LOGI("get bundleName failed %{public}s", appId.c_str());
|
||||
APP_LOGI("get bundleName failed %{private}s", appId.c_str());
|
||||
return ERR_BUNDLE_MANAGER_BUNDLE_NOT_EXIST;
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
|
@ -4555,7 +4555,7 @@ ErrCode BundleMgrHostImpl::GetBundleNameByAppIdOrAppIdentifier(const std::string
|
||||
APP_LOGW("get bundleName by appId %{public}s failed %{public}d", appId.c_str(), ret);
|
||||
return ret;
|
||||
}
|
||||
APP_LOGI("appId: %{public}s bundleName : %{public}s", appId.c_str(), bundleName.c_str());
|
||||
APP_LOGI("appId: %{private}s bundleName : %{public}s", appId.c_str(), bundleName.c_str());
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user