Add the value to be passed to the viewer 92/161592/2
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 27 Nov 2017 10:13:42 +0000 (19:13 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Mon, 27 Nov 2017 10:13:42 +0000 (19:13 +0900)
- This value allows viewer to distinguish whether noti is added or deleted.

Change-Id: Ie1ce76e933effb6ea1dae548d6902432993367d2
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
include/notification_viewer.h
src/notification_viewer.c

index f75bdf4..f4b9609 100644 (file)
@@ -18,6 +18,7 @@
 #define __NOTIFICATION_VIEWER_H__
 
 int notification_get_default_viewer(const char *path, char **default_viewer);
-int notification_launch_default_viewer(const char *default_viewer, int priv_id, uid_t uid);
+int notification_launch_default_viewer(const char *default_viewer, int priv_id,
+                               notification_op_type_e status, uid_t uid);
 
 #endif /* __NOTIFICATION_VIEWER_H__ */
index 9247375..f3e8b1a 100644 (file)
@@ -54,7 +54,8 @@ EXPORT_API int notification_get_default_viewer(const char *path, char **default_
 }
 
 /* LCOV_EXCL_START */
-EXPORT_API int notification_launch_default_viewer(const char *default_viewer, int priv_id, uid_t uid)
+EXPORT_API int notification_launch_default_viewer(const char *default_viewer,
+                       int priv_id, notification_op_type_e status, uid_t uid)
 {
        int ret;
        char buf[32] = {0,};
@@ -80,6 +81,15 @@ EXPORT_API int notification_launch_default_viewer(const char *default_viewer, in
                goto out;
        }
 
+       memset(buf, 0, sizeof(buf));
+       snprintf(buf, sizeof(buf), "%d", status);
+
+       ret = aul_svc_add_data(b, "NOTIFICATION_OP_TYPE", buf);
+       if (ret != AUL_SVC_RET_OK) {
+               NOTIFICATION_ERR("Failed to add extra_data[%x]", ret);
+               goto out;
+       }
+
        ret = aul_svc_run_service_async_for_uid(b, 0, NULL, NULL, uid);
        if (ret < 0) {
                NOTIFICATION_ERR("Failed to request app launch[%d]", ret);