revise close device function to don't stop effect in other processes
authorj-zero.hwang <j-zero.hwang@samsung.com>
Tue, 19 Mar 2013 08:26:48 +0000 (17:26 +0900)
committerj-zero.hwang <j-zero.hwang@samsung.com>
Tue, 19 Mar 2013 09:08:55 +0000 (18:08 +0900)
Change-Id: I667d38c50237fa1723d43eb359852c044e053077

packaging/haptic-module-tizen.spec
tizen/DEVICE/include/file.h
tizen/DEVICE/src/file.c
tizen/DEVICE/src/haptic_module_internal.c

index 24472ae..b2e5ed8 100644 (file)
@@ -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
index 6fa11db..54ced39 100644 (file)
@@ -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__
index 98bc613..47f3ec5 100644 (file)
@@ -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) {
index 186263c..4c9f45f 100644 (file)
@@ -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;
        }