summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyungki Lee <mk5004.lee@samsung.com>2016-11-08 19:30:23 +0900
committerMyungki Lee <mk5004.lee@samsung.com>2016-11-08 19:30:23 +0900
commit0bcbe5db3b3267eee52ff32cf7540aeff1dd345f (patch)
treecc309b05d5b1c0bd7b878afb70a799c751547127
parentce3f3f392be0438c8acbcb56d26b68494ff9a1b3 (diff)
downloadnotification-0bcbe5db3b3267eee52ff32cf7540aeff1dd345f.tar.gz
notification-0bcbe5db3b3267eee52ff32cf7540aeff1dd345f.tar.bz2
notification-0bcbe5db3b3267eee52ff32cf7540aeff1dd345f.zip
- When the image type has a path Change-Id: I3e99b854580ea67cacf5a7dce97c8fe2c8b0a40b Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
-rwxr-xr-xsrc/notification.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/notification.c b/src/notification.c
index 0837948..9a1aaca 100755
--- a/src/notification.c
+++ b/src/notification.c
@@ -95,14 +95,14 @@ char *notification_get_pkgname_by_pid(void)
}
EXPORT_API int notification_set_image(notification_h noti,
- notification_image_type_e type,
- const char *image_path)
+ notification_image_type_e type,
+ const char *image_path)
{
bundle *b = NULL;
char buf_key[32] = { 0, };
char *ret_val = NULL;
- if (noti == NULL || image_path == NULL)
+ if (noti == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (type <= NOTIFICATION_IMAGE_TYPE_NONE
@@ -118,8 +118,12 @@ EXPORT_API int notification_set_image(notification_h noti,
if (ret_val != NULL)
bundle_del(b, buf_key);
- bundle_add_str(b, buf_key, image_path);
+ if (image_path != NULL)
+ bundle_add_str(b, buf_key, image_path);
} else {
+ if (image_path == NULL)
+ return NOTIFICATION_ERROR_NONE;
+
b = bundle_create();
snprintf(buf_key, sizeof(buf_key), "%d", type);