From: seungha.son Date: Mon, 16 May 2016 12:34:51 +0000 (+0900) Subject: Change from getuid() to TZ_SYS_DEFAULT_USER X-Git-Tag: submit/tizen/20160517.005404^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16fb0526e3d5948af69026b8a5f791b6e45a0dde;p=platform%2Fcore%2Fapi%2Fnotification.git Change from getuid() to TZ_SYS_DEFAULT_USER Add tzplatform_config.h file Signed-off-by: seungha.son Change-Id: I74fc61700e84e87131f055a5b4e91895ed50f2c3 --- diff --git a/src/notification_setting.c b/src/notification_setting.c index 0b341772..a90274fa 100755 --- a/src/notification_setting.c +++ b/src/notification_setting.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -34,8 +35,6 @@ #define NOTIFICATION_PRIVILEGE "http://tizen.org/privilege/notification" - - EXPORT_API int notification_setting_get_setting_array(notification_setting_h *setting_array, int *count) { int ret = NOTIFICATION_ERROR_NONE; @@ -392,7 +391,6 @@ EXPORT_API int notification_setting_refresh_setting_table() int sqlite3_ret = SQLITE_OK; int pkgmgr_ret = PACKAGE_MANAGER_ERROR_NONE; pkgmgrinfo_pkginfo_filter_h filter; - uid_t current_uid; sqlite3_ret = db_util_open(DBPATH, &db, 0); @@ -418,9 +416,11 @@ EXPORT_API int notification_setting_refresh_setting_table() goto out; } - current_uid = getuid(); - - pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, foreach_package_info_callback, db, current_uid); + /* + * DEFAULT_UID is owner's uid(5001) + * currently this api do not support multi-user. + */ + pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, foreach_package_info_callback, db, tzplatform_getuid(TZ_SYS_DEFAULT_USER)); if (pkgmgr_ret != PMINFO_R_OK) { NOTIFICATION_ERR("pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo failed [%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB;