Add internal API to set priv_id 58/123858/1
authorseungha.son <seungha.son@samsung.com>
Fri, 7 Apr 2017 08:35:03 +0000 (17:35 +0900)
committerseungha.son <seungha.son@samsung.com>
Fri, 7 Apr 2017 08:35:42 +0000 (17:35 +0900)
Signed-off-by: seungha.son <seungha.son@samsung.com>
Change-Id: Ica28df2a911553617b0a0503310af955aedee656

include/notification_internal.h
src/notification_internal.c

index 0f8c078..4557472 100755 (executable)
@@ -525,6 +525,17 @@ NOTIFICATION_DEPRECATED_API int notification_get_id(notification_h noti,
 
 /**
  * @internal
+ * @brief Set priv_id of the notification.
+ * @param[in] noti Notification handle
+ * @param[in] priv_id Private ID
+ * @return NOTIFICATION_ERROR_NONE on success, other value on failure
+ * @retval NOTIFICATION_ERROR_NONE Success
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int notification_set_priv_id(notification_h noti, int priv_id);
+
+/**
+ * @internal
  * @brief This function will be deprecated.
  * @param[in] type Notification type
  * @param[in] group_id Group ID
index 7414cb5..fa1ab72 100755 (executable)
@@ -990,6 +990,16 @@ EXPORT_API int notification_get_id(notification_h noti,
 }
 /* LCOV_EXCL_STOP */
 
+EXPORT_API int notification_set_priv_id(notification_h noti, int priv_id)
+{
+       if (noti == NULL || priv_id <= 0)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+       noti->priv_id = priv_id;
+
+       return NOTIFICATION_ERROR_NONE;
+}
+
 /* LCOV_EXCL_START */
 notification_h notification_load_for_uid(char *pkgname,
                int priv_id, uid_t uid)