From: j-zero.hwang Date: Tue, 19 Mar 2013 08:26:48 +0000 (+0900) Subject: revise close device function to don't stop effect in other processes X-Git-Tag: 2.1b_release~8 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fhaptic-module-tizen.git;a=commitdiff_plain;h=895939dffca8b70fff19b61b76877f94c786dd4b revise close device function to don't stop effect in other processes Change-Id: I667d38c50237fa1723d43eb359852c044e053077 --- 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; }