summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInkyun Kil <inkyun.kil@samsung.com>2018-05-30 23:57:48 (GMT)
committerInkyun Kil <inkyun.kil@samsung.com>2018-06-05 04:14:53 (GMT)
commit99a9e87264d7697121258025aaee65c9d4775903 (patch)
tree3762ebe5cb8e7078f0d9879df8322c6790d2f749
parenta0cb06dec2e36fc1b832bf20c50e3c51ca1e3dc0 (diff)
downloadbadge-99a9e87264d7697121258025aaee65c9d4775903.zip
badge-99a9e87264d7697121258025aaee65c9d4775903.tar.gz
badge-99a9e87264d7697121258025aaee65c9d4775903.tar.bz2
Apply PMINFO_APPINFO_PROP_PRIVILEGErefs/changes/65/180565/4
To optimize initializing db, apply the PMINFO_APPINFO_PROP_PRIVILEGE for retrieving some applictions. related patch : https://review.tizen.org/gerrit/#/c/179681/ Change-Id: Id7b36968efec3c38e91c68e59c347e8c91e5a6cb Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
-rw-r--r--src/badge_setting_service.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/badge_setting_service.c b/src/badge_setting_service.c
index 4ed5547..e1efbd6 100644
--- a/src/badge_setting_service.c
+++ b/src/badge_setting_service.c
@@ -657,7 +657,7 @@ EXPORT_API int badge_setting_refresh_setting_table(uid_t uid)
int pkgmgr_ret;
sqlite3 *db = NULL;
badge_setting_info info;
- pkgmgrinfo_pkginfo_filter_h filter;
+ pkgmgrinfo_appinfo_filter_h filter = NULL;
sql_ret = sqlite3_open_v2(BADGE_DB_PATH, &db, SQLITE_OPEN_READWRITE, NULL);
if (sql_ret != SQLITE_OK || db == NULL) {
@@ -667,21 +667,42 @@ EXPORT_API int badge_setting_refresh_setting_table(uid_t uid)
sqlite3_exec(db, "BEGIN immediate;", NULL, NULL, NULL);
- pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&filter);
+ pkgmgr_ret = pkgmgrinfo_appinfo_filter_create(&filter);
if (pkgmgr_ret != PMINFO_R_OK) {
/* LCOV_EXCL_START */
- ERR("pkgmgrinfo_pkginfo_filter_create failed [%d]", pkgmgr_ret);
+ ERR("pkgmgrinfo_appinfo_filter_create failed [%d]", pkgmgr_ret);
ret = BADGE_ERROR_FROM_DB;
goto out;
/* LCOV_EXCL_STOP */
}
+ pkgmgr_ret = pkgmgrinfo_appinfo_filter_add_string(filter,
+ PMINFO_APPINFO_PROP_PRIVILEGE, BADGE_PRIVILEGE);
+ if (pkgmgr_ret != PMINFO_R_OK) {
+ /* LCOV_EXCL_START */
+ ERR("pkgmgrinfo_appinfo_filter_add_string failed [%d]",
+ pkgmgr_ret);
+ goto out;
+ /* LCOV_EXCL_STOP */
+ }
+
+ pkgmgr_ret = pkgmgrinfo_appinfo_filter_add_bool(filter,
+ PMINFO_APPINFO_PROP_APP_NODISPLAY, false);
+ if (pkgmgr_ret != PMINFO_R_OK) {
+ /* LCOV_EXCL_START */
+ ERR("pkgmgrinfo_appinfo_filter_add_bool failed [%d]",
+ pkgmgr_ret);
+ goto out;
+ /* LCOV_EXCL_STOP */
+ }
+
info.db = db;
info.uid = uid;
- pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, package_info_callback, &info, uid);
+ pkgmgr_ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(filter,
+ app_info_callback, &info, uid);
if (pkgmgr_ret != PMINFO_R_OK) {
/* LCOV_EXCL_START */
- ERR("pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo failed [%d]",
+ ERR("pkgmgrinfo_appinfo_usr_filter_foreach_appinfo failed [%d]",
pkgmgr_ret);
ret = BADGE_ERROR_FROM_DB;
goto out;
@@ -690,7 +711,7 @@ EXPORT_API int badge_setting_refresh_setting_table(uid_t uid)
out:
if (filter)
- pkgmgrinfo_pkginfo_filter_destroy(filter);
+ pkgmgrinfo_appinfo_filter_destroy(filter);
if (db) {
if (ret == BADGE_ERROR_NONE)
sqlite3_exec(db, "END;", NULL, NULL, NULL);