}
//LCOV_EXCL_STOP
+static void feedback_sound_theme_changed_cb(keynode_t *key, void* data)
+{
+ int vconf_sound_theme_index = vconf_keynode_get_int(key);
+
+ if (vconf_sound_theme_index <= 0) {
+ current_theme_index = 0;
+ return;
+ }
+
+ current_theme_index = vconf_keynode_get_int(key) - 1;
+}
+
static int feedback_parse_sound_multi_theme_section(const struct parse_result *result, void *data)
{
struct section_property *extracted_section_prop = NULL;
number_of_theme = 0;
current_theme_index = 0;
+ if (vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME, ¤t_theme_index) < 0)
+ _W("Failed to get VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME");
+
ret = sound_get_config();
if (ret < 0)
_W("Failed to load configuration file(%s): %d", SOUND_CONF_FILE, ret);
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb, NULL);
if (ret != 0)
_W("Add watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
+ ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME, feedback_sound_theme_changed_cb, NULL);
+ if (ret != 0)
+ _W("Add watch for VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME failed");
}
static void sound_put_config(void)
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb);
if (ret != 0)
_W("Remove watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
+ ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME, feedback_sound_theme_changed_cb);
+ if (ret != 0)
+ _W("Remove watch for VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME failed");
sound_put_config();
}
static int sound_set_theme_index(unsigned int index_of_theme)
{
+ int ret = 0;
+
if (index_of_theme > number_of_theme || index_of_theme <= 0)
return -EINVAL;
+ ret = vconf_set_int(VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME, current_theme_index+1);
+ if (ret < 0) {
+ _E("Failed to set vconf value for VCONFKEY_SETAPPL_ACCESSIBILITY_SOUND_FEEDBACK_THEME");
+ return -EPERM;
+ }
+
current_theme_index = index_of_theme - 1;
return 0;
static int vibstatus;
static unsigned int v_handle;
+static int current_theme_index = 0;
static inline char *trim_str(char *s)
{
}
//LCOV_EXCL_STOP
+static void feedback_vibration_theme_changed_cb(keynode_t *key, void* data)
+{
+ current_theme_index = vconf_keynode_get_int(key) - 1;
+}
+
static void vibrator_init(void)
{
int ret_val;
bool haptic_avail;
+ if (vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME, ¤t_theme_index) < 0)
+ _W("Failed to get VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME");
+
ret_val = system_info_get_platform_bool(VIBRATION_FEATURE, &haptic_avail);
if (ret_val < 0) { //LCOV_EXCL_LINE
v_handle = -ENOTSUP; //LCOV_EXCL_LINE
ret_val = vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb, NULL);
if (ret_val != 0)
_W("Add watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
+ ret_val = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME, feedback_vibration_theme_changed_cb, NULL);
+ if (ret_val != 0)
+ _W("Add watch for VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME failed");
}
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb);
if (ret != 0)
_W("Remove watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
+ ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME, feedback_vibration_theme_changed_cb);
+ if (ret != 0)
+ _W("Remove watch for VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME failed");
}
static int vibrator_play(feedback_pattern_e pattern, bool always)