summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYunhee Seo <yuni.seo@samsung.com>2023-08-18 12:58:40 +0900
committerYunhee Seo <yuni.seo@samsung.com>2023-08-21 14:30:57 +0900
commit8721411b5fff98bf3c4487175fafabfb714ddee7 (patch)
treed4ebcc9ea3fbed427b7b6d2f4acb8ec0db794e35 /include
parenta3a75b5c5c6f67a6d2868021a67681ed29c79c82 (diff)
downloadlibsvi-8721411b5fff98bf3c4487175fafabfb714ddee7.tar.gz
libsvi-8721411b5fff98bf3c4487175fafabfb714ddee7.tar.bz2
libsvi-8721411b5fff98bf3c4487175fafabfb714ddee7.zip
feedback: Add checking privilege for multi-theme support funcs
Setting feedback theme index is required "http://tizen.org/privilege/systemsettings.admin" privilege. Getting feedback theme is required "http://tizen.org/privilege/internal/default/public". If application has above privilege, setting/getting theme index is successful. Change-Id: I5aad3f3138e0fe0d0211832300929d78a4d7d47b Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/feedback-internal.h9
-rw-r--r--include/util/feedback-privilege.h26
2 files changed, 35 insertions, 0 deletions
diff --git a/include/feedback-internal.h b/include/feedback-internal.h
index c7b03da..17b254c 100755
--- a/include/feedback-internal.h
+++ b/include/feedback-internal.h
@@ -161,6 +161,8 @@ int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pattern
* @brief Gets the number of theme supported.
* @details This function gets the number of theme described in the config file.
* @since_tizen 8.0
+ * @remarks For reading count of feedback theme by feedback type, the privilege should be set to, %http://tizen.org/privilege/internal/default/public.
+ * If app doesn't have the privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
* @param[in] type The feedback type
* @param[out] count_of_theme The number of theme supported
* @return @c 0 on success,
@@ -170,6 +172,7 @@ int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pattern
* @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
* @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
* @pre feedback_initialize()
*/
int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned int *count_of_theme);
@@ -178,6 +181,8 @@ int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned
* @brief Gets the current index of theme selected.
* @details This function gets the current index of theme selected.
* @since_tizen 8.0
+ * @remarks For reading feedback theme index, the privilege should be set to, %http://tizen.org/privilege/internal/default/public.
+ * If app doesn't have the privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
* @param[in] type The feedback type
* @param[out] index_of_theme The current index of theme selected
* @return @c 0 on success,
@@ -186,6 +191,7 @@ int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned
* @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
* @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
+ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
*/
int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned int *index_of_theme);
@@ -195,6 +201,8 @@ int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned in
* The range of theme index will be 1~N according to conf file.
* Please put the accurate index_of_theme value.
* @since_tizen 8.0
+ * @remarks For setting feedback theme index, the privilege should be set to, %http://tizen.org/privilege/systemsettings.admin.
+ * If app doesn't have the privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
* @param[in] type The feedback type
* @param[in] index_of_theme The index of theme will be selected
* @return @c 0 on success,
@@ -203,6 +211,7 @@ int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned in
* @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
* @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
+ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
*/
int feedback_set_theme_index_internal(feedback_type_e feedback_type, unsigned int index_of_theme);
diff --git a/include/util/feedback-privilege.h b/include/util/feedback-privilege.h
new file mode 100644
index 0000000..bdd1852
--- /dev/null
+++ b/include/util/feedback-privilege.h
@@ -0,0 +1,26 @@
+
+/*
+ * libfeedback
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __FEEDBACK_PRIVILEGE_H__
+#define __FEEDBACK_PRIVILEGE_H__
+
+#include <stdbool.h>
+
+bool is_privilege_supported(const char *privilege_name);
+
+#endif //__FEEDBACK_PRIVILEGE_H__ \ No newline at end of file