#include <stdio.h>
-#include <stdlib.h>
#include <vconf.h>
#include <system_info.h>
#include <sys/stat.h>
pthread_mutex_lock(&fmutex);
if (!profile) {
_E("there is no valid profile module."); //LCOV_EXCL_LINE
- pthread_mutex_unlock(&fmutex);
+ pthread_mutex_unlock(&fmutex); //LCOV_EXCL_LINE System Error
return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE System Error
}
dev = find_device(type);
if (!dev) {
_E("Not supported device : type(%s)", profile->str_type[type]); //LCOV_EXCL_LINE
- return FEEDBACK_ERROR_NOT_SUPPORTED;
+ return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
}
err = dev->is_supported(check_pattern(type, pattern, __func__), &supported);
*/
#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
#include "parser.h"
#include <stdio.h>
-#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
_D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
- sndstatus = 0;
+ sndstatus = 0; //LCOV_EXCL_LINE
}
/* add watch for status value */
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb, NULL);
if (ret != 0)
- _W("Add watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed");
+ _W("Add watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed"); //LCOV_EXCL_LINE
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb, NULL);
if (ret != 0)
- _W("Add watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed");
+ _W("Add watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
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");
+ _W("Add watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
}
static void sound_exit(void)
/* remove watch */
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb);
if (ret != 0)
- _W("Remove watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed");
+ _W("Remove watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed"); //LCOV_EXCL_LINE
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb);
if (ret != 0)
- _W("Remove watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed");
+ _W("Remove watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
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");
+ _W("Remove watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
/* free sound data */
feedback_free_config(&sound_info);
ret = sound_manager_destroy_stream_information(stream_info);
if (ret != SOUND_MANAGER_ERROR_NONE)
- _E("Failed to set session to play sound(%d)", ret);
+ _E("Failed to set session to play sound(%d)", ret); //LCOV_EXCL_LINE
}
static int sound_play(feedback_pattern_e pattern, bool always)
if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
_D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
- sndstatus = 0;
+ sndstatus = 0; //LCOV_EXCL_LINE
}
if (always) {
if (!supported) {
_E("Invalid parameter : supported(NULL)"); //LCOV_EXCL_LINE
- return -EINVAL;
+ return -EINVAL; //LCOV_EXCL_LINE
}
/* get sound file path */
_D("stop success!");
return 0;
}
- _E("mm_sound_stop_keysound() returned error(%d)", ret);
- return ret;
+ _E("mm_sound_stop_keysound() returned error(%d)", ret); //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
//LCOV_EXCL_START Not used function
#include <stdio.h>
-#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
return profile->get_priority(pattern);
return PRIORITY_MIDDLE;
}
-
+//LCOV_EXCL_START callback
static void feedback_vibstatus_cb(keynode_t *key, void* data)
{
vibstatus = vconf_keynode_get_bool(key);
}
+//LCOV_EXCL_STOP
static void vibrator_init(void)
{
bool haptic_avail;
ret = system_info_get_platform_bool(VIBRATION_FEATURE, &haptic_avail);
- if (ret < 0) {
- v_handle = -ENOTSUP;
- return;
+ if (ret < 0) { //LCOV_EXCL_LINE
+ v_handle = -ENOTSUP; //LCOV_EXCL_LINE
+ return; //LCOV_EXCL_LINE
} else if (ret == 0 && !haptic_avail) {
- v_handle = -ENOTSUP;
- return;
+ v_handle = -ENOTSUP; //LCOV_EXCL_LINE
+ return; //LCOV_EXCL_LINE
}
/* Vibration Init */
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb, NULL);
if (ret != 0)
- _W("Add watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed");
+ _W("Add watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
}
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");
+ _W("Remove watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
}
static int vibrator_play(feedback_pattern_e pattern, bool always)
if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) < 0) {
_D("fail to get vibration status, will work as turning off"); //LCOV_EXCL_LINE
- vibstatus = 0;
+ vibstatus = 0; //LCOV_EXCL_LINE
}
if (always) {
if (!data) {
free(temp);
_E("Not supported vibration pattern"); //LCOV_EXCL_LINE
- return -ENOTSUP;
+ return -ENOTSUP; //LCOV_EXCL_LINE
}
_D("pattern : %s", data);
if (ret < 0) {
_E("fail to play vibration"); //LCOV_EXCL_LINE
- free(temp);
- if (ret == -ECOMM || ret == -ENOTSUP)
+ free(temp); //LCOV_EXCL_LINE
+ if (ret == -ECOMM || ret == -ENOTSUP) //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE System Error
- return -EPERM;
+ return -EPERM; //LCOV_EXCL_LINE
}
_D("Play success! Data is %s", data);
ret = haptic_vibrate_stop(v_handle);
if (ret < 0) {
_E("haptic_vibrate_stop is failed"); //LCOV_EXCL_LINE
- if (ret == -ECOMM)
+ if (ret == -ECOMM) //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE System Error
- return -EPERM;
+ return -EPERM; //LCOV_EXCL_LINE
}
return 0;
if (!supported) {
_E("Invalid parameter : supported(NULL)"); //LCOV_EXCL_LINE
- return -EINVAL;
+ return -EINVAL; //LCOV_EXCL_LINE
}
if ((int)v_handle <= 0) {
}
_E("Not supported vibration"); //LCOV_EXCL_LINE
*supported = false; //LCOV_EXCL_LINE System Error
- return v_handle;
+ return v_handle; //LCOV_EXCL_LINE
}
if (pattern <= FEEDBACK_PATTERN_NONE ||
temp = strdup(profile->str_pattern(pattern));
data = trim_str(temp);
if (!data) {
- free(temp);
- *supported = false;
- return 0;
+ free(temp); //LCOV_EXCL_LINE
+ *supported = false; //LCOV_EXCL_LINE
+ return 0; //LCOV_EXCL_LINE
}
ret = haptic_is_supported(data);
free(temp);
if (ret < 0) {
_E("fail to get support information"); //LCOV_EXCL_LINE
- if (ret == -ECOMM)
- return ret;
- return -EPERM;
+ if (ret == -ECOMM) //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
+ return -EPERM; //LCOV_EXCL_LINE
}
_D("is_supported : %d", ret);