From 666ae401eeeac45c6395c4ba230aec9257219c49 Mon Sep 17 00:00:00 2001 From: Myungki Lee Date: Wed, 16 Aug 2017 18:45:38 +0900 Subject: 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 --- src/notification.c | 15 ++++++++++++--- 1 file 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; } -- cgit v1.2.3