feedback: Remove read privilege checking 88/297688/1 accepted/tizen/7.0/unified/20230824.162136
authorYunhee Seo <yuni.seo@samsung.com>
Wed, 23 Aug 2023 02:06:15 +0000 (11:06 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 23 Aug 2023 02:10:27 +0000 (11:10 +0900)
Allow apps to get theme index without read privilege dependencies.
Read privilege is removed from below functions.
- int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned int *count_of_theme)
- int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned int *index_of_theme)

Change-Id: I315dfcaf310f0948c7710ef366f73725505b490a
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
include/feedback-internal.h
src/feedback.c

index 962fe1d..844b309 100755 (executable)
@@ -161,8 +161,6 @@ 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 7.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,
@@ -172,7 +170,6 @@ 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);
@@ -181,8 +178,6 @@ 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 7.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,
@@ -191,7 +186,6 @@ 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);
 
index 6f0d0db..8a3eda6 100644 (file)
@@ -39,7 +39,6 @@ static guint signal_id = 0;
 
 #define SIGNAL_VIBRATOR_INITIATED "InitiateVibrator"
 #define PRIVILEGE_FEEDBACK_SET_THEME   "http://tizen.org/privilege/systemsettings.admin"
-#define PRIVILEGE_FEEDBACK_GET_THEME   "http://tizen.org/privilege/internal/default/public"
 
 //LCOV_EXCL_START Not called Callback
 static void restart_callback(GDBusConnection *conn,
@@ -532,9 +531,6 @@ API int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsi
        const struct device_ops *dev = NULL;
        int ret = 0;
 
-       if (!is_privilege_supported(PRIVILEGE_FEEDBACK_GET_THEME))
-               return FEEDBACK_ERROR_PERMISSION_DENIED;
-
        pthread_mutex_lock(&fmutex);
        if (!init_cnt) {
                _E("Not initialized"); //LCOV_EXCL_LINE
@@ -569,9 +565,6 @@ API int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigne
        const struct device_ops *dev = NULL;
        int ret = 0;
 
-       if (!is_privilege_supported(PRIVILEGE_FEEDBACK_GET_THEME))
-               return FEEDBACK_ERROR_PERMISSION_DENIED;
-
        if (feedback_type <= FEEDBACK_TYPE_NONE || feedback_type >= profile->max_type || !index_of_theme) {
                _E("Invalid parameter : type(%d)", feedback_type);
                return FEEDBACK_ERROR_INVALID_PARAMETER;