diff options
author | Myungki Lee <mk5004.lee@samsung.com> | 2017-08-16 18:45:38 +0900 |
---|---|---|
committer | Myungki Lee <mk5004.lee@samsung.com> | 2017-08-17 14:09:32 +0900 |
commit | 666ae401eeeac45c6395c4ba230aec9257219c49 (patch) | |
tree | 03970cccaad1480d2f5f39dbe2ce3900fd22154c | |
parent | b4fb4415a5244713159e804fe143f41d72dd167c (diff) | |
download | notification-666ae401eeeac45c6395c4ba230aec9257219c49.tar.gz notification-666ae401eeeac45c6395c4ba230aec9257219c49.tar.bz2 notification-666ae401eeeac45c6395c4ba230aec9257219c49.zip |
Changed the error handling of notification_create()
- To not return an error even if we do not have a domain name.
In the case of the web app, the domain can not be obtained.
Change-Id: I25d46cb99d4c6e14443d139414941873fab5149b
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
-rwxr-xr-x | src/notification.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/notification.c b/src/notification.c index f2b92a8..c8b8f3a 100755 --- a/src/notification.c +++ b/src/notification.c @@ -1481,6 +1481,8 @@ static notification_h _notification_create(notification_type_e type) if (getuid() < REGULAR_UID_MIN) { noti->pkg_id = strdup(noti->caller_app_id); + if (noti->pkg_id == NULL) + err = -1; } else { err = aul_app_get_pkgid_bypid(getpid(), pkg_id, sizeof(pkg_id)); if (err != AUL_R_OK) @@ -1488,16 +1490,23 @@ static notification_h _notification_create(notification_type_e type) else noti->pkg_id = strdup(pkg_id); + if (noti->pkg_id == NULL) { + err = -1; + goto out; + } + err = _notification_get_app_name(pkg_id, &domain_name); if (err != 0 || domain_name == NULL) { - NOTIFICATION_WARN("Failed to get app name domain_name[%p]", - err, domain_name); + NOTIFICATION_WARN("Failed to get domain_name"); + err = 0; + /* In the case of the web app, + the domain can not be obtained. */ goto out; } err = package_info_create(pkg_id, &package_info); if (err != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { - NOTIFICATION_WARN("Failted to create package_info err[%d] pkg_id[%s]", + NOTIFICATION_WARN("Failed to create package_info err[%d] pkg_id[%s]", err, pkg_id); goto out; } |