summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-07-25 13:37:23 +0900
committersangwan kwon <sangwan.kwon@samsung.com>2016-07-24 21:51:52 -0700
commit4403547ffe95b78401219e1e663abe4aeb2aa9ef (patch)
tree93bb9ef2ab12f2284e0e2f80e9374de8d05517fc
parent99659ec45d64234927b2fca33ad58e0648e573ca (diff)
downloadcert-checker-4403547ffe95b78401219e1e663abe4aeb2aa9ef.tar.gz
cert-checker-4403547ffe95b78401219e1e663abe4aeb2aa9ef.tar.bz2
cert-checker-4403547ffe95b78401219e1e663abe4aeb2aa9ef.zip
Add package info validation logic
* Before popup call app-control for launching setting-manager, * Check package info first. Change-Id: If0f607694b7fb18f2ddff556f3fc0726cb591d61 Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
-rw-r--r--src/ui/popup-bin/CMakeLists.txt1
-rw-r--r--src/ui/popup-bin/popup-service.cpp17
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");