diff options
author | j-zero.hwang <j-zero.hwang@samsung.com> | 2013-03-19 17:26:48 +0900 |
---|---|---|
committer | j-zero.hwang <j-zero.hwang@samsung.com> | 2013-03-19 18:08:55 +0900 |
commit | 895939dffca8b70fff19b61b76877f94c786dd4b (patch) | |
tree | efd23c7b3b8c38d37c494c2a42d27c13d9e5c1b0 | |
parent | 672bf127a4207f6c3becf5fd73b5d4c1c3c576b2 (diff) | |
download | haptic-module-tizen-895939dffca8b70fff19b61b76877f94c786dd4b.tar.gz haptic-module-tizen-895939dffca8b70fff19b61b76877f94c786dd4b.tar.bz2 haptic-module-tizen-895939dffca8b70fff19b61b76877f94c786dd4b.zip |
revise close device function to don't stop effect in other processes
Change-Id: I667d38c50237fa1723d43eb359852c044e053077
-rw-r--r-- | packaging/haptic-module-tizen.spec | 2 | ||||
-rw-r--r-- | tizen/DEVICE/include/file.h | 1 | ||||
-rw-r--r-- | tizen/DEVICE/src/file.c | 7 | ||||
-rw-r--r-- | tizen/DEVICE/src/haptic_module_internal.c | 14 |
4 files changed, 13 insertions, 11 deletions
diff --git a/packaging/haptic-module-tizen.spec b/packaging/haptic-module-tizen.spec index 24472ae..b2e5ed8 100644 --- a/packaging/haptic-module-tizen.spec +++ b/packaging/haptic-module-tizen.spec @@ -2,7 +2,7 @@ Name: haptic-module-tizen Summary: Haptic Module library Version: 0.1.0 -Release: 8 +Release: 9 Group: System/Libraries License: APLv2 Source0: %{name}-%{version}.tar.gz diff --git a/tizen/DEVICE/include/file.h b/tizen/DEVICE/include/file.h index 6fa11db..54ced39 100644 --- a/tizen/DEVICE/include/file.h +++ b/tizen/DEVICE/include/file.h @@ -71,5 +71,6 @@ int GetHapticBufferDuration(const unsigned char *vibe_buffer, int *duration); int PlayHapticBuffer(const unsigned char *vibe_buffer, int iteration, int level, int *effect_handle); int OpenHapticDevice(void); int CloseHapticDevice(void); +int StopHaptic(void); #endif // __FIEL_H__ diff --git a/tizen/DEVICE/src/file.c b/tizen/DEVICE/src/file.c index 98bc613..47f3ec5 100644 --- a/tizen/DEVICE/src/file.c +++ b/tizen/DEVICE/src/file.c @@ -354,6 +354,13 @@ int PlayHapticBuffer(const unsigned char *vibe_buffer, int iteration, int level, return 0; } +int StopHaptic(void) +{ + __haptic_predefine_action(STOP_HAPTIC, NULL); + + return 0; +} + int CloseHapticDevice(void) { if (_cancel_thread() < 0) { diff --git a/tizen/DEVICE/src/haptic_module_internal.c b/tizen/DEVICE/src/haptic_module_internal.c index 186263c..4c9f45f 100644 --- a/tizen/DEVICE/src/haptic_module_internal.c +++ b/tizen/DEVICE/src/haptic_module_internal.c @@ -266,12 +266,6 @@ static int _close_device(int device_handle) return HAPTIC_MODULE_OPERATION_FAILED; } - status = SetHapticEnable(0); - if (status < 0) { - MODULE_ERROR("SetHapticEnable fail : %d", status); - return HAPTIC_MODULE_OPERATION_FAILED; - } - return HAPTIC_MODULE_ERROR_NONE; } @@ -393,9 +387,9 @@ static int _stop_effect(int device_handle, int effect_handle) if (effect_handle < 0) return HAPTIC_MODULE_INVALID_ARGUMENT; - status = SetHapticEnable(0); + status = StopHaptic(); if (status < 0) { - MODULE_ERROR("SetHapticEnable fail : %d", status); + MODULE_ERROR("StopHaptic fail : %d", status); return HAPTIC_MODULE_OPERATION_FAILED; } @@ -409,9 +403,9 @@ static int _stop_all_effects(int device_handle) if (device_handle < 0) return HAPTIC_MODULE_INVALID_ARGUMENT; - status = SetHapticEnable(0); + status = StopHaptic(); if (status < 0) { - MODULE_ERROR("SetHapticEnable fail : %d", status); + MODULE_ERROR("StopHaptic fail : %d", status); return HAPTIC_MODULE_OPERATION_FAILED; } |