Add the value to be passed to the viewer 75/162175/1
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 27 Nov 2017 10:13:42 +0000 (19:13 +0900)
committerMyungKi Lee <mk5004.lee@samsung.com>
Wed, 29 Nov 2017 10:41:32 +0000 (10:41 +0000)
- This value allows viewer to distinguish whether noti is added or deleted.

Change-Id: Ie1ce76e933effb6ea1dae548d6902432993367d2
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
(cherry picked from commit 5b887934600dc9f9c26661a8d49eed0226e2d678)

include/notification_viewer.h
src/notification_viewer.c

index f75bdf40fc712af01401ec517d3295a4438ce373..f4b96097d9e54d29074f5892923bbda0c373cc5c 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 924737504f0aee0a79f43e3245d3c4398fa446a0..f3e8b1a903397f7254945c4f09ebb83c59d8f52c 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);