diff options
author | pr.jung <pr.jung@samsung.com> | 2015-08-10 16:15:15 +0900 |
---|---|---|
committer | Taeyoung Kim <ty317.kim@samsung.com> | 2015-11-11 21:35:25 -0800 |
commit | ddb920c5e2266be117a52e5c918ca07ea9ae052f (patch) | |
tree | 094939e6ef899ce204500941508ad1676d524377 /src | |
parent | 53b6e23620df65cc75805e2740eb21c929d8d4b7 (diff) | |
download | libsvi-ddb920c5e2266be117a52e5c918ca07ea9ae052f.tar.gz libsvi-ddb920c5e2266be117a52e5c918ca07ea9ae052f.tar.bz2 libsvi-ddb920c5e2266be117a52e5c918ca07ea9ae052f.zip |
Lower vibration strength for SIP pattern
Change-Id: I3e8b53c34cec0cea96603309b9b185cb110368cf
Signed-off-by: pr.jung <pr.jung@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vibrator.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vibrator.c b/src/vibrator.c index 0b2cd50..c8036fc 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -55,6 +55,7 @@ enum haptic_iteration { #define METHOD_STOP "StopDevice" #define DEFAULT_DURATION 100 +#define SIP_DURATION 60 static int vibstatus; static unsigned int v_handle; @@ -233,6 +234,14 @@ static int get_priority(feedback_pattern_e pattern) return HAPTIC_PRIORITY_MIDDLE; } +static int get_duration(feedback_pattern_e pattern) +{ + if (pattern == FEEDBACK_PATTERN_SIP || pattern == FEEDBACK_PATTERN_SIP_BACKSPACE) + return SIP_DURATION; + + return DEFAULT_DURATION; +} + static void vibrator_init(void) { int ret; @@ -275,6 +284,7 @@ static int vibrator_play(feedback_pattern_e pattern) int size; int ret; int level; + int duration; if (!v_handle) { _E("Not initialize"); @@ -327,9 +337,11 @@ static int vibrator_play(feedback_pattern_e pattern) HAPTIC_ITERATION_ONCE, level, get_priority(pattern)); free(pbuf); - } else - ret = haptic_vibrate_monotone(v_handle, DEFAULT_DURATION, + } else { + duration = get_duration(pattern); + ret = haptic_vibrate_monotone(v_handle, duration, level, get_priority(pattern)); + } if (ret < 0) { _E("fail to play vibration"); |