From fb51f0fb4ad46e899f47342947f23d3ec8cae794 Mon Sep 17 00:00:00 2001 From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics" Date: Mon, 26 Sep 2022 10:11:05 +0200 Subject: [PATCH] [Commmon] Fixed passing a pkgid [Verification] Works well with wrt service application. Change-Id: Ib1cebe4d57c7fc1962b0a6f11baca95fbb979834 --- src/common/tools.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/tools.cc b/src/common/tools.cc index 2e4d02a3..74a6b2fd 100644 --- a/src/common/tools.cc +++ b/src/common/tools.cc @@ -435,12 +435,12 @@ PlatformResult GetPkgApiVersion(std::string* api_version) { if (cached_pid == pid) { *api_version = cached_api_version; // Retrieve from local cache } else { - const char *pkgid =common::CurrentApplication::GetInstance().GetPackageId().c_str(); - if (pkgid == nullptr) { + std::string pkgid =common::CurrentApplication::GetInstance().GetPackageId(); + if (pkgid.empty()) { return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Fail to get pkg id"); } - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, getuid(), &pkginfo_handle); + int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid.c_str(), getuid(), &pkginfo_handle); if (ret != PMINFO_R_OK) { return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Fail to get pkginfo_h"); } -- 2.34.1