diff options
author | Myungki Lee <mk5004.lee@samsung.com> | 2016-10-10 21:42:25 +0900 |
---|---|---|
committer | Myungki Lee <mk5004.lee@samsung.com> | 2016-10-10 21:42:25 +0900 |
commit | b2fa43d0f2483952ed1f42ae0c2c89dc7dda7e7f (patch) | |
tree | 8844cc7a56dd18c3025dc4541a70e050b2dac33d | |
parent | 246568dcb7f4a1a06241918eacc70b39e7e16e72 (diff) | |
download | notification-accepted/tizen/tv/20161011.050344.tar.gz notification-accepted/tizen/tv/20161011.050344.tar.bz2 notification-accepted/tizen/tv/20161011.050344.zip |
Use pkgid to get domain, path of dirsubmit/tizen/20161010.125001submit/tizen/20161010.124901accepted/tizen/wearable/20161011.050359accepted/tizen/tv/20161011.050344accepted/tizen/mobile/20161011.050329accepted/tizen/ivi/20161011.050415accepted/tizen/common/20161010.150111
- instead of app_id
Change-Id: I61e05ead3ba797a3c950fd633b3502d4da0a1191
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
-rwxr-xr-x | src/notification.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/notification.c b/src/notification.c index 3093a4e..2c2cb31 100755 --- a/src/notification.c +++ b/src/notification.c @@ -1399,7 +1399,8 @@ static notification_h _notification_create(notification_type_e type) char *domain_name = NULL; char *app_root_path = NULL; char locale_directory[PATH_MAX] = { 0, }; /* PATH_MAX 4096 */ - int err_app_manager = APP_MANAGER_ERROR_NONE; + char pkgid[NOTI_PKGNAME_LEN + 1] = { 0, }; + int err; if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) { NOTIFICATION_ERR("INVALID TYPE : %d", type); @@ -1435,37 +1436,35 @@ static notification_h _notification_create(notification_type_e type) if (getuid() >= REGULAR_UID_MIN) { noti->caller_pkgname = notification_get_pkgname_by_pid(); - - err_app_manager = app_manager_get_app_id(getpid(), &app_id); - if (err_app_manager != APP_MANAGER_ERROR_NONE || app_id == NULL) { - NOTIFICATION_WARN("app_manager_get_app_id failed err[%d] app_id[%p]", - err_app_manager, app_id); + if (noti->caller_pkgname == NULL) { + NOTIFICATION_ERR("get_pkgname_by_pid is failed"); goto out; } - /* app name is used as domain name */ - /* domain_name is allocated by app_get_package_app_name */ - err_app_manager = app_get_package_app_name(app_id, &domain_name); + err = aul_app_get_pkgid_bypid(getpid(), pkgid, sizeof(pkgid)); + if (err != AUL_R_OK) { + NOTIFICATION_ERR("get_pkgid_bypid is failed err[%d]", err); + goto out; + } - if (err_app_manager != APP_ERROR_NONE || domain_name == NULL) { + err = app_get_package_app_name(pkgid, &domain_name); + if (err != APP_ERROR_NONE || domain_name == NULL) { NOTIFICATION_WARN("app_get_package_app_name failed err[%d] domain_name[%p]", - err_app_manager, domain_name); + err, domain_name); goto out; } - err_app_manager = package_info_create(noti->caller_pkgname, &package_info); - - if (err_app_manager != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { - NOTIFICATION_WARN("package_info_create failed err[%d] package_info[%p] caller_pkgname[%s]", - err_app_manager, package_info, noti->caller_pkgname); + err = package_info_create(pkgid, &package_info); + if (err != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { + NOTIFICATION_WARN("package_info_create failed err[%d] package_info[%p] pkgid[%s]", + err, package_info, pkgid); goto out; } - err_app_manager = package_info_get_root_path(package_info, &app_root_path); - - if (err_app_manager != PACKAGE_MANAGER_ERROR_NONE || app_root_path == NULL) { + err = package_info_get_root_path(package_info, &app_root_path); + if (err != PACKAGE_MANAGER_ERROR_NONE || app_root_path == NULL) { NOTIFICATION_WARN("package_info_get_root_path failed err[%d] app_root_path[%p]", - err_app_manager, app_root_path); + err, app_root_path); goto out; } |