diff options
-rw-r--r-- | src/ui/popup-bin/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/ui/popup-bin/popup-service.cpp | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/popup-bin/CMakeLists.txt b/src/ui/popup-bin/CMakeLists.txt index 6d434ae..39620ae 100644 --- a/src/ui/popup-bin/CMakeLists.txt +++ b/src/ui/popup-bin/CMakeLists.txt @@ -22,6 +22,7 @@ PKG_CHECK_MODULES(CERT_CHECKER_POPUP_DEP elementary libtzplatform-config + pkgmgr-info capi-appfw-application REQUIRED) diff --git a/src/ui/popup-bin/popup-service.cpp b/src/ui/popup-bin/popup-service.cpp index 0fec83e..88a55ec 100644 --- a/src/ui/popup-bin/popup-service.cpp +++ b/src/ui/popup-bin/popup-service.cpp @@ -24,6 +24,7 @@ #include <memory> #include <app_control.h> +#include <pkgmgr-info.h> #include "popup.h" #include "service/app.h" @@ -41,9 +42,25 @@ struct AppControl { app_control_h handle; }; +bool isValid(const std::string &pkgId) +{ + pkgmgrinfo_pkginfo_h h; + if(::pkgmgrinfo_pkginfo_get_pkginfo(pkgId.c_str(), &h) != PMINFO_R_OK) + return false; + + ::pkgmgrinfo_pkginfo_destroy_pkginfo(h); + return true; +} + bool launchSettingManager(const std::string &pkgId) { LogDebug("Start to launch setting manager about pkg : " << pkgId); + + if (!isValid(pkgId)) { + LogError("Failed to get package info. It may wrong pkg id."); + return false; + } + std::unique_ptr<AppControl> ac(new AppControl); app_control_set_operation(ac->handle, APP_CONTROL_OPERATION_DEFAULT); app_control_set_app_id(ac->handle, "setting-manage-applications-efl"); |