Can set NULL to path of image 70/96270/2 accepted/tizen/3.0/common/20161114.081541 accepted/tizen/3.0/ivi/20161110.020331 accepted/tizen/3.0/mobile/20161110.020235 accepted/tizen/3.0/tv/20161110.020253 accepted/tizen/3.0/wearable/20161110.020313 submit/tizen_3.0/20161108.101813 submit/tizen_3.0_common/20161110.084657
authorMyungki Lee <mk5004.lee@samsung.com>
Tue, 8 Nov 2016 10:30:23 +0000 (19:30 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Tue, 8 Nov 2016 10:30:23 +0000 (19:30 +0900)
- When the image type has a path

Change-Id: I3e99b854580ea67cacf5a7dce97c8fe2c8b0a40b
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/notification.c

index 0837948..9a1aaca 100755 (executable)
@@ -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);