feedback: Seperate codes between common and mobile profile 55/41055/1
authorJiyoung Yun <jy910.yun@samsung.com>
Mon, 16 Mar 2015 06:07:26 +0000 (15:07 +0900)
committertaeyoung <ty317.kim@samsung.com>
Thu, 11 Jun 2015 05:25:27 +0000 (14:25 +0900)
feedback-ids.h and feedback.h will be public api on Tizen v2.4.
If you need a specific enum for your profile,
you can make new file like feedback-ids-[PROFILE].h.

Change-Id: Iedcd7092866351a6c0b07fed3060b096e073973a
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Signed-off-by: taeyoung <ty317.kim@samsung.com>
119 files changed:
CMakeLists.txt
SLP_FEEDBACK_PG.h [deleted file]
common/data/sound.xml [new file with mode: 0644]
common/data/sound/operation/operation.wav [new file with mode: 0755]
common/data/sound/operation/shutter.wav [new file with mode: 0755]
common/data/sound/touch/key0.wav [new file with mode: 0755]
common/data/sound/touch/key1.wav [new file with mode: 0755]
common/data/sound/touch/key2.wav [new file with mode: 0755]
common/data/sound/touch/key3.wav [new file with mode: 0755]
common/data/sound/touch/key4.wav [new file with mode: 0755]
common/data/sound/touch/key5.wav [new file with mode: 0755]
common/data/sound/touch/key6.wav [new file with mode: 0755]
common/data/sound/touch/key7.wav [new file with mode: 0755]
common/data/sound/touch/key8.wav [new file with mode: 0755]
common/data/sound/touch/key9.wav [new file with mode: 0755]
common/data/sound/touch/keyasterisk.wav [new file with mode: 0755]
common/data/sound/touch/keysharp.wav [new file with mode: 0755]
common/data/sound/touch/sip.wav [new file with mode: 0755]
common/data/sound/touch/touch.wav [new file with mode: 0755]
common/src/check.c [new file with mode: 0644]
data/emulator/sound.xml [deleted file]
data/emulator/sound/operation/notification.ogg [deleted file]
data/emulator/sound/operation/power_on.ogg [deleted file]
data/emulator/sound/operation/ringtone.ogg [deleted file]
data/emulator/sound/operation/shutter.ogg [deleted file]
data/emulator/sound/operation/system.ogg [deleted file]
data/emulator/sound/touch/touch.ogg [deleted file]
data/emulator/vibration.xml [deleted file]
data/micro/sound.xml [deleted file]
data/micro/sound/operation/notification.ogg [deleted file]
data/micro/sound/operation/power_on.ogg [deleted file]
data/micro/sound/operation/ringtone.ogg [deleted file]
data/micro/sound/operation/shutter.ogg [deleted file]
data/micro/sound/operation/system.ogg [deleted file]
data/micro/sound/touch/touch.ogg [deleted file]
data/micro/vibration.xml [deleted file]
data/mobile/sound.xml [deleted file]
data/mobile/sound/operation/call_connect.wav [deleted file]
data/mobile/sound/operation/call_disconnect.wav [deleted file]
data/mobile/sound/operation/charger_connection.wav [deleted file]
data/mobile/sound/operation/fully_charged.wav [deleted file]
data/mobile/sound/operation/list_reorder.wav [deleted file]
data/mobile/sound/operation/lock.wav [deleted file]
data/mobile/sound/operation/low_battery.wav [deleted file]
data/mobile/sound/operation/minute_minder.wav [deleted file]
data/mobile/sound/operation/power_on.wav [deleted file]
data/mobile/sound/operation/shutter.wav [deleted file]
data/mobile/sound/operation/slider_sweep.wav [deleted file]
data/mobile/sound/operation/unlock.wav [deleted file]
data/mobile/sound/operation/volume_control.wav [deleted file]
data/mobile/sound/touch/key0.wav [deleted file]
data/mobile/sound/touch/key1.wav [deleted file]
data/mobile/sound/touch/key2.wav [deleted file]
data/mobile/sound/touch/key3.wav [deleted file]
data/mobile/sound/touch/key4.wav [deleted file]
data/mobile/sound/touch/key5.wav [deleted file]
data/mobile/sound/touch/key6.wav [deleted file]
data/mobile/sound/touch/key7.wav [deleted file]
data/mobile/sound/touch/key8.wav [deleted file]
data/mobile/sound/touch/key9.wav [deleted file]
data/mobile/sound/touch/keyasterisk.wav [deleted file]
data/mobile/sound/touch/keysharp.wav [deleted file]
data/mobile/sound/touch/sip.wav [deleted file]
data/mobile/sound/touch/sip_backspace.wav [deleted file]
data/mobile/sound/touch/touch.wav [deleted file]
data/mobile/vibration.xml [deleted file]
doc/feedback_doc.h
include/common.h [deleted file]
include/dbus.h [deleted file]
include/devices.h [deleted file]
include/feedback-ids.h
include/feedback-internal.h [new file with mode: 0644]
include/feedback.h
include/feedback_doc.h [deleted file]
include/log.h [deleted file]
include/xmlparser.h [deleted file]
mobile/data/sound.xml [new file with mode: 0644]
mobile/data/sound/operation/notification.wav [new file with mode: 0755]
mobile/data/sound/operation/operation.wav [new file with mode: 0755]
mobile/data/sound/operation/ringtone.wav [new file with mode: 0755]
mobile/data/sound/operation/shutter.wav [new file with mode: 0755]
mobile/data/sound/touch/key0.wav [new file with mode: 0755]
mobile/data/sound/touch/key1.wav [new file with mode: 0755]
mobile/data/sound/touch/key2.wav [new file with mode: 0755]
mobile/data/sound/touch/key3.wav [new file with mode: 0755]
mobile/data/sound/touch/key4.wav [new file with mode: 0755]
mobile/data/sound/touch/key5.wav [new file with mode: 0755]
mobile/data/sound/touch/key6.wav [new file with mode: 0755]
mobile/data/sound/touch/key7.wav [new file with mode: 0755]
mobile/data/sound/touch/key8.wav [new file with mode: 0755]
mobile/data/sound/touch/key9.wav [new file with mode: 0755]
mobile/data/sound/touch/keyasterisk.wav [new file with mode: 0755]
mobile/data/sound/touch/keysharp.wav [new file with mode: 0755]
mobile/data/sound/touch/sip.wav [new file with mode: 0755]
mobile/data/sound/touch/touch.wav [new file with mode: 0755]
mobile/include/feedback-ids-mobile.h [new file with mode: 0644]
mobile/src/check.c [new file with mode: 0644]
packaging/libfeedback.spec
src/common.h [new file with mode: 0644]
src/dbus.h [new file with mode: 0644]
src/devices.c
src/devices.h [new file with mode: 0644]
src/feedback.c
src/log.h [new file with mode: 0644]
src/profiles.c [new file with mode: 0644]
src/profiles.h [new file with mode: 0644]
src/sound.c
src/str.c [deleted file]
src/vibrator.c
src/xmlparser.h [new file with mode: 0644]
wearable/data/sound.xml [new file with mode: 0644]
wearable/data/sound/operation/notification.ogg [new file with mode: 0755]
wearable/data/sound/operation/power_on.ogg [new file with mode: 0755]
wearable/data/sound/operation/ringtone.ogg [new file with mode: 0755]
wearable/data/sound/operation/shutter.ogg [new file with mode: 0755]
wearable/data/sound/operation/system.ogg [new file with mode: 0755]
wearable/data/sound/touch/touch.ogg [new file with mode: 0755]
wearable/include/feedback-ids-wearable.h [new file with mode: 0644]
wearable/src/check.c [new file with mode: 0644]

index a6ffd2f974357b26b387cf48f8e19b9bc73c9697..c0a2084ff9a749acd90efef4851407d3a6cad0b8 100644 (file)
@@ -6,37 +6,29 @@ SET(EXEC_PREFIX "\${prefix}")
 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
 SET(VERSION 0.1.4)
 
-IF("${ARCH}" STREQUAL "emulator")
-       OPTION(USE_EMULATOR "Use Emulator" ON)
-ELSEIF("${ARCH}" STREQUAL "arm")
-       OPTION(USE_ARM "Use Arm" ON)
+IF("${PROFILE}" STREQUAL "")
+       SET(PROFILE "common")
 ENDIF()
-
-SET(FEEDBACK_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/data)
-IF(USE_EMULATOR)
-SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/emulator)
-ELSE(USE_EMULATOR)
-IF(MICRO_DD)
-SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/micro)
-ELSE(MICRO_DD)
-SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/mobile)
-ENDIF(MICRO_DD)
-ENDIF(USE_EMULATOR)
+SET(FEEDBACK_PROFILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${PROFILE})
 
 SET(SRCS
-       src/devices.c
        src/sound.c
        src/vibrator.c
+       src/devices.c
        src/xmlparser.c
        src/feedback.c
-       src/str.c
-       src/dbus.c)
+       src/dbus.c
+       ${FEEDBACK_PROFILE_PATH}/src/check.c)
 
 SET(HEADERS
-       SLP_FEEDBACK_PG.h
        include/feedback.h
        include/feedback-ids.h)
 
+IF(NOT "${PROFILE}" STREQUAL "common")
+       SET(HEADERS ${HEADERS}
+               ${FEEDBACK_PROFILE_PATH}/include/feedback-ids-${PROFILE}.h)
+ENDIF()
+
 SET(DEPENDENTS "vconf mm-keysound dlog libxml-2.0 glib-2.0 dbus-1")
 SET(PC_DEPENDENTS "capi-base-common")
 
@@ -45,6 +37,8 @@ SET(PC_REQUIRED ${PC_DEPENDENTS})
 SET(PC_LDFLAGS -l${PROJECT_NAME})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES(${FEEDBACK_PROFILE_PATH}/include)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED ${DEPENDENTS})
@@ -67,14 +61,5 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT Runtime
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-FOREACH(hfile ${HEADERS})
-       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
-ENDFOREACH(hfile)
-
-IF(MICRO_DD OR USE_EMULATOR)
-       INSTALL(DIRECTORY ${FEEDBACK_DATA_DIRS}/ DESTINATION share/${PROJECT_NAME})
-ELSE(MICRO_DD OR USE_EMULATOR)
-       INSTALL(DIRECTORY ${FEEDBACK_DATA_DIRS}/sound DESTINATION share/${PROJECT_NAME})
-       INSTALL(FILES ${FEEDBACK_DATA_DIRS}/sound.xml DESTINATION share/${PROJECT_NAME})
-       INSTALL(FILES ${FEEDBACK_DATA_DIRS}/vibration.xml DESTINATION share/${PROJECT_NAME})
-ENDIF(MICRO_DD OR USE_EMULATOR)
+INSTALL(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME})
+INSTALL(DIRECTORY ${FEEDBACK_PROFILE_PATH}/data/ DESTINATION share/${PROJECT_NAME})
diff --git a/SLP_FEEDBACK_PG.h b/SLP_FEEDBACK_PG.h
deleted file mode 100644 (file)
index b7006a2..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- *  libsvi
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Seokkyu Jang <seokkyu.jang@samsung.com>
- * Contact: Sangil Yoon <si83.yoon@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- *
- * @ingroup    SLP_PG
- * @defgroup    SVI_PG SVI
-@{
-
-@par SVI Programming Guide
-
-<h1 class="pg">Brief Information</h1>
-- Sound & Vibration UI
-- Convenient API
-- Header File : svi.h
-
-<h1 class="pg"> Introduction</h1>
-<h2 class="pg"> Purpose of this document</h2>
-The purpose of this document is to describe how applications can use Sound and Vibration Interface Library APIs.\n
-This document gives only programming guidelines to application engineers.
-
-<h2 class="pg"> Scope</h2>
-The scope of this document is limited to Samsung platform Sound and Vibration Interface Library API usage.
-
-<h1 class="pg"> Architecture</h1>
-<h2 class="pg"> Architecture overview</h2>
-Sound and Vibration Interface Library (SVI) is responsible for playing simple sound and vibration.\n
-SVI play sound using mm-sound library and play vibration with device framework.
-
-@image html svi.png "SVI diagram" 
-
-<h2 class="pg"> SLP Features</h2>
-Sound and Vibration Interface Library has the following features:\n
-
- - Play Sound
-       - It can play simple sound with predefined key.
-
- - Play Vibration
-       - It can play simple vibration with predefined key.
-
-<h2 class="pg">API list and description</h2>
- - int svi_init(int *handle)
-       - Unload sound profile and status, and close haptic device.
-
- - int svi_fini(int handle)
-       - Finalize audio ui library.
-       - Unload sound profile and status, and close haptic device.
-
- - int svi_play_sound(int handle, sound_type sound_key)
-       - Play simple sound.
-
- - int svi_play_vib(int handle, vibration_type vibration_key)
-       - Play simple vibration.
-
- - int svi_play(int handle, vibration_type vibration_key, sound_type sound_key)
-       - Play simple sound and vibration.
-
-<h1 class="pg">Programming with Sound & Vibration UI</h1>
-
-<h2 class="pg">Defines</h2>
-@code
-#define SVI_SUCCESS    0
-#define SVI_ERROR      -1
-@endcode
-
-<h2 class="pg">Functions</h2>
-@code
-int svi_init(int *handle)
-int svi_fini(int handle)
-int svi_play_sound(int handle, sound_type sound_key)
-int svi_play_vib(int handle, vibration_type vibration_key)
-int svi_play(int handle, vibration_type vibration_key, sound_type sound_key)
-@endcode
-
-<h2 class="pg">Example code</h2>
-@code
-#include <svi.h>
-
-int r = 0;
-int handle = 0;
-
-r = svi_init(&handle);
-if (r != SVI_SUCCESS){
-
-       printf("Cannot initialize svi.\n");     
-
-} else {
-
-       r = svi_play (handle, SVI_VIB_TOUCH, SVI_SND_TOUCH1);
-       if (r != SVI_SUCCESS) {
-               printf("Cannot play sound or vibration.\n");
-       }
-
-       r = svi_play_sound (handle, SVI_SND_TOUCH1);
-       if (r != SVI_SUCCESS) {
-               printf("Cannot play sound.\n");
-       }
-
-       r = svi_play_vib (handle, SVI_VIB_TOUCH);
-       if (r != SVI_SUCCESS) {
-               printf("Cannot play vibration.\n");
-       }
-
-       r = svi_fini(handle);
-       if (r != SVI_SUCCESS) {
-               printf("Cannot close svi.\n");  
-       }
-}
-@endcode
-
-<h2 class="pg">Vibration IDs</h2>
-@code
-       SVI_VIB_TOUCH_TOUCH
-       SVI_VIB_TOUCH_SIP
-       SVI_VIB_TOUCH_HOLD
-       SVI_VIB_TOUCH_MULTI_TAP
-       SVI_VIB_TOUCH_HW_TAP
-       SVI_VIB_TOUCH_HW_HOLD
-       SVI_VIB_TOUCH_KEY00
-       SVI_VIB_TOUCH_KEY01
-       SVI_VIB_TOUCH_KEY02
-       SVI_VIB_TOUCH_KEY03
-       SVI_VIB_TOUCH_KEY04
-       SVI_VIB_TOUCH_KEY05
-       SVI_VIB_TOUCH_KEY06
-       SVI_VIB_TOUCH_KEY07
-       SVI_VIB_TOUCH_KEY08
-       SVI_VIB_TOUCH_KEY09
-       SVI_VIB_TOUCH_KEY_STAR
-       SVI_VIB_TOUCH_KEY_SHARP
-       SVI_VIB_NOTIFICATION_INCOMING_CALL01
-       SVI_VIB_NOTIFICATION_INCOMING_CALL02
-       SVI_VIB_NOTIFICATION_INCOMING_CALL03
-       SVI_VIB_NOTIFICATION_MESSAGE
-       SVI_VIB_NOTIFICATION_EMAIL
-       SVI_VIB_NOTIFICATION_WAKEUP
-       SVI_VIB_NOTIFICATION_SCHEDULE
-       SVI_VIB_NOTIFICATION_TIMER
-       SVI_VIB_NOTIFICATION_GENERAL
-       SVI_VIB_OPERATION_POWER_ON
-       SVI_VIB_OPERATION_POWER_OFF
-       SVI_VIB_OPERATION_CHARGERCONN
-       SVI_VIB_OPERATION_FULLCHARGED
-       SVI_VIB_OPERATION_LOWBATT
-       SVI_VIB_OPERATION_LOCK
-       SVI_VIB_OPERATION_UNLOCK
-       SVI_VIB_OPERATION_LOCK_SWIPE
-       SVI_VIB_OPERATION_UNLOCK_SWIPE
-       SVI_VIB_OPERATION_CALLCONNECT
-       SVI_VIB_OPERATION_DISCALLCONNECT
-       SVI_VIB_OPERATION_MINUTEMINDER
-       SVI_VIB_OPERATION_VIBRATION
-       SVI_VIB_OPERATION_NEWCHAT
-       SVI_VIB_OPERATION_SENDCHAT
-       SVI_VIB_OPERATION_ONOFFSLIDER
-       SVI_VIB_OPERATION_SHUTTER
-       SVI_VIB_OPERATION_HOURLY_ALERT
-@endcode
-
-<h2 class="pg">Sound IDs</h2>
-@code
-       SVI_SND_TOUCH_TOUCH1
-       SVI_SND_TOUCH_TOUCH2
-       SVI_SND_TOUCH_TOUCH3
-       SVI_SND_TOUCH_SIP
-       SVI_SND_TOUCH_HOLD
-       SVI_SND_TOUCH_MULTI_TAP
-       SVI_SND_TOUCH_HW_TAP
-       SVI_SND_TOUCH_HW_HOLD
-       SVI_SND_TOUCH_KEY00
-       SVI_SND_TOUCH_KEY01
-       SVI_SND_TOUCH_KEY02
-       SVI_SND_TOUCH_KEY03
-       SVI_SND_TOUCH_KEY04
-       SVI_SND_TOUCH_KEY05
-       SVI_SND_TOUCH_KEY06
-       SVI_SND_TOUCH_KEY07
-       SVI_SND_TOUCH_KEY08
-       SVI_SND_TOUCH_KEY09
-       SVI_SND_TOUCH_KEY_STAR
-       SVI_SND_TOUCH_KEY_SHARP
-       SVI_SND_OPERATION_POWERON
-       SVI_SND_OPERATION_POWEROF
-       SVI_SND_OPERATION_CHARGERCONN
-       SVI_SND_OPERATION_FULLCHARGED
-       SVI_SND_OPERATION_LOWBATT
-       SVI_SND_OPERATION_LOCK
-       SVI_SND_OPERATION_UNLOCK
-       SVI_SND_OPERATION_LOCK_SWIPE
-       SVI_SND_OPERATION_UNLOCK_SWIPE
-       SVI_SND_OPERATION_CALLCONN
-       SVI_SND_OPERATION_CALLDISCONN
-       SVI_SND_OPERATION_MINUTE_MINDER
-       SVI_SND_OPERATION_VIBRATION
-       SVI_SND_OPERATION_NEWCHAT
-       SVI_SND_OPERATION_SENTCHAT
-       SVI_SND_OPERATION_ONOFFSLIDER
-       SVI_SND_OPERATION_SCRCAPTURE
-       SVI_SND_OPERATION_HOURLY_ALERT
-@endcode
-
-*/
-
-/**
-@}
-*/
diff --git a/common/data/sound.xml b/common/data/sound.xml
new file mode 100644 (file)
index 0000000..72f4f77
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<config>
+       <label>svi-data</label>
+       <description>Sound Resource</description>
+       <sound>
+               <label>FEEDBACK_PATTERN_TAP</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SIP</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY0</label>
+               <data>/usr/share/feedback/sound/touch/key0.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY1</label>
+               <data>/usr/share/feedback/sound/touch/key1.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY2</label>
+               <data>/usr/share/feedback/sound/touch/key2.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY3</label>
+               <data>/usr/share/feedback/sound/touch/key3.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY4</label>
+               <data>/usr/share/feedback/sound/touch/key4.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY5</label>
+               <data>/usr/share/feedback/sound/touch/key5.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY6</label>
+               <data>/usr/share/feedback/sound/touch/key6.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY7</label>
+               <data>/usr/share/feedback/sound/touch/key7.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY8</label>
+               <data>/usr/share/feedback/sound/touch/key8.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY9</label>
+               <data>/usr/share/feedback/sound/touch/key9.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_STAR</label>
+               <data>/usr/share/feedback/sound/touch/keyasterisk.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
+               <data>/usr/share/feedback/sound/touch/keysharp.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_BACK</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_HW_TAP</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_POWERON</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LOWBATT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_UNLOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LIST_REORDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LIST_SLIDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_FUNCTION</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_FJKEY</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_MAX_CHARACTER</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_LOCK_SWIPE</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_UNLOCK_SWIPE</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_GEOMETRIC_LOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_CALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_DISCALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_MINUTEMINDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE</label>
+               <data>/usr/share/feedback/sound/operation/shutter.wav</data>
+       </sound>
+</config>
diff --git a/common/data/sound/operation/operation.wav b/common/data/sound/operation/operation.wav
new file mode 100755 (executable)
index 0000000..5383bdf
Binary files /dev/null and b/common/data/sound/operation/operation.wav differ
diff --git a/common/data/sound/operation/shutter.wav b/common/data/sound/operation/shutter.wav
new file mode 100755 (executable)
index 0000000..9dea92b
Binary files /dev/null and b/common/data/sound/operation/shutter.wav differ
diff --git a/common/data/sound/touch/key0.wav b/common/data/sound/touch/key0.wav
new file mode 100755 (executable)
index 0000000..e2cd877
Binary files /dev/null and b/common/data/sound/touch/key0.wav differ
diff --git a/common/data/sound/touch/key1.wav b/common/data/sound/touch/key1.wav
new file mode 100755 (executable)
index 0000000..fa77cf4
Binary files /dev/null and b/common/data/sound/touch/key1.wav differ
diff --git a/common/data/sound/touch/key2.wav b/common/data/sound/touch/key2.wav
new file mode 100755 (executable)
index 0000000..53da84c
Binary files /dev/null and b/common/data/sound/touch/key2.wav differ
diff --git a/common/data/sound/touch/key3.wav b/common/data/sound/touch/key3.wav
new file mode 100755 (executable)
index 0000000..ede9a2b
Binary files /dev/null and b/common/data/sound/touch/key3.wav differ
diff --git a/common/data/sound/touch/key4.wav b/common/data/sound/touch/key4.wav
new file mode 100755 (executable)
index 0000000..105bddc
Binary files /dev/null and b/common/data/sound/touch/key4.wav differ
diff --git a/common/data/sound/touch/key5.wav b/common/data/sound/touch/key5.wav
new file mode 100755 (executable)
index 0000000..a34b4d0
Binary files /dev/null and b/common/data/sound/touch/key5.wav differ
diff --git a/common/data/sound/touch/key6.wav b/common/data/sound/touch/key6.wav
new file mode 100755 (executable)
index 0000000..34a8bec
Binary files /dev/null and b/common/data/sound/touch/key6.wav differ
diff --git a/common/data/sound/touch/key7.wav b/common/data/sound/touch/key7.wav
new file mode 100755 (executable)
index 0000000..3b845a4
Binary files /dev/null and b/common/data/sound/touch/key7.wav differ
diff --git a/common/data/sound/touch/key8.wav b/common/data/sound/touch/key8.wav
new file mode 100755 (executable)
index 0000000..2a05528
Binary files /dev/null and b/common/data/sound/touch/key8.wav differ
diff --git a/common/data/sound/touch/key9.wav b/common/data/sound/touch/key9.wav
new file mode 100755 (executable)
index 0000000..80699c8
Binary files /dev/null and b/common/data/sound/touch/key9.wav differ
diff --git a/common/data/sound/touch/keyasterisk.wav b/common/data/sound/touch/keyasterisk.wav
new file mode 100755 (executable)
index 0000000..9ec2e71
Binary files /dev/null and b/common/data/sound/touch/keyasterisk.wav differ
diff --git a/common/data/sound/touch/keysharp.wav b/common/data/sound/touch/keysharp.wav
new file mode 100755 (executable)
index 0000000..ce7cd88
Binary files /dev/null and b/common/data/sound/touch/keysharp.wav differ
diff --git a/common/data/sound/touch/sip.wav b/common/data/sound/touch/sip.wav
new file mode 100755 (executable)
index 0000000..5b44d12
Binary files /dev/null and b/common/data/sound/touch/sip.wav differ
diff --git a/common/data/sound/touch/touch.wav b/common/data/sound/touch/touch.wav
new file mode 100755 (executable)
index 0000000..1ec9de4
Binary files /dev/null and b/common/data/sound/touch/touch.wav differ
diff --git a/common/src/check.c b/common/src/check.c
new file mode 100644 (file)
index 0000000..b6a70e2
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * libfeedback
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+
+#include "feedback.h"
+#include "profiles.h"
+#include "log.h"
+
+
+static const char *common_str_type[] =
+{
+       "FEEDBACK_TYPE_NONE",
+       "FEEDBACK_TYPE_SOUND",
+       "FEEDBACK_TYPE_VIBRATION",
+};
+
+static const char *common_str_pattern[] =
+{
+       "FEEDBACK_PATTERN_TAP",
+       "FEEDBACK_PATTERN_SIP",
+       "FEEDBACK_PATTERN_KEY0",
+       "FEEDBACK_PATTERN_KEY1",
+       "FEEDBACK_PATTERN_KEY2",
+       "FEEDBACK_PATTERN_KEY3",
+       "FEEDBACK_PATTERN_KEY4",
+       "FEEDBACK_PATTERN_KEY5",
+       "FEEDBACK_PATTERN_KEY6",
+       "FEEDBACK_PATTERN_KEY7",
+       "FEEDBACK_PATTERN_KEY8",
+       "FEEDBACK_PATTERN_KEY9",
+       "FEEDBACK_PATTERN_KEY_STAR",
+       "FEEDBACK_PATTERN_KEY_SHARP",
+       "FEEDBACK_PATTERN_KEY_BACK",
+       "FEEDBACK_PATTERN_HOLD",
+       "FEEDBACK_PATTERN_HW_TAP",
+       "FEEDBACK_PATTERN_HW_HOLD",
+
+       "FEEDBACK_PATTERN_MESSAGE",
+       "FEEDBACK_PATTERN_EMAIL",
+       "FEEDBACK_PATTERN_WAKEUP",
+       "FEEDBACK_PATTERN_SCHEDULE",
+       "FEEDBACK_PATTERN_TIMER",
+       "FEEDBACK_PATTERN_GENERAL",
+
+       "FEEDBACK_PATTERN_POWERON",
+       "FEEDBACK_PATTERN_POWEROFF",
+       "FEEDBACK_PATTERN_CHARGERCONN",
+       "FEEDBACK_PATTERN_CHARGING_ERROR",
+       "FEEDBACK_PATTERN_FULLCHARGED",
+       "FEEDBACK_PATTERN_LOWBATT",
+       "FEEDBACK_PATTERN_LOCK",
+       "FEEDBACK_PATTERN_UNLOCK",
+       "FEEDBACK_PATTERN_VIBRATION_ON",
+       "FEEDBACK_PATTERN_SILENT_OFF",
+       "FEEDBACK_PATTERN_BT_CONNECTED",
+       "FEEDBACK_PATTERN_BT_DISCONNECTED",
+       "FEEDBACK_PATTERN_LIST_REORDER",
+       "FEEDBACK_PATTERN_LIST_SLIDER",
+       "FEEDBACK_PATTERN_VOLUME_KEY",
+};
+
+static bool common_get_always_alert_case(int type, int pattern)
+{
+       switch (pattern) {
+       case FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_TIMER:
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WAKEUP:
+               return true;
+       default:
+               break;
+       }
+       return false;
+}
+
+static bool common_get_always_off_case(int type, int pattern)
+{
+       switch (pattern) {
+       case FEEDBACK_PATTERN_TAP ... FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_HOLD ... FEEDBACK_PATTERN_HW_HOLD:
+               if (CHECK_SOUND(type) && !is_touch_sndstatus())
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
+               if (CHECK_SOUND(type) && !is_keytone_sndstatus())
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
+
+static int common_get_strength_type(int type, int pattern)
+{
+       if (CHECK_SOUND(type)) {
+               if (pattern == FEEDBACK_PATTERN_TAP)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_TOUCH;
+               else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_BACK)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_DIALER;
+               else if (pattern == FEEDBACK_PATTERN_VOLUME_KEY)
+                       return VOLUME_TYPE_RINGTONE;
+               else
+                       return VOLUME_TYPE_SYSTEM;
+       } else if (CHECK_VIBRATION(type)) {
+               return DEFAULT_VIB_LEVEL * HAPTIC_FEEDBACK_STEP;
+       }
+
+       return -EINVAL;
+}
+
+static const struct profile_ops common_profile_ops = {
+       .profile               = "common",
+       .get_always_alert_case = common_get_always_alert_case,
+       .get_always_off_case   = common_get_always_off_case,
+       .get_strength_type     = common_get_strength_type,
+       .max_type              = FEEDBACK_TYPE_END,
+       .max_pattern           = FEEDBACK_PATTERN_END,
+       .str_type              = common_str_type,
+       .str_pattern           = common_str_pattern,
+};
+
+PROFILE_OPS_REGISTER(&common_profile_ops);
diff --git a/data/emulator/sound.xml b/data/emulator/sound.xml
deleted file mode 100644 (file)
index fa8c279..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Sound Resource</description>
-       <sound>
-               <label>FEEDBACK_PATTERN_TAP</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY0</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY1</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY2</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY3</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY4</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY5</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY6</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY7</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY8</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY9</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_STAR</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_BACK</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_POWERON</label>
-               <data>/usr/share/feedback/sound/operation/power_on.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOCK</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_UNLOCK</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SCREEN_CAPTURE</label>
-               <data>/usr/share/feedback/sound/operation/shutter.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_HOURLY_ALERT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SAFETY_ALERT</label>
-               <data>/usr/share/feedback/sound/operation/ringtone.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SAFETY_LOW_POWER</label>
-               <data>/usr/share/feedback/sound/operation/ringtone.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CMAS</label>
-               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
-       </sound>
-</config>
diff --git a/data/emulator/sound/operation/notification.ogg b/data/emulator/sound/operation/notification.ogg
deleted file mode 100755 (executable)
index 457f7e8..0000000
Binary files a/data/emulator/sound/operation/notification.ogg and /dev/null differ
diff --git a/data/emulator/sound/operation/power_on.ogg b/data/emulator/sound/operation/power_on.ogg
deleted file mode 100755 (executable)
index 7756406..0000000
Binary files a/data/emulator/sound/operation/power_on.ogg and /dev/null differ
diff --git a/data/emulator/sound/operation/ringtone.ogg b/data/emulator/sound/operation/ringtone.ogg
deleted file mode 100755 (executable)
index 2653dd6..0000000
Binary files a/data/emulator/sound/operation/ringtone.ogg and /dev/null differ
diff --git a/data/emulator/sound/operation/shutter.ogg b/data/emulator/sound/operation/shutter.ogg
deleted file mode 100755 (executable)
index c22c810..0000000
Binary files a/data/emulator/sound/operation/shutter.ogg and /dev/null differ
diff --git a/data/emulator/sound/operation/system.ogg b/data/emulator/sound/operation/system.ogg
deleted file mode 100755 (executable)
index 69c8425..0000000
Binary files a/data/emulator/sound/operation/system.ogg and /dev/null differ
diff --git a/data/emulator/sound/touch/touch.ogg b/data/emulator/sound/touch/touch.ogg
deleted file mode 100755 (executable)
index 8be60ce..0000000
Binary files a/data/emulator/sound/touch/touch.ogg and /dev/null differ
diff --git a/data/emulator/vibration.xml b/data/emulator/vibration.xml
deleted file mode 100644 (file)
index 09887c2..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Vibration Resource</description>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TAP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HOLD</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MESSAGE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MESSAGE_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_EMAIL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_EMAIL_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_WAKEUP</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_WAKEUP_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SCHEDULE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SCHEDULE_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TIMER</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TIMER_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GENERAL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GENERAL_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CALLCONNECT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_VIBRATION_ON</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CONNECTED</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_DISCONNECTED</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_BT_PAIRING</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SAFETY_ALERT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SEND_SOS_MESSAGE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_END_SOS_MESSAGE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CMAS</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SPEED_UP</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SLOW_DOWN</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEEP_THIS_PACE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GOAL_ACHIEVED</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_EXERCISE_COUNT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_START_CUE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SUCCESS</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_FAILURE</label>
-               <data>SYSTEM</data>
-       </vibration>
-</config>
diff --git a/data/micro/sound.xml b/data/micro/sound.xml
deleted file mode 100644 (file)
index 2ff9be9..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Sound Resource</description>
-       <sound>
-               <label>FEEDBACK_PATTERN_TAP</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_BACKSPACE</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_FUNCTION</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_FJKEY</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY0</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY1</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY2</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY3</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY4</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY5</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY6</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY7</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY8</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY9</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_STAR</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_BACK</label>
-               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_WAKEUP_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SCHEDULE_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_TIMER_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_POWERON</label>
-               <data>/usr/share/feedback/sound/operation/power_on.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_BT_CONNECTED</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_BT_DISCONNECTED</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_BT_PAIRING</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_BT_WAITING</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SCREEN_CAPTURE</label>
-               <data>/usr/share/feedback/sound/operation/shutter.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SAFETY_ALERT</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SAFETY_LOW_POWER</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CMAS</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_GOAL_ACHIEVED</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_MEASURING_SUCCESS</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_MEASURING_FAILURE</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_UV_PROCESSING</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SHEALTH_START</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SHEALTH_PAUSE</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SHEALTH_STOP</label>
-               <data>/usr/share/feedback/sound/operation/system.ogg</data>
-       </sound>
-</config>
diff --git a/data/micro/sound/operation/notification.ogg b/data/micro/sound/operation/notification.ogg
deleted file mode 100755 (executable)
index 457f7e8..0000000
Binary files a/data/micro/sound/operation/notification.ogg and /dev/null differ
diff --git a/data/micro/sound/operation/power_on.ogg b/data/micro/sound/operation/power_on.ogg
deleted file mode 100755 (executable)
index 7756406..0000000
Binary files a/data/micro/sound/operation/power_on.ogg and /dev/null differ
diff --git a/data/micro/sound/operation/ringtone.ogg b/data/micro/sound/operation/ringtone.ogg
deleted file mode 100755 (executable)
index 2653dd6..0000000
Binary files a/data/micro/sound/operation/ringtone.ogg and /dev/null differ
diff --git a/data/micro/sound/operation/shutter.ogg b/data/micro/sound/operation/shutter.ogg
deleted file mode 100755 (executable)
index c22c810..0000000
Binary files a/data/micro/sound/operation/shutter.ogg and /dev/null differ
diff --git a/data/micro/sound/operation/system.ogg b/data/micro/sound/operation/system.ogg
deleted file mode 100755 (executable)
index 69c8425..0000000
Binary files a/data/micro/sound/operation/system.ogg and /dev/null differ
diff --git a/data/micro/sound/touch/touch.ogg b/data/micro/sound/touch/touch.ogg
deleted file mode 100755 (executable)
index 8be60ce..0000000
Binary files a/data/micro/sound/touch/touch.ogg and /dev/null differ
diff --git a/data/micro/vibration.xml b/data/micro/vibration.xml
deleted file mode 100644 (file)
index 80a5849..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Vibration Resource</description>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_BACKSPACE</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_FUNCTION</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_FJKEY</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HOLD</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_STAR</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_BACK</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_WAKEUP</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SCHEDULE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TIMER</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GENERAL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_3RD_APPLICATION</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CALLCONNECT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_VIBRATION_ON</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_BT_CONNECTED</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_BT_DISCONNECTED</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_BT_PAIRING</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_BT_WAITING</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SAFETY_ALERT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SEND_SOS_MESSAGE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_END_SOS_MESSAGE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CMAS</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SPEED_UP</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SLOW_DOWN</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEEP_THIS_PACE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GOAL_ACHIEVED</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_START_CUE</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HEALTH_PACE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_INACTIVE_TIME</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MEASURING_SUCCESS</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MEASURING_FAILURE</label>
-               <data>SYSTEM</data>
-       </vibration>
-</config>
diff --git a/data/mobile/sound.xml b/data/mobile/sound.xml
deleted file mode 100755 (executable)
index d5738b8..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Sound Resource</description>
-       <sound>
-               <label>FEEDBACK_PATTERN_TAP</label>
-               <data>/usr/share/feedback/sound/touch/touch.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP</label>
-               <data>/usr/share/feedback/sound/touch/sip.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_BACKSPACE</label>
-               <data>/usr/share/feedback/sound/touch/sip_backspace.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_FUNCTION</label>
-               <data>/usr/share/feedback/sound/touch/sip.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SIP_FJKEY</label>
-               <data>/usr/share/feedback/sound/touch/sip.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_MAX_CHARACTER</label>
-               <data>/usr/share/feedback/sound/touch/sip.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY0</label>
-               <data>/usr/share/feedback/sound/touch/key0.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY1</label>
-               <data>/usr/share/feedback/sound/touch/key1.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY2</label>
-               <data>/usr/share/feedback/sound/touch/key2.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY3</label>
-               <data>/usr/share/feedback/sound/touch/key3.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY4</label>
-               <data>/usr/share/feedback/sound/touch/key4.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY5</label>
-               <data>/usr/share/feedback/sound/touch/key5.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY6</label>
-               <data>/usr/share/feedback/sound/touch/key6.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY7</label>
-               <data>/usr/share/feedback/sound/touch/key7.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY8</label>
-               <data>/usr/share/feedback/sound/touch/key8.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY9</label>
-               <data>/usr/share/feedback/sound/touch/key9.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_STAR</label>
-               <data>/usr/share/feedback/sound/touch/keyasterisk.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
-               <data>/usr/share/feedback/sound/touch/keysharp.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_KEY_BACK</label>
-               <data>/usr/share/feedback/sound/touch/touch.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_HW_TAP</label>
-               <data>/usr/share/feedback/sound/touch/touch.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_POWERON</label>
-               <data>/usr/share/feedback/sound/operation/power_on.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>/usr/share/feedback/sound/operation/charger_connection.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/charger_connection.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>/usr/share/feedback/sound/operation/low_battery.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
-               <data>/usr/share/feedback/sound/operation/low_battery.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOCK</label>
-               <data>/usr/share/feedback/sound/operation/lock.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_UNLOCK</label>
-               <data>/usr/share/feedback/sound/operation/unlock.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LOCK_SWIPE</label>
-               <data>/usr/share/feedback/sound/operation/lock.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_UNLOCK_SWIPE</label>
-               <data>/usr/share/feedback/sound/operation/unlock.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_GEOMETRIC_LOCK</label>
-               <data>/usr/share/feedback/sound/operation/lock.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_CALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/call_connect.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_DISCALLCONNECT</label>
-               <data>/usr/share/feedback/sound/operation/call_disconnect.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_MINUTEMINDER</label>
-               <data>/usr/share/feedback/sound/operation/minute_minder.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
-               <data>/usr/share/feedback/sound/operation/volume_control.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_SCREEN_CAPTURE</label>
-               <data>/usr/share/feedback/sound/operation/shutter.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LIST_REORDER</label>
-               <data>/usr/share/feedback/sound/operation/list_reorder.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_LIST_SLIDER</label>
-               <data>/usr/share/feedback/sound/operation/slider_sweep.wav</data>
-       </sound>
-       <sound>
-               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
-               <data>/usr/share/feedback/sound/operation/volume_control.wav</data>
-       </sound>
-</config>
diff --git a/data/mobile/sound/operation/call_connect.wav b/data/mobile/sound/operation/call_connect.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/call_connect.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/call_disconnect.wav b/data/mobile/sound/operation/call_disconnect.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/call_disconnect.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/charger_connection.wav b/data/mobile/sound/operation/charger_connection.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/charger_connection.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/fully_charged.wav b/data/mobile/sound/operation/fully_charged.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/fully_charged.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/list_reorder.wav b/data/mobile/sound/operation/list_reorder.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/list_reorder.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/lock.wav b/data/mobile/sound/operation/lock.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/lock.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/low_battery.wav b/data/mobile/sound/operation/low_battery.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/low_battery.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/minute_minder.wav b/data/mobile/sound/operation/minute_minder.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/minute_minder.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/power_on.wav b/data/mobile/sound/operation/power_on.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/power_on.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/shutter.wav b/data/mobile/sound/operation/shutter.wav
deleted file mode 100755 (executable)
index 9dea92b..0000000
Binary files a/data/mobile/sound/operation/shutter.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/slider_sweep.wav b/data/mobile/sound/operation/slider_sweep.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/slider_sweep.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/unlock.wav b/data/mobile/sound/operation/unlock.wav
deleted file mode 100755 (executable)
index 5383bdf..0000000
Binary files a/data/mobile/sound/operation/unlock.wav and /dev/null differ
diff --git a/data/mobile/sound/operation/volume_control.wav b/data/mobile/sound/operation/volume_control.wav
deleted file mode 100755 (executable)
index 1ec9de4..0000000
Binary files a/data/mobile/sound/operation/volume_control.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key0.wav b/data/mobile/sound/touch/key0.wav
deleted file mode 100755 (executable)
index e2cd877..0000000
Binary files a/data/mobile/sound/touch/key0.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key1.wav b/data/mobile/sound/touch/key1.wav
deleted file mode 100755 (executable)
index fa77cf4..0000000
Binary files a/data/mobile/sound/touch/key1.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key2.wav b/data/mobile/sound/touch/key2.wav
deleted file mode 100755 (executable)
index 53da84c..0000000
Binary files a/data/mobile/sound/touch/key2.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key3.wav b/data/mobile/sound/touch/key3.wav
deleted file mode 100755 (executable)
index ede9a2b..0000000
Binary files a/data/mobile/sound/touch/key3.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key4.wav b/data/mobile/sound/touch/key4.wav
deleted file mode 100755 (executable)
index 105bddc..0000000
Binary files a/data/mobile/sound/touch/key4.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key5.wav b/data/mobile/sound/touch/key5.wav
deleted file mode 100755 (executable)
index a34b4d0..0000000
Binary files a/data/mobile/sound/touch/key5.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key6.wav b/data/mobile/sound/touch/key6.wav
deleted file mode 100755 (executable)
index 34a8bec..0000000
Binary files a/data/mobile/sound/touch/key6.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key7.wav b/data/mobile/sound/touch/key7.wav
deleted file mode 100755 (executable)
index 3b845a4..0000000
Binary files a/data/mobile/sound/touch/key7.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key8.wav b/data/mobile/sound/touch/key8.wav
deleted file mode 100755 (executable)
index 2a05528..0000000
Binary files a/data/mobile/sound/touch/key8.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/key9.wav b/data/mobile/sound/touch/key9.wav
deleted file mode 100755 (executable)
index 80699c8..0000000
Binary files a/data/mobile/sound/touch/key9.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/keyasterisk.wav b/data/mobile/sound/touch/keyasterisk.wav
deleted file mode 100755 (executable)
index 9ec2e71..0000000
Binary files a/data/mobile/sound/touch/keyasterisk.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/keysharp.wav b/data/mobile/sound/touch/keysharp.wav
deleted file mode 100755 (executable)
index ce7cd88..0000000
Binary files a/data/mobile/sound/touch/keysharp.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/sip.wav b/data/mobile/sound/touch/sip.wav
deleted file mode 100755 (executable)
index 5b44d12..0000000
Binary files a/data/mobile/sound/touch/sip.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/sip_backspace.wav b/data/mobile/sound/touch/sip_backspace.wav
deleted file mode 100755 (executable)
index 5b44d12..0000000
Binary files a/data/mobile/sound/touch/sip_backspace.wav and /dev/null differ
diff --git a/data/mobile/sound/touch/touch.wav b/data/mobile/sound/touch/touch.wav
deleted file mode 100755 (executable)
index 1ec9de4..0000000
Binary files a/data/mobile/sound/touch/touch.wav and /dev/null differ
diff --git a/data/mobile/vibration.xml b/data/mobile/vibration.xml
deleted file mode 100644 (file)
index 8221ffa..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<config>
-       <label>svi-data</label>
-       <description>Vibration Resource</description>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_BACKSPACE</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_FUNCTION</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SIP_FJKEY</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MAX_CHARACTER</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY0</label>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY1</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY2</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY3</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY4</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY5</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY6</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY7</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY8</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY9</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_STAR</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_KEY_BACK</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HOLD</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MULTI_TAP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HW_TAP</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HW_HOLD</label>
-               <data>TOUCH</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MESSAGE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MESSAGE_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_EMAIL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_EMAIL_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_WAKEUP</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_WAKEUP_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SCHEDULE</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SCHEDULE_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TIMER</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_TIMER_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GENERAL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_GENERAL_ON_CALL</label>
-               <data>NOTIFICATION</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SMART_ALERT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_POWERON</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_POWEROFF</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_CHARGERCONN_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_LOWBATT_ON_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_OUTGOING_CALL</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MINUTEMINDER</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_VIBRATION_ON</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_MMS</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_HOURLY_ALERT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SAFETY_ALERT</label>
-               <data>SYSTEM</data>
-       </vibration>
-       <vibration>
-               <label>FEEDBACK_PATTERN_SEND_SOS_MESSAGE</label>
-               <data>SYSTEM</data>
-       </vibration>
-</config>
index 0b0131e80e09281bff7152d4ec5926c703aeb11c..ef3b17f0f8aeea0f51f6e1f23709370c7642895a 100755 (executable)
  *   \#include <feedback.h>
  *
  * @section CAPI_SYSTEM_FEEDBACK_MODULE_OVERVIEW Overview
- * The FEEDBACK API provides functions to play sound or vibration associated with properties.
- * @section CAPI_SYSTEM_FEEDBACK_MODULE_FEATURE Related Features
- * This API is related with the following features:\n
- * - http://developer.samsung.com/tizen/feature/haptic\n
- *
- * It is recommended to design feature related codes in your application for reliability.\n
- *
- * You can check if a devrice supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
- *
- * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
- *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * The FEEDBACK API is responsible for playing simple sound and vibration.
+ * It plays sound using mm-sound library and vibration with system framework.
  *
  */
 
diff --git a/include/common.h b/include/common.h
deleted file mode 100644 (file)
index 71fa321..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file common.h
- * @brief This file contains the common information
- */
-
-#define FEEDBACK_DATA_DIR                      "/opt/usr/share/feedback"
-#define FEEDBACK_ORIGIN_DATA_DIR       "/usr/share/feedback"
-
-#define FEEDBACK_RETRY_CNT       1
-
-extern int callstatus;
-extern int alert_callstatus;
-
-extern const char *str_type[];
-extern const char *str_pattern[];
-
-int is_sound_mode(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/include/dbus.h b/include/dbus.h
deleted file mode 100644 (file)
index 9710b59..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * feedback
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __DBUS_H__
-#define __DBUS_H__
-
-#include <dbus/dbus.h>
-
-/*
- * Device daemon
- */
-#define DEVICED_BUS_NAME                    "org.tizen.system.deviced"
-#define DEVICED_OBJECT_PATH                 "/Org/Tizen/System/DeviceD"
-#define DEVICED_INTERFACE_NAME              DEVICED_BUS_NAME
-/* Led service: play/stop led operations about led */
-#define DEVICED_PATH_LED                    DEVICED_OBJECT_PATH"/Led"
-#define DEVICED_INTERFACE_LED               DEVICED_INTERFACE_NAME".Led"
-/* Haptic service: operatioins about haptic */
-#define DEVICED_PATH_HAPTIC                 DEVICED_OBJECT_PATH"/Haptic"
-#define DEVICED_INTERFACE_HAPTIC            DEVICED_INTERFACE_NAME".haptic"
-
-struct dbus_byte {
-       const unsigned char *data;
-       int size;
-};
-
-int dbus_method_sync(const char *dest, const char *path,
-               const char *interface, const char *method,
-               const char *sig, char *param[]);
-#endif
diff --git a/include/devices.h b/include/devices.h
deleted file mode 100644 (file)
index 2fdd215..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * libfeedback
-
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __DEVICES_H__
-#define __DEVICES_H__
-
-struct device_ops {
-       int type;
-       void (*init) (void);
-       void (*exit) (void);
-       int (*play) (int);
-       int (*stop) (void);
-       int (*get_path) (int, char *, unsigned int);
-       int (*set_path) (int, char *);
-};
-
-void devices_init(void);
-void devices_exit(void);
-void devices_play(int pattern);
-void devices_stop(void);
-
-#ifndef __CONSTRUCTOR__
-#define __CONSTRUCTOR__ __attribute__ ((constructor))
-#endif
-
-#ifndef __DESTRUCTOR__
-#define __DESTRUCTOR__ __attribute__ ((destructor))
-#endif
-
-#define DEVICE_OPS_REGISTER(dev)       \
-static void __CONSTRUCTOR__ module_init(void)  \
-{      \
-       add_device(dev);        \
-}
-
-void add_device(const struct device_ops *dev);
-void remove_device(const struct device_ops *dev);
-const struct device_ops *find_device(int type);
-
-#endif
index 84e9430c970d4a9861fdfcf10379daf7aa78ae6a..eac2d2e69fae1f5cdda707879a2df83df4c0e0f4 100644 (file)
@@ -24,27 +24,20 @@ extern "C" {
 #endif
 
 /**
- * @file feedback-ids.h
- * @brief This file contains the feedback API
- */
-
-/**
- * @addtogroup CAPI_FEEDBACK_MODULE
+ * @addtogroup CAPI_SYSTEM_FEEDBACK_MODULE
  * @{
  */
 
 /**
  * @brief Enumerations of the type for feedback interface
- * @details
- *
+ * @since_tizen 2.4
  */
 typedef enum
 {
        FEEDBACK_TYPE_NONE,
        FEEDBACK_TYPE_SOUND,
        FEEDBACK_TYPE_VIBRATION,
-       FEEDBACK_TYPE_LED,
-       FEEDBACK_TYPE_END
+       FEEDBACK_TYPE_END,
 } feedback_type_e;
 
 /**
@@ -53,122 +46,122 @@ typedef enum
  * Each feedback pattern can have separate media files of each types.
  * But Depending on vendor design, pattern may not have any type of file.
  *
+ * @since_tizen 2.4
  */
 typedef enum
 {
        FEEDBACK_PATTERN_NONE = -1,
 
-       FEEDBACK_PATTERN_TAP = 0,                       /**< feedback pattern when general touch */
-       FEEDBACK_PATTERN_SIP,                           /**< feedback pattern when touch text key */
-       FEEDBACK_PATTERN_SIP_BACKSPACE,                 /**< feedback pattern when touch backspace key */
-       FEEDBACK_PATTERN_SIP_FUNCTION,                  /**< feedback pattern when touch function key */
-       FEEDBACK_PATTERN_SIP_FJKEY,                     /**< feedback pattern when touch F,J key */
-       FEEDBACK_PATTERN_MAX_CHARACTER,                 /**< feedback pattern when max character */
-       FEEDBACK_PATTERN_KEY0,                          /**< feedback pattern when touch numeric 0 key */
-       FEEDBACK_PATTERN_KEY1,                          /**< feedback pattern when touch numeric 1 key */
-       FEEDBACK_PATTERN_KEY2,                          /**< feedback pattern when touch numeric 2 key */
-       FEEDBACK_PATTERN_KEY3,                          /**< feedback pattern when touch numeric 3 key */
-       FEEDBACK_PATTERN_KEY4,                          /**< feedback pattern when touch numeric 4 key */
-       FEEDBACK_PATTERN_KEY5,                          /**< feedback pattern when touch numeric 5 key */
-       FEEDBACK_PATTERN_KEY6,                          /**< feedback pattern when touch numeric 6 key */
-       FEEDBACK_PATTERN_KEY7,                          /**< feedback pattern when touch numeric 7 key */
-       FEEDBACK_PATTERN_KEY8,                          /**< feedback pattern when touch numeric 8 key */
-       FEEDBACK_PATTERN_KEY9,                          /**< feedback pattern when touch numeric 9 key */
-       FEEDBACK_PATTERN_KEY_STAR,                      /**< feedback pattern when touch star key */
-       FEEDBACK_PATTERN_KEY_SHARP,                     /**< feedback pattern when touch sharp key */
-       FEEDBACK_PATTERN_KEY_BACK,                      /**< feedback pattern when touch backspace key */
-       FEEDBACK_PATTERN_HOLD,                          /**< feedback pattern when touch hold */
-       FEEDBACK_PATTERN_MULTI_TAP,                     /**< feedback pattern when multi touch */
-       FEEDBACK_PATTERN_HW_TAP,                        /**< feedback pattern when press hardware key */
-       FEEDBACK_PATTERN_HW_HOLD,                       /**< feedback pattern when holding press hardware key */
-
-       FEEDBACK_PATTERN_MESSAGE,                       /**< feedback pattern when incoming a message */
-       FEEDBACK_PATTERN_MESSAGE_ON_CALL,               /**< feedback pattern when incoming a message on call */
-       FEEDBACK_PATTERN_EMAIL,                         /**< feedback pattern when incoming an email */
-       FEEDBACK_PATTERN_EMAIL_ON_CALL,                 /**< feedback pattern when incoming an email on call */
-       FEEDBACK_PATTERN_WAKEUP,                        /**< feedback pattern when alert wake up call */
-       FEEDBACK_PATTERN_WAKEUP_ON_CALL,                /**< feedback pattern when alert wake up call on call */
-       FEEDBACK_PATTERN_SCHEDULE,                      /**< feedback pattern when alert schedule alarm */
-       FEEDBACK_PATTERN_SCHEDULE_ON_CALL,              /**< feedback pattern when alert schedule alarm on call */
-       FEEDBACK_PATTERN_TIMER,                         /**< feedback pattern when alert timer */
-       FEEDBACK_PATTERN_TIMER_ON_CALL,                 /**< feedback pattern when alert timer on call */
-       FEEDBACK_PATTERN_GENERAL,                       /**< feedback pattern when alert general event */
-       FEEDBACK_PATTERN_GENERAL_ON_CALL,               /**< feedback pattern when alert general event on call */
-       FEEDBACK_PATTERN_SMART_ALERT,                   /**< feedback pattern when alert noti on motion */
-
-       FEEDBACK_PATTERN_POWERON,               /**< feedback pattern when power on */
-       FEEDBACK_PATTERN_POWEROFF,              /**< feedback pattern when power off */
-       FEEDBACK_PATTERN_CHARGERCONN,           /**< feedback pattern when connecting charger */
-       FEEDBACK_PATTERN_CHARGERCONN_ON_CALL,   /**< feedback pattern when connecting charger on call */
-       FEEDBACK_PATTERN_CHARGING_ERROR,        /**< feedback pattern when occuring charging error */
-       FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL,/**< feedback pattern when occuring charging error on call */
-       FEEDBACK_PATTERN_FULLCHARGED,           /**< feedback pattern when full charged */
-       FEEDBACK_PATTERN_FULLCHARGED_ON_CALL,   /**< feedback pattern when full charged on call */
-       FEEDBACK_PATTERN_LOWBATT,               /**< feedback pattern when low battery */
-       FEEDBACK_PATTERN_LOWBATT_ON_CALL,       /**< feedback pattern when low battery on call */
-       FEEDBACK_PATTERN_LOCK,                  /**< feedback pattern when lock */
-       FEEDBACK_PATTERN_UNLOCK,                /**< feedback pattern when unlock */
-       FEEDBACK_PATTERN_LOCK_SWIPE,            /**< feedback pattern when lock swipe */
-       FEEDBACK_PATTERN_UNLOCK_SWIPE,          /**< feedback pattern when unlock swipe*/
-       FEEDBACK_PATTERN_GEOMETRIC_LOCK,        /**< feedback pattern when lock by geometric effect */
-       FEEDBACK_PATTERN_CALLCONNECT,           /**< feedback pattern when connecting call */
-       FEEDBACK_PATTERN_DISCALLCONNECT,        /**< feedback pattern when disconnecting call */
-       FEEDBACK_PATTERN_OUTGOING_CALL,         /**< feedback pattern when connected outgoing call */
-       FEEDBACK_PATTERN_MINUTEMINDER,          /**< feedback pattern when minute minder */
-       FEEDBACK_PATTERN_VIBRATION_ON,          /**< feedback pattern when turn on vibration mode */
-       FEEDBACK_PATTERN_SILENT_OFF,            /**< feedback pattern when turn off silent mode */
-       FEEDBACK_PATTERN_BT_CONNECTED,          /**< feedback pattern when connecting with bluetooth */
-       FEEDBACK_PATTERN_BT_DISCONNECTED,       /**< feedback pattern when disconnecting with bluetooth */
-       FEEDBACK_PATTERN_BT_PAIRING,            /**< feedback pattern when starting pare with bluetooth */
-       FEEDBACK_PATTERN_BT_WAITING,            /**< feedback pattern when pairing bluetooth */
-       FEEDBACK_PATTERN_SCREEN_CAPTURE,        /**< feedback pattern when screen capture */
-       FEEDBACK_PATTERN_LIST_REORDER,          /**< feedback pattern when list reorder */
-       FEEDBACK_PATTERN_LIST_SLIDER,           /**< feedback pattern when list slider sweep */
-       FEEDBACK_PATTERN_VOLUME_KEY,            /**< feedback pattern when pressed volume key */
-       FEEDBACK_PATTERN_MMS,                   /**< feedback pattern when message state changed to MMS */
-       FEEDBACK_PATTERN_HOURLY_ALERT,          /**< feedback pattern when alert every hour on the hour */
-
-       FEEDBACK_PATTERN_SAFETY_ALERT,          /**< feedback pattern when safety alert from phone */
-       FEEDBACK_PATTERN_ACCIDENT_DETECT,       /**< feedback pattern when accident detect */
-       FEEDBACK_PATTERN_SEND_SOS_MESSAGE,      /**< feedback pattern when sending SOS message */
-       FEEDBACK_PATTERN_END_SOS_MESSAGE,       /**< feedback pattern when finishing SOS message */
-       FEEDBACK_PATTERN_EMERGENCY_BUZZER,      /**< feedback pattern when occurs emergency buzzer */
-       FEEDBACK_PATTERN_SAFETY_LOW_POWER,      /**< this pattern is a low power ringtone */
-       FEEDBACK_PATTERN_CMAS,                  /**< feedback pattern when alerting commercial mobile */
-       FEEDBACK_PATTERN_SPEED_UP,              /**< feedback pattern when advising user to speed up */
-       FEEDBACK_PATTERN_SLOW_DOWN,             /**< feedback pattern when advising user to slow down */
-       FEEDBACK_PATTERN_KEEP_THIS_PACE,        /**< feedback pattern when advising user to keep this pace */
-       FEEDBACK_PATTERN_GOAL_ACHIEVED,         /**< feedback pattern when alerting goal achieved */
-       FEEDBACK_PATTERN_EXERCISE_COUNT,        /**< feedback pattern when changing count number */
-       FEEDBACK_PATTERN_START_CUE,             /**< feedback pattern when starting cue */
-       FEEDBACK_PATTERN_HEALTH_PACE,           /**< feedback pattern when alerting health pace */
-       FEEDBACK_PATTERN_INACTIVE_TIME,         /**< feedback pattern when alerting inactive time */
-       FEEDBACK_PATTERN_MEASURING_SUCCESS,     /**< feedback pattern when measuring is succeeded */
-       FEEDBACK_PATTERN_MEASURING_FAILURE,     /**< feedback pattern when measuring is failed */
-       FEEDBACK_PATTERN_UV_PROCESSING,         /**< feedback pattern when UV is processing */
-       FEEDBACK_PATTERN_SHEALTH_START,         /**< feedback pattern when starting s-health */
-       FEEDBACK_PATTERN_SHEALTH_PAUSE,         /**< feedback pattern when pausing s-health */
-       FEEDBACK_PATTERN_SHEALTH_STOP,          /**< feedback pattern when stoping s-health */
-       FEEDBACK_PATTERN_3RD_APPLICATION,       /**< feedback pattern when alert 3rd event */
+       FEEDBACK_PATTERN_TAP = 0,                       /**< Feedback pattern when general touch */
+       FEEDBACK_PATTERN_SIP,                           /**< Feedback pattern when touch text key */
+       FEEDBACK_PATTERN_KEY0,                          /**< Feedback pattern when touch numeric 0 key */
+       FEEDBACK_PATTERN_KEY1,                          /**< Feedback pattern when touch numeric 1 key */
+       FEEDBACK_PATTERN_KEY2,                          /**< Feedback pattern when touch numeric 2 key */
+       FEEDBACK_PATTERN_KEY3,                          /**< Feedback pattern when touch numeric 3 key */
+       FEEDBACK_PATTERN_KEY4,                          /**< Feedback pattern when touch numeric 4 key */
+       FEEDBACK_PATTERN_KEY5,                          /**< Feedback pattern when touch numeric 5 key */
+       FEEDBACK_PATTERN_KEY6,                          /**< Feedback pattern when touch numeric 6 key */
+       FEEDBACK_PATTERN_KEY7,                          /**< Feedback pattern when touch numeric 7 key */
+       FEEDBACK_PATTERN_KEY8,                          /**< Feedback pattern when touch numeric 8 key */
+       FEEDBACK_PATTERN_KEY9,                          /**< Feedback pattern when touch numeric 9 key */
+       FEEDBACK_PATTERN_KEY_STAR,                      /**< Feedback pattern when touch star key */
+       FEEDBACK_PATTERN_KEY_SHARP,                     /**< Feedback pattern when touch sharp key */
+       FEEDBACK_PATTERN_KEY_BACK,                      /**< Feedback pattern when touch backspace key */
+       FEEDBACK_PATTERN_HOLD,                          /**< Feedback pattern when touch hold */
+       FEEDBACK_PATTERN_HW_TAP,                        /**< Feedback pattern when press hardware key */
+       FEEDBACK_PATTERN_HW_HOLD,                       /**< Feedback pattern when holding press hardware key */
+
+       FEEDBACK_PATTERN_MESSAGE,                       /**< Feedback pattern when incoming a message */
+       FEEDBACK_PATTERN_EMAIL,                         /**< Feedback pattern when incoming an email */
+       FEEDBACK_PATTERN_WAKEUP,                        /**< Feedback pattern when alert wake up call */
+       FEEDBACK_PATTERN_SCHEDULE,                      /**< Feedback pattern when alert schedule alarm */
+       FEEDBACK_PATTERN_TIMER,                         /**< Feedback pattern when alert timer */
+       FEEDBACK_PATTERN_GENERAL,                       /**< Feedback pattern when alert general event */
+
+       FEEDBACK_PATTERN_POWERON,               /**< Feedback pattern when power on */
+       FEEDBACK_PATTERN_POWEROFF,              /**< Feedback pattern when power off */
+       FEEDBACK_PATTERN_CHARGERCONN,           /**< Feedback pattern when connecting charger */
+       FEEDBACK_PATTERN_CHARGING_ERROR,        /**< Feedback pattern when occuring charging error */
+       FEEDBACK_PATTERN_FULLCHARGED,           /**< Feedback pattern when full charged */
+       FEEDBACK_PATTERN_LOWBATT,               /**< Feedback pattern when low battery */
+       FEEDBACK_PATTERN_LOCK,                  /**< Feedback pattern when lock */
+       FEEDBACK_PATTERN_UNLOCK,                /**< Feedback pattern when unlock */
+       FEEDBACK_PATTERN_VIBRATION_ON,          /**< Feedback pattern when turn on vibration mode */
+       FEEDBACK_PATTERN_SILENT_OFF,            /**< Feedback pattern when turn off silent mode */
+       FEEDBACK_PATTERN_BT_CONNECTED,          /**< Feedback pattern when connecting with bluetooth */
+       FEEDBACK_PATTERN_BT_DISCONNECTED,       /**< Feedback pattern when disconnecting with bluetooth */
+       FEEDBACK_PATTERN_LIST_REORDER,          /**< Feedback pattern when list reorder */
+       FEEDBACK_PATTERN_LIST_SLIDER,           /**< Feedback pattern when list slider sweep */
+       FEEDBACK_PATTERN_VOLUME_KEY,            /**< Feedback pattern when pressed volume key */
 
        FEEDBACK_PATTERN_END,
 
-       /* START : Will be removed */
+       /* TODO Will be removed */
        FEEDBACK_PATTERN_TOUCH_TAP = FEEDBACK_PATTERN_TAP,
-       FEEDBACK_PATTERN_TOUCH_MULTI_TAP = FEEDBACK_PATTERN_MULTI_TAP,
+       FEEDBACK_PATTERN_TOUCH_MULTI_TAP = FEEDBACK_PATTERN_TAP,
        FEEDBACK_PATTERN_TOUCH_KEY = FEEDBACK_PATTERN_KEY0,
        FEEDBACK_PATTERN_TOUCH_HOLD = FEEDBACK_PATTERN_HOLD,
-       FEEDBACK_PATTERN_REACTIVE_ALERT = FEEDBACK_PATTERN_SMART_ALERT,
+       FEEDBACK_PATTERN_REACTIVE_ALERT = FEEDBACK_PATTERN_NONE,
        FEEDBACK_PATTERN_VIBRATION = FEEDBACK_PATTERN_VIBRATION_ON,
        FEEDBACK_PATTERN_SOUND_ON = FEEDBACK_PATTERN_SILENT_OFF,
-       FEEDBACK_PATTERN_SHUTTER = FEEDBACK_PATTERN_SCREEN_CAPTURE,
+       FEEDBACK_PATTERN_SHUTTER = FEEDBACK_PATTERN_NONE,
        FEEDBACK_PATTERN_SLIDER_SWEEP = FEEDBACK_PATTERN_LIST_SLIDER,
-       FEEDBACK_PATTERN_SAFETY_ASSISTANCE = FEEDBACK_PATTERN_SEND_SOS_MESSAGE,
-       FEEDBACK_PATTERN_BT_PARING = FEEDBACK_PATTERN_BT_PAIRING,
+       FEEDBACK_PATTERN_SAFETY_ASSISTANCE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_BT_PARING = FEEDBACK_PATTERN_BT_CONNECTED,
        FEEDBACK_PATTERN_CONNECTED = FEEDBACK_PATTERN_BT_CONNECTED,
        FEEDBACK_PATTERN_DISCONNECTED = FEEDBACK_PATTERN_BT_DISCONNECTED,
-       FEEDBACK_PATTERN_SUCCESS = FEEDBACK_PATTERN_MEASURING_SUCCESS,
-       FEEDBACK_PATTERN_FAILURE = FEEDBACK_PATTERN_MEASURING_FAILURE,
+       FEEDBACK_PATTERN_SUCCESS = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_FAILURE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SIP_BACKSPACE = FEEDBACK_PATTERN_SIP,
+       FEEDBACK_PATTERN_SIP_FUNCTION = FEEDBACK_PATTERN_SIP,
+       FEEDBACK_PATTERN_SIP_FJKEY = FEEDBACK_PATTERN_SIP,
+       FEEDBACK_PATTERN_MAX_CHARACTER = FEEDBACK_PATTERN_SIP,
+       FEEDBACK_PATTERN_MULTI_TAP = FEEDBACK_PATTERN_TAP,
+       FEEDBACK_PATTERN_MESSAGE_ON_CALL = FEEDBACK_PATTERN_MESSAGE,
+       FEEDBACK_PATTERN_EMAIL_ON_CALL = FEEDBACK_PATTERN_EMAIL,
+       FEEDBACK_PATTERN_WAKEUP_ON_CALL = FEEDBACK_PATTERN_WAKEUP,
+       FEEDBACK_PATTERN_SCHEDULE_ON_CALL = FEEDBACK_PATTERN_SCHEDULE,
+       FEEDBACK_PATTERN_TIMER_ON_CALL = FEEDBACK_PATTERN_TIMER,
+       FEEDBACK_PATTERN_GENERAL_ON_CALL = FEEDBACK_PATTERN_GENERAL,
+       FEEDBACK_PATTERN_SMART_ALERT = FEEDBACK_PATTERN_GENERAL,
+       FEEDBACK_PATTERN_CHARGERCONN_ON_CALL = FEEDBACK_PATTERN_CHARGERCONN,
+       FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL = FEEDBACK_PATTERN_CHARGING_ERROR,
+       FEEDBACK_PATTERN_FULLCHARGED_ON_CALL = FEEDBACK_PATTERN_FULLCHARGED,
+       FEEDBACK_PATTERN_LOWBATT_ON_CALL = FEEDBACK_PATTERN_LOWBATT,
+       FEEDBACK_PATTERN_LOCK_SWIPE = FEEDBACK_PATTERN_LOCK,
+       FEEDBACK_PATTERN_UNLOCK_SWIPE = FEEDBACK_PATTERN_UNLOCK,
+       FEEDBACK_PATTERN_GEOMETRIC_LOCK = FEEDBACK_PATTERN_LOCK,
+       FEEDBACK_PATTERN_CALLCONNECT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_DISCALLCONNECT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_OUTGOING_CALL = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_MINUTEMINDER = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_BT_PAIRING = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_BT_WAITING = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SCREEN_CAPTURE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_MMS = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_HOURLY_ALERT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SAFETY_ALERT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_ACCIDENT_DETECT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SEND_SOS_MESSAGE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_END_SOS_MESSAGE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_EMERGENCY_BUZZER = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SAFETY_LOW_POWER = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_CMAS = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SPEED_UP = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SLOW_DOWN = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_KEEP_THIS_PACE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_GOAL_ACHIEVED = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_EXERCISE_COUNT = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_START_CUE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_HEALTH_PACE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_INACTIVE_TIME = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_MEASURING_SUCCESS = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_MEASURING_FAILURE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_UV_PROCESSING = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SHEALTH_START = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SHEALTH_PAUSE = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_SHEALTH_STOP = FEEDBACK_PATTERN_NONE,
+       FEEDBACK_PATTERN_3RD_APPLICATION = FEEDBACK_PATTERN_NONE,
        /* END : Will be removed */
 
 } feedback_pattern_e;
diff --git a/include/feedback-internal.h b/include/feedback-internal.h
new file mode 100644 (file)
index 0000000..08c5e0a
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __FEEDBACK_INTERNAL_H__
+#define __FEEDBACK_INTERNAL_H__
+
+#include <tizen_error.h>
+#include "feedback-ids.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file feedback-internal.h
+ * @brief This file contains the feedback internal API
+ */
+
+#define FEEDBACK_SUCCEEDED(n)                ((n) == FEEDBACK_ERROR_NONE)
+#define FEEDBACK_FAILED(n)                   ((n) != FEEDBACK_ERROR_NONE)
+
+/**
+ *
+ * @brief Plays specific type of reactions that are pre-defined.
+ * @details
+ * This function can be used to react to pre-defined actions. \n
+ * It play specific type of system pre-defined pattern.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks
+ * Currently, there are two types of reactions: sound and vibration.
+ *
+ * @param[in] type string      The pattern type
+ * @param[in] pattern string   The pre-defined pattern
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #FEEDBACK_ERROR_NONE               Successful
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ */
+int feedback_play_type_by_name(char *type, char *pattern);
+
+/**
+ * @brief Gets the file path of resource for the given feedback type and pattern.
+ * @details
+ * Depending on the type of each pattern resouorce has a different format. \n
+ * Currently, System supports two pattern types. \n
+ * #FEEDBACK_TYPE_SOUND type uses .wav format. \n
+ * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n
+ * If the given pattern doesn't have a file for the type, @a path will return NULL.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks @a path must be released with free() by you.
+ *
+ * @param[in]  type      The pattern type
+ * @param[in]  pattern   The pre-defined pattern
+ * @param[out] path      The file path of resource for feedback type and pattern
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #FEEDBACK_ERROR_NONE               Successful
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ */
+int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char **path);
+
+/**
+ * @brief Sets the new file path of resource for the given feedback type and pattern.
+ * @details
+ * Depending on the type of each pattern resouorce has a different format. \n
+ * Currently, System supports two pattern types. \n
+ * #FEEDBACK_TYPE_SOUND type uses .wav format. \n
+ * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n
+ * If the given pattern doesn't have a file for the type, @a path will return NULL.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in]  type      The pattern type
+ * @param[in]  pattern   The pre-defined pattern
+ * @param[in]  path      The new file path of resource for feedback type and pattern
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #FEEDBACK_ERROR_NONE               Successful
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ */
+int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e pattern, char *path);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__FEEDBACK_INTERNAL_H__
index 532e24e87751064846f09a57a6295cba69c81b4e..a63713ead06e68f6ae4ed4ba9bd6b1b33d913c36 100644 (file)
 #ifndef __FEEDBACK_H__
 #define __FEEDBACK_H__
 
+#include <tizen.h>
 #include <tizen_error.h>
 #include "feedback-ids.h"
+/* TODO Will be removed */
+#include "feedback-internal.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -38,7 +41,7 @@ extern "C" {
 
 /**
  * @brief Enumerations of error codes for the Feedback API.
- * @since_tizen 2.3
+ * @since_tizen 2.4
  */
 typedef enum
 {
@@ -46,24 +49,22 @@ typedef enum
     FEEDBACK_ERROR_OPERATION_FAILED    = TIZEN_ERROR_NOT_PERMITTED,       /**< Operation not permitted */
     FEEDBACK_ERROR_INVALID_PARAMETER   = TIZEN_ERROR_INVALID_PARAMETER,   /**< Invalid parameter */
     FEEDBACK_ERROR_NOT_SUPPORTED       = TIZEN_ERROR_NOT_SUPPORTED,       /**< Not supported in this device */
-    FEEDBACK_ERROR_NOT_INITIALIZED     = TIZEN_ERROR_SYSTEM_CLASS | 0x52, /**< Has not yet been Initialized */
+    FEEDBACK_ERROR_PERMISSION_DENIED   = TIZEN_ERROR_PERMISSION_DENIED,   /**< Permission denied */
+    FEEDBACK_ERROR_NOT_INITIALIZED     = TIZEN_ERROR_FEEDBACK | 0x01,     /**< Not initialized */
 } feedback_error_e;
 
-#define FEEDBACK_SUCCEEDED(n)                ((n) == FEEDBACK_ERROR_NONE)
-#define FEEDBACK_FAILED(n)                   ((n) != FEEDBACK_ERROR_NONE)
-
 /**
  * @brief Initializes feedback API.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks
  * If this function is not called in advance, other function will return #FEEDBACK_ERROR_NOT_INITIALIZED.
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_OPERATION_FAILED   Operation failed
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ *
+ * @post feedback_deinitialize()
  *
  * @see feedback_deinitialize()
  */
@@ -73,12 +74,13 @@ int feedback_initialize(void);
  * @brief Deinitializes feedback API.
  * @details This function must be called when feedback functions are no longer needed.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #FEEDBACK_ERROR_NONE                 Successful
- * @retval #FEEDBACK_ERROR_OPERATION_FAILED     Operation failed
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ * @retval #FEEDBACK_ERROR_NOT_INITIALIZED      Not initialized
+ *
+ * @pre feedback_initialize()
  *
  * @see feedback_initialize()
  */
@@ -90,19 +92,27 @@ int feedback_deinitialize(void);
  * This functon can be used to react to pre-defined actions. \n
  * It play various types of system pre-defined media or vibration patterns.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks
  * Currently, there are two types of reactions: sound and vibration. \n
  * Depending on the settings, some types cannot operate.
  * For example, when set to silent mode, the device doesn't produce any sound.
+ * If to play one of devices is successful, this function regards as success.
+ * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
+ * If you don't have the haptic privilege, it only works sound operation.
+ * It does not return any error in this case.
  *
  * @param[in] pattern   The pre-defined pattern
  *
  * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ * @retval #FEEDBACK_ERROR_NONE                 Successful
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED     Operation not permitted
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER    Invalid parameter
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED        Not supported device
+ * @retval #FEEDBACK_ERROR_NOT_INITIALIZED      Not initialized
+ *
+ * @pre feedback_initialize()
  */
 int feedback_play(feedback_pattern_e pattern);
 
@@ -113,104 +123,77 @@ int feedback_play(feedback_pattern_e pattern);
  * This function can be used to react to pre-defined actions. \n
  * It play specific type of system pre-defined pattern.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks
- * Currently, there are two types of reactions: sound and vibration.
+ * Currently, there are two types of reactions: sound and vibration. \n
+ * Depending on the settings, some types cannot operate.
+ * For example, when set to silent mode, the device doesn't produce any sound.
+ * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
+ * If you don't have the haptic privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
  *
  * @param[in] type      The pattern type
  * @param[in] pattern   The pre-defined pattern
  *
  * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ * @retval #FEEDBACK_ERROR_NONE                 Successful
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED     Operation not permitted
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER    Invalid parameter
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED        Not supported device
+ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED    Permission denied
+ * @retval #FEEDBACK_ERROR_NOT_INITIALIZED      Not initialized
+ *
+ * @pre feedback_initialize()
  */
 int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern);
 
 /**
- *
- * @brief Plays specific type of reactions that are pre-defined.
+ * @brief Stop various types of reactions
  * @details
- * This function can be used to react to pre-defined actions. \n
- * It play specific type of system pre-defined pattern.
+ * This functon can be used to stop react to pre-defined actions. \n
+ * It stops system pre-defined vibration patterns.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks
- * Currently, there are two types of reactions: sound and vibration.
- *
- * @param[in] type string      The pattern type
- * @param[in] pattern string   The pre-defined pattern
+ * This function does not support to stop media sound actions. \n
+ * In this case, it will return FEEDBACK_ERROR_NOT_SUPPORTED error.
+ * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
+ * If you don't have the haptic privilege, it only works sound operation.
+ * It does not return any error in this case.
  *
  * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
- */
-int feedback_play_type_by_name(char *type, char *pattern);
-
-/**
- * @brief Stop various types of reactions
- * @details
- * This functon can be used to stop react to pre-defined actions. \n
- * It stops various types of system pre-defined media or vibration patterns.
- *
- * @since_tizen 2.3
+ * @retval #FEEDBACK_ERROR_NONE                 Successful
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED     Operation not permitted
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED        Not supported device
+ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED    Permission denied
+ * @retval #FEEDBACK_ERROR_NOT_INITIALIZED      Not initialized
  *
- * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ * @pre feedback_initialize()
  */
 int feedback_stop(void);
 
 /**
- * @brief Gets the file path of resource for the given feedback type and pattern.
+ * @brief Checks if the pattern is supported
  * @details
- * Depending on the type of each pattern resouorce has a different format. \n
- * Currently, System supports two pattern types. \n
- * #FEEDBACK_TYPE_SOUND type uses .wav format. \n
- * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n
- * If the given pattern doesn't have a file for the type, @a path will return NULL.
- *
- * @since_tizen 2.3
+ * This functon can be used to check if a specific pattern is supported.
  *
- * @remarks @a path must be released with free() by you.
+ * @since_tizen 2.4
  *
- * @param[in]  type      The pattern type
- * @param[in]  pattern   The pre-defined pattern
- * @param[out] path      The file path of resource for feedback type and pattern
+ * @param[in] type      The pattern type
+ * @param[in] pattern   The pre-defined pattern
+ * @param[out] status   True means the pattern is supported, otherwise not supported.
  *
  * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #FEEDBACK_ERROR_OPERATION_FAILED   Operation failed
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
- */
-int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char **path);
-
-/**
- * @brief Sets the new file path of resource for the given feedback type and pattern.
- * @details
- * Depending on the type of each pattern resouorce has a different format. \n
- * Currently, System supports two pattern types. \n
- * #FEEDBACK_TYPE_SOUND type uses .wav format. \n
- * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n
- * If the given pattern doesn't have a file for the type, @a path will return NULL.
- *
- * @since_tizen 2.3
- *
- * @param[in]  type      The pattern type
- * @param[in]  pattern   The pre-defined pattern
- * @param[in]  path      The new file path of resource for feedback type and pattern
+ * @retval #FEEDBACK_ERROR_NONE                 Successful
+ * @retval #FEEDBACK_ERROR_OPERATION_FAILED     Operation not permitted
+ * @retval #FEEDBACK_ERROR_INVALID_PARAMETER    Invalid parameter
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED        Not supported device
+ * @retval #FEEDBACK_ERROR_NOT_INITIALIZED      Not initialized
  *
- * @return 0 on success, otherwise a negative error value.
- * @retval #FEEDBACK_ERROR_NONE               Successful
- * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #FEEDBACK_ERROR_OPERATION_FAILED   Operation failed
- * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
+ * @pre feedback_initialize()
  */
-int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e pattern, char *path);
+int feedback_is_supported_pattern(feedback_type_e type, feedback_pattern_e pattern, bool *status);
 
 /**
  * @}
diff --git a/include/feedback_doc.h b/include/feedback_doc.h
deleted file mode 100755 (executable)
index c11960d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __FEEDBACK_DOC_H__
-#define __FEEDBACK_DOC_H__
-
-/**
- * @defgroup CAPI_FEEDBACK_MODULE Feedback
- * @brief  The FEEDBACK API provides functions to play simple sound and vibration.
- * @ingroup CAPI_UIX_FRAMEWORK
- *
- * @section CAPI_FEEDBACK_MODULE_HEADER Required Header
- *   \#include <feedback.h>
- *
- * @section CAPI_FEEDBACK_MODULE_OVERVIEW Overview
- * The feedback library is responsible for playing simple sound and vibration.
- * Feedback play sound using mm-sound library and play vibration with system framework.
- *
- */
-
-#endif /* __FEEDBACK_DOC_H__ */
diff --git a/include/log.h b/include/log.h
deleted file mode 100644 (file)
index d07bb81..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __LOG_H__
-#define __LOG_H__
-
-#define FEATURE_FEEDBACK_DLOG
-
-#ifdef FEATURE_FEEDBACK_DLOG
-       #define LOG_TAG "FEEDBACK"
-       #include <dlog.h>
-       #define _D(fmt, args...)                SLOGD(fmt, ##args)
-       #define _W(fmt, args...)                SLOGW(fmt, ##args)
-       #define _E(fmt, args...)                SLOGE(fmt, ##args)
-#else
-       #define _D(x, ...)
-       #define _W(x, ...)
-       #define _E(x, ...)
-#endif
-
-#endif //__LOG_H__
diff --git a/include/xmlparser.h b/include/xmlparser.h
deleted file mode 100644 (file)
index 0c38672..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __XMLPARSER_H__
-#define __XMLPARSER_H__
-
-#include <libxml/parser.h>
-
-struct xmlData {
-    char *label;
-    char *data;
-       int size;
-};
-
-enum xmlType {
-       XML_LABEL = 0,
-       XML_DATA,
-};
-
-#define VIBRATION_STR          "vibration"
-#define SOUND_STR                      "sound"
-
-xmlDocPtr xml_open(const char *xml);
-void xml_close(xmlDocPtr doc);
-
-xmlNodePtr xml_find(xmlDocPtr doc, const char *label, const xmlChar* expr);
-struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur);
-int xml_decode_data(struct xmlData *data);
-int xml_save(xmlDocPtr doc, const char *path);
-void xml_free(struct xmlData* data);
-
-#endif //__XMLPARSER_H__
diff --git a/mobile/data/sound.xml b/mobile/data/sound.xml
new file mode 100644 (file)
index 0000000..72f4f77
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<config>
+       <label>svi-data</label>
+       <description>Sound Resource</description>
+       <sound>
+               <label>FEEDBACK_PATTERN_TAP</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SIP</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY0</label>
+               <data>/usr/share/feedback/sound/touch/key0.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY1</label>
+               <data>/usr/share/feedback/sound/touch/key1.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY2</label>
+               <data>/usr/share/feedback/sound/touch/key2.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY3</label>
+               <data>/usr/share/feedback/sound/touch/key3.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY4</label>
+               <data>/usr/share/feedback/sound/touch/key4.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY5</label>
+               <data>/usr/share/feedback/sound/touch/key5.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY6</label>
+               <data>/usr/share/feedback/sound/touch/key6.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY7</label>
+               <data>/usr/share/feedback/sound/touch/key7.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY8</label>
+               <data>/usr/share/feedback/sound/touch/key8.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY9</label>
+               <data>/usr/share/feedback/sound/touch/key9.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_STAR</label>
+               <data>/usr/share/feedback/sound/touch/keyasterisk.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
+               <data>/usr/share/feedback/sound/touch/keysharp.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_BACK</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_HW_TAP</label>
+               <data>/usr/share/feedback/sound/touch/touch.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_POWERON</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LOWBATT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_UNLOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LIST_REORDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LIST_SLIDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_FUNCTION</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SIP_FJKEY</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_MAX_CHARACTER</label>
+               <data>/usr/share/feedback/sound/touch/sip.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_LOCK_SWIPE</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_UNLOCK_SWIPE</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_GEOMETRIC_LOCK</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_CALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_DISCALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_MINUTEMINDER</label>
+               <data>/usr/share/feedback/sound/operation/operation.wav</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE</label>
+               <data>/usr/share/feedback/sound/operation/shutter.wav</data>
+       </sound>
+</config>
diff --git a/mobile/data/sound/operation/notification.wav b/mobile/data/sound/operation/notification.wav
new file mode 100755 (executable)
index 0000000..6487389
Binary files /dev/null and b/mobile/data/sound/operation/notification.wav differ
diff --git a/mobile/data/sound/operation/operation.wav b/mobile/data/sound/operation/operation.wav
new file mode 100755 (executable)
index 0000000..5383bdf
Binary files /dev/null and b/mobile/data/sound/operation/operation.wav differ
diff --git a/mobile/data/sound/operation/ringtone.wav b/mobile/data/sound/operation/ringtone.wav
new file mode 100755 (executable)
index 0000000..f159e35
Binary files /dev/null and b/mobile/data/sound/operation/ringtone.wav differ
diff --git a/mobile/data/sound/operation/shutter.wav b/mobile/data/sound/operation/shutter.wav
new file mode 100755 (executable)
index 0000000..9dea92b
Binary files /dev/null and b/mobile/data/sound/operation/shutter.wav differ
diff --git a/mobile/data/sound/touch/key0.wav b/mobile/data/sound/touch/key0.wav
new file mode 100755 (executable)
index 0000000..e2cd877
Binary files /dev/null and b/mobile/data/sound/touch/key0.wav differ
diff --git a/mobile/data/sound/touch/key1.wav b/mobile/data/sound/touch/key1.wav
new file mode 100755 (executable)
index 0000000..fa77cf4
Binary files /dev/null and b/mobile/data/sound/touch/key1.wav differ
diff --git a/mobile/data/sound/touch/key2.wav b/mobile/data/sound/touch/key2.wav
new file mode 100755 (executable)
index 0000000..53da84c
Binary files /dev/null and b/mobile/data/sound/touch/key2.wav differ
diff --git a/mobile/data/sound/touch/key3.wav b/mobile/data/sound/touch/key3.wav
new file mode 100755 (executable)
index 0000000..ede9a2b
Binary files /dev/null and b/mobile/data/sound/touch/key3.wav differ
diff --git a/mobile/data/sound/touch/key4.wav b/mobile/data/sound/touch/key4.wav
new file mode 100755 (executable)
index 0000000..105bddc
Binary files /dev/null and b/mobile/data/sound/touch/key4.wav differ
diff --git a/mobile/data/sound/touch/key5.wav b/mobile/data/sound/touch/key5.wav
new file mode 100755 (executable)
index 0000000..a34b4d0
Binary files /dev/null and b/mobile/data/sound/touch/key5.wav differ
diff --git a/mobile/data/sound/touch/key6.wav b/mobile/data/sound/touch/key6.wav
new file mode 100755 (executable)
index 0000000..34a8bec
Binary files /dev/null and b/mobile/data/sound/touch/key6.wav differ
diff --git a/mobile/data/sound/touch/key7.wav b/mobile/data/sound/touch/key7.wav
new file mode 100755 (executable)
index 0000000..3b845a4
Binary files /dev/null and b/mobile/data/sound/touch/key7.wav differ
diff --git a/mobile/data/sound/touch/key8.wav b/mobile/data/sound/touch/key8.wav
new file mode 100755 (executable)
index 0000000..2a05528
Binary files /dev/null and b/mobile/data/sound/touch/key8.wav differ
diff --git a/mobile/data/sound/touch/key9.wav b/mobile/data/sound/touch/key9.wav
new file mode 100755 (executable)
index 0000000..80699c8
Binary files /dev/null and b/mobile/data/sound/touch/key9.wav differ
diff --git a/mobile/data/sound/touch/keyasterisk.wav b/mobile/data/sound/touch/keyasterisk.wav
new file mode 100755 (executable)
index 0000000..9ec2e71
Binary files /dev/null and b/mobile/data/sound/touch/keyasterisk.wav differ
diff --git a/mobile/data/sound/touch/keysharp.wav b/mobile/data/sound/touch/keysharp.wav
new file mode 100755 (executable)
index 0000000..ce7cd88
Binary files /dev/null and b/mobile/data/sound/touch/keysharp.wav differ
diff --git a/mobile/data/sound/touch/sip.wav b/mobile/data/sound/touch/sip.wav
new file mode 100755 (executable)
index 0000000..5b44d12
Binary files /dev/null and b/mobile/data/sound/touch/sip.wav differ
diff --git a/mobile/data/sound/touch/touch.wav b/mobile/data/sound/touch/touch.wav
new file mode 100755 (executable)
index 0000000..1ec9de4
Binary files /dev/null and b/mobile/data/sound/touch/touch.wav differ
diff --git a/mobile/include/feedback-ids-mobile.h b/mobile/include/feedback-ids-mobile.h
new file mode 100644 (file)
index 0000000..c1932f0
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __FEEDBACK_IDS_MOBILE_H__
+#define __FEEDBACK_IDS_MOBILE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file feedback-ids-mobile.h
+ * @brief This file contains the feedback API
+ */
+
+/**
+ * @addtogroup CAPI_FEEDBACK_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumerations of the type for feedback interface
+ * @details
+ *
+ */
+typedef enum
+{
+       FEEDBACK_TYPE_MOBILE_LED = FEEDBACK_TYPE_END,
+       FEEDBACK_TYPE_MOBILE_END,
+} feedback_mobile_type_e;
+
+/**
+ * @brief Enumerations of the system pre-defined patterns for feedback interface
+ * @details
+ * Each feedback pattern can have separate media files of each types.
+ * But Depending on vendor design, pattern may not have any type of file.
+ *
+ */
+typedef enum
+{
+       FEEDBACK_PATTERN_MOBILE_NONE = -1,
+
+       FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE = FEEDBACK_PATTERN_END, /**< feedback pattern when touch backspace key */
+       FEEDBACK_PATTERN_MOBILE_SIP_FUNCTION,                   /**< feedback pattern when touch function key */
+       FEEDBACK_PATTERN_MOBILE_SIP_FJKEY,                      /**< feedback pattern when touch F,J key */
+       FEEDBACK_PATTERN_MOBILE_MAX_CHARACTER,                  /**< feedback pattern when max character */
+       FEEDBACK_PATTERN_MOBILE_MULTI_TAP,                      /**< feedback pattern when multi touch */
+
+       FEEDBACK_PATTERN_MOBILE_MESSAGE_ON_CALL,                /**< feedback pattern when incoming a message on call */
+       FEEDBACK_PATTERN_MOBILE_EMAIL_ON_CALL,                  /**< feedback pattern when incoming an email on call */
+       FEEDBACK_PATTERN_MOBILE_WAKEUP_ON_CALL,                 /**< feedback pattern when alert wake up call on call */
+       FEEDBACK_PATTERN_MOBILE_SCHEDULE_ON_CALL,               /**< feedback pattern when alert schedule alarm on call */
+       FEEDBACK_PATTERN_MOBILE_TIMER_ON_CALL,                  /**< feedback pattern when alert timer on call */
+       FEEDBACK_PATTERN_MOBILE_GENERAL_ON_CALL,                /**< feedback pattern when alert general event on call */
+       FEEDBACK_PATTERN_MOBILE_SMART_ALERT,                    /**< feedback pattern when alert noti on motion */
+
+       FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL,    /**< feedback pattern when connecting charger on call */
+       FEEDBACK_PATTERN_MOBILE_CHARGING_ERROR_ON_CALL,/**< feedback pattern when occuring charging error on call */
+       FEEDBACK_PATTERN_MOBILE_FULLCHARGED_ON_CALL,    /**< feedback pattern when full charged on call */
+       FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL,        /**< feedback pattern when low battery on call */
+       FEEDBACK_PATTERN_MOBILE_LOCK_SWIPE,             /**< feedback pattern when lock swipe */
+       FEEDBACK_PATTERN_MOBILE_UNLOCK_SWIPE,           /**< feedback pattern when unlock swipe*/
+       FEEDBACK_PATTERN_MOBILE_GEOMETRIC_LOCK,         /**< feedback pattern when lock by geometric effect */
+       FEEDBACK_PATTERN_MOBILE_CALLCONNECT,            /**< feedback pattern when connecting call */
+       FEEDBACK_PATTERN_MOBILE_DISCALLCONNECT,         /**< feedback pattern when disconnecting call */
+       FEEDBACK_PATTERN_MOBILE_OUTGOING_CALL,          /**< feedback pattern when connected outgoing call */
+       FEEDBACK_PATTERN_MOBILE_MINUTEMINDER,           /**< feedback pattern when minute minder */
+       FEEDBACK_PATTERN_MOBILE_BT_PAIRING,             /**< feedback pattern when starting pare with bluetooth */
+       FEEDBACK_PATTERN_MOBILE_BT_WAITING,             /**< feedback pattern when pairing bluetooth */
+       FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE,         /**< feedback pattern when screen capture */
+       FEEDBACK_PATTERN_MOBILE_MMS,                    /**< feedback pattern when message state changed to MMS */
+       FEEDBACK_PATTERN_MOBILE_HOURLY_ALERT,           /**< feedback pattern when alert every hour on the hour */
+
+       FEEDBACK_PATTERN_MOBILE_SAFETY_ALERT,           /**< feedback pattern when safety alert from phone */
+       FEEDBACK_PATTERN_MOBILE_ACCIDENT_DETECT,        /**< feedback pattern when accident detect */
+       FEEDBACK_PATTERN_MOBILE_SEND_SOS_MESSAGE,       /**< feedback pattern when sending SOS message */
+       FEEDBACK_PATTERN_MOBILE_END_SOS_MESSAGE,        /**< feedback pattern when finishing SOS message */
+       FEEDBACK_PATTERN_MOBILE_EMERGENCY_BUZZER,       /**< feedback pattern when occurs emergency buzzer */
+       FEEDBACK_PATTERN_MOBILE_SAFETY_LOW_POWER,       /**< this pattern is a low power ringtone */
+       FEEDBACK_PATTERN_MOBILE_CMAS,                   /**< feedback pattern when alerting commercial mobile */
+
+       FEEDBACK_PATTERN_MOBILE_END,
+
+} feedback_pattern_mobile_e;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__FEEDBACK_IDS_MOBILE_H__
diff --git a/mobile/src/check.c b/mobile/src/check.c
new file mode 100644 (file)
index 0000000..7783487
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * libfeedback
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <vconf.h>
+
+#include "feedback.h"
+#include "feedback-ids-mobile.h"
+#include "profiles.h"
+#include "log.h"
+
+/* Temporary keys */
+#ifndef VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL
+#define VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL "db/setting/sound/vibrate_when_notification"
+#endif
+#ifndef VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL
+#define VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL "db/setting/sound/haptic_feedback_on"
+#endif
+
+
+static const char *mobile_str_type[] =
+{
+       "FEEDBACK_TYPE_NONE",
+       "FEEDBACK_TYPE_SOUND",
+       "FEEDBACK_TYPE_VIBRATION",
+       "FEEDBACK_TYPE_MOBILE_LED",
+};
+
+static const char *mobile_str_pattern[] =
+{
+       "FEEDBACK_PATTERN_TAP",
+       "FEEDBACK_PATTERN_SIP",
+       "FEEDBACK_PATTERN_KEY0",
+       "FEEDBACK_PATTERN_KEY1",
+       "FEEDBACK_PATTERN_KEY2",
+       "FEEDBACK_PATTERN_KEY3",
+       "FEEDBACK_PATTERN_KEY4",
+       "FEEDBACK_PATTERN_KEY5",
+       "FEEDBACK_PATTERN_KEY6",
+       "FEEDBACK_PATTERN_KEY7",
+       "FEEDBACK_PATTERN_KEY8",
+       "FEEDBACK_PATTERN_KEY9",
+       "FEEDBACK_PATTERN_KEY_STAR",
+       "FEEDBACK_PATTERN_KEY_SHARP",
+       "FEEDBACK_PATTERN_KEY_BACK",
+       "FEEDBACK_PATTERN_HOLD",
+       "FEEDBACK_PATTERN_HW_TAP",
+       "FEEDBACK_PATTERN_HW_HOLD",
+
+       "FEEDBACK_PATTERN_MESSAGE",
+       "FEEDBACK_PATTERN_EMAIL",
+       "FEEDBACK_PATTERN_WAKEUP",
+       "FEEDBACK_PATTERN_SCHEDULE",
+       "FEEDBACK_PATTERN_TIMER",
+       "FEEDBACK_PATTERN_GENERAL",
+
+       "FEEDBACK_PATTERN_POWERON",
+       "FEEDBACK_PATTERN_POWEROFF",
+       "FEEDBACK_PATTERN_CHARGERCONN",
+       "FEEDBACK_PATTERN_CHARGING_ERROR",
+       "FEEDBACK_PATTERN_FULLCHARGED",
+       "FEEDBACK_PATTERN_LOWBATT",
+       "FEEDBACK_PATTERN_LOCK",
+       "FEEDBACK_PATTERN_UNLOCK",
+       "FEEDBACK_PATTERN_VIBRATION_ON",
+       "FEEDBACK_PATTERN_SILENT_OFF",
+       "FEEDBACK_PATTERN_BT_CONNECTED",
+       "FEEDBACK_PATTERN_BT_DISCONNECTED",
+       "FEEDBACK_PATTERN_LIST_REORDER",
+       "FEEDBACK_PATTERN_LIST_SLIDER",
+       "FEEDBACK_PATTERN_VOLUME_KEY",
+
+       "FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE",
+       "FEEDBACK_PATTERN_MOBILE_SIP_FUNCTION",
+       "FEEDBACK_PATTERN_MOBILE_SIP_FJKEY",
+       "FEEDBACK_PATTERN_MOBILE_MAX_CHARACTER",
+       "FEEDBACK_PATTERN_MOBILE_MULTI_TAP",
+
+       "FEEDBACK_PATTERN_MOBILE_MESSAGE_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_EMAIL_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_WAKEUP_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_SCHEDULE_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_TIMER_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_GENERAL_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_SMART_ALERT",
+
+       "FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_CHARGING_ERROR_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_FULLCHARGED_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL",
+       "FEEDBACK_PATTERN_MOBILE_LOCK_SWIPE",
+       "FEEDBACK_PATTERN_MOBILE_UNLOCK_SWIPE",
+       "FEEDBACK_PATTERN_MOBILE_GEOMETRIC_LOCK",
+       "FEEDBACK_PATTERN_MOBILE_CALLCONNECT",
+       "FEEDBACK_PATTERN_MOBILE_DISCALLCONNECT",
+       "FEEDBACK_PATTERN_MOBILE_OUTGOING_CALL",
+       "FEEDBACK_PATTERN_MOBILE_MINUTEMINDER",
+       "FEEDBACK_PATTERN_MOBILE_BT_PAIRING",
+       "FEEDBACK_PATTERN_MOBILE_BT_WAITING",
+       "FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE",
+       "FEEDBACK_PATTERN_MOBILE_MMS",
+       "FEEDBACK_PATTERN_MOBILE_HOURLY_ALERT",
+
+       "FEEDBACK_PATTERN_MOBILE_SAFETY_ALERT",
+       "FEEDBACK_PATTERN_MOBILE_ACCIDENT_DETECT",
+       "FEEDBACK_PATTERN_MOBILE_SEND_SOS_MESSAGE",
+       "FEEDBACK_PATTERN_MOBILE_END_SOS_MESSAGE",
+       "FEEDBACK_PATTERN_MOBILE_EMERGENCY_BUZZER",
+       "FEEDBACK_PATTERN_MOBILE_SAFETY_LOW_POWER",
+       "FEEDBACK_PATTERN_MOBILE_CMAS",
+};
+
+static int callstatus;
+static int alert_callstatus;
+static int lock_sndstatus;
+static int camerastatus;
+static int shutter_sndstatus;
+static int noti_vibstatus;
+static int vib_level;
+static int noti_level;
+static int feedbackstatus;
+
+static void feedback_callstatus_cb(keynode_t *key, void* data)
+{
+       callstatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_alertstatus_cb(keynode_t *key, void* data)
+{
+       alert_callstatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_lock_sndstatus_cb(keynode_t *key, void* data)
+{
+       lock_sndstatus = vconf_keynode_get_bool(key);
+}
+
+static void feedback_camerastatus_cb(keynode_t *key, void* data)
+{
+       camerastatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_noti_vibstatus_cb(keynode_t *key, void* data)
+{
+       noti_vibstatus = vconf_keynode_get_bool(key);
+}
+
+static void feedback_vib_cb(keynode_t *key, void* data)
+{
+       vib_level = vconf_keynode_get_int(key);
+}
+
+static void feedback_noti_cb(keynode_t *key, void* data)
+{
+       noti_level = vconf_keynode_get_int(key);
+}
+
+static void feedback_feedbackstatus_cb(keynode_t *key, void* data)
+{
+       feedbackstatus = vconf_keynode_get_bool(key);
+}
+
+static void mobile_init(void)
+{
+       /* check call status */
+       if (vconf_get_int(VCONFKEY_CALL_STATE, &callstatus) < 0)
+               _W("VCONFKEY_CALL_STATE ==> FAIL!!");
+
+       /* alert option on call */
+       if (vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alert_callstatus) < 0)
+               _W("VCONFKEY_CISSAPPL_ON_CALL_INT ==> FAIL!!");
+
+       if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &lock_sndstatus) < 0)
+               _W("VCONFKEY_SETAPPL_SOUND_LOCK_BOOL ==> FAIL!!");
+
+       /* check camera status */
+       if (vconf_get_int(VCONFKEY_CAMERA_STATE, &camerastatus) < 0)
+               _W("VCONFKEY_CAMERA_STATE ==> FAIL!!");
+
+       /* shutter sound policy */
+       // This vconf is read just once, because this value is not changed in running time.
+       if (vconf_get_int(VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY, &shutter_sndstatus) < 0)
+               _W("VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY ==> FAIL!!");
+
+       /* check vibration status */
+       if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, &noti_vibstatus) < 0)
+               _W("VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL ==> FAIL!!");
+
+       /* check vib_level */
+       if (vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vib_level) < 0)
+               _W("VCONFKEY_FEEDBACK_VIBRATION_LEVEL_INT ==> FAIL!!");
+
+       /* check noti_level */
+       if (vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &noti_level) < 0)
+               _W("VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT ==> FAIL!!");
+
+       /* feedback Init */
+       if(vconf_get_bool(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, &feedbackstatus) < 0)
+               _W("VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL ==> FAIL!!");
+
+       /* add watch for status value */
+       vconf_notify_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, feedback_noti_vibstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, feedback_feedbackstatus_cb, NULL);
+}
+
+static void mobile_exit(void)
+{
+       /* remove watch */
+       vconf_ignore_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, feedback_noti_vibstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, feedback_feedbackstatus_cb);
+}
+
+static bool mobile_get_switched_pattern(int pattern, int *switched)
+{
+       if (!switched)
+               return false;
+
+       if (callstatus == VCONFKEY_CALL_OFF)
+               return false;
+
+       /* in case of call connected or connecting */
+       _D("Call status is connected or connecting.");
+       if (pattern == FEEDBACK_PATTERN_MESSAGE)
+               *switched = FEEDBACK_PATTERN_MOBILE_MESSAGE_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_EMAIL)
+               *switched = FEEDBACK_PATTERN_MOBILE_EMAIL_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_WAKEUP)
+               *switched = FEEDBACK_PATTERN_MOBILE_WAKEUP_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_SCHEDULE)
+               *switched = FEEDBACK_PATTERN_MOBILE_SCHEDULE_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_TIMER)
+               *switched = FEEDBACK_PATTERN_MOBILE_TIMER_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_GENERAL)
+               *switched = FEEDBACK_PATTERN_MOBILE_GENERAL_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_CHARGERCONN)
+               *switched = FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_CHARGING_ERROR)
+               *switched = FEEDBACK_PATTERN_MOBILE_CHARGING_ERROR_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_FULLCHARGED)
+               *switched = FEEDBACK_PATTERN_MOBILE_FULLCHARGED_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_LOWBATT)
+               *switched = FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL;
+
+       return true;
+}
+
+static bool mobile_get_always_alert_case(int type, int pattern)
+{
+       switch (pattern) {
+       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
+       case FEEDBACK_PATTERN_HOLD:
+               if (CHECK_VIBRATION(type) && feedbackstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE:
+       case FEEDBACK_PATTERN_MOBILE_SIP_FUNCTION:
+       case FEEDBACK_PATTERN_MOBILE_SIP_FJKEY:
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_MESSAGE:
+       case FEEDBACK_PATTERN_EMAIL:
+               if (CHECK_VIBRATION(type) && noti_vibstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_TIMER:
+       case FEEDBACK_PATTERN_MOBILE_TIMER_ON_CALL:
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WAKEUP:
+       case FEEDBACK_PATTERN_MOBILE_WAKEUP_ON_CALL:
+               return true;
+       case FEEDBACK_PATTERN_MOBILE_MESSAGE_ON_CALL:
+       case FEEDBACK_PATTERN_MOBILE_EMAIL_ON_CALL:
+       case FEEDBACK_PATTERN_MOBILE_GENERAL_ON_CALL:
+               if (alert_callstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_MOBILE_CHARGERCONN_ON_CALL:
+       case FEEDBACK_PATTERN_MOBILE_CHARGING_ERROR_ON_CALL:
+       case FEEDBACK_PATTERN_MOBILE_LOWBATT_ON_CALL:
+       case FEEDBACK_PATTERN_MOBILE_MMS:
+       case FEEDBACK_PATTERN_MOBILE_HOURLY_ALERT:
+               /* no matter sound profile */
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_MOBILE_SMART_ALERT:
+       case FEEDBACK_PATTERN_MOBILE_SEND_SOS_MESSAGE:
+       case FEEDBACK_PATTERN_MOBILE_END_SOS_MESSAGE:
+       case FEEDBACK_PATTERN_MOBILE_CMAS:
+       case FEEDBACK_PATTERN_MOBILE_OUTGOING_CALL:
+               return true;
+       case FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE:
+               if (CHECK_SOUND(type) && camerastatus && shutter_sndstatus)
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
+
+static bool mobile_get_always_off_case(int type, int pattern)
+{
+       int ret;
+
+       /* check if the state of voice recorder is recording */
+       if (vconf_get_int(VCONFKEY_SOUND_STATUS, &ret) < 0) {
+               _D("fail to get media sound status, status will be zero");
+               ret = 0;
+       }
+
+       if (CHECK_SOUND(type) && ret & VCONFKEY_SOUND_STATUS_AVRECORDING) {
+               _D("voice recording status is RECORDING");
+               return true;
+       }
+
+       switch (pattern) {
+       case FEEDBACK_PATTERN_TAP ... FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_HOLD ... FEEDBACK_PATTERN_HW_HOLD:
+       case FEEDBACK_PATTERN_MOBILE_SIP_BACKSPACE ... FEEDBACK_PATTERN_MOBILE_MAX_CHARACTER:
+               if (CHECK_SOUND(type) && !is_touch_sndstatus())
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
+               if (CHECK_SOUND(type) && !is_keytone_sndstatus())
+                       return true;
+               else if (CHECK_VIBRATION(type) && !feedbackstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_LOCK:
+       case FEEDBACK_PATTERN_UNLOCK:
+       case FEEDBACK_PATTERN_MOBILE_LOCK_SWIPE:
+       case FEEDBACK_PATTERN_MOBILE_UNLOCK_SWIPE:
+               if (CHECK_SOUND(type) && !lock_sndstatus)
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
+
+static int mobile_get_strength_type(int type, int pattern)
+{
+       if (CHECK_SOUND(type)) {
+               if (pattern == FEEDBACK_PATTERN_TAP)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_TOUCH;
+               else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_BACK)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_DIALER;
+               else if (pattern == FEEDBACK_PATTERN_VOLUME_KEY)
+                       return VOLUME_TYPE_RINGTONE;
+               else if (camerastatus && shutter_sndstatus && pattern == FEEDBACK_PATTERN_MOBILE_SCREEN_CAPTURE)
+                       return VOLUME_TYPE_FIXED;
+               else
+                       return VOLUME_TYPE_SYSTEM;
+       } else if (CHECK_VIBRATION(type)) {
+               if (pattern >= FEEDBACK_PATTERN_MESSAGE &&
+                   pattern <= FEEDBACK_PATTERN_GENERAL)
+                       return noti_level * HAPTIC_FEEDBACK_STEP;
+               else
+                       return vib_level * HAPTIC_FEEDBACK_STEP;
+       }
+
+       return -EINVAL;
+}
+
+static const struct profile_ops mobile_profile_ops = {
+       .profile               = "mobile",
+       .init                  = mobile_init,
+       .exit                  = mobile_exit,
+       .get_switched_pattern  = mobile_get_switched_pattern,
+       .get_always_alert_case = mobile_get_always_alert_case,
+       .get_always_off_case   = mobile_get_always_off_case,
+       .get_strength_type     = mobile_get_strength_type,
+       .max_type              = FEEDBACK_TYPE_MOBILE_END,
+       .max_pattern           = FEEDBACK_PATTERN_MOBILE_END,
+       .str_type              = mobile_str_type,
+       .str_pattern           = mobile_str_pattern,
+};
+
+PROFILE_OPS_REGISTER(&mobile_profile_ops);
index fee4ff90005bb566fb24c60ed88961d2619bd084..5e5682fcbc9de55e04a4f9f718c013723897c5c5 100644 (file)
@@ -53,11 +53,13 @@ cp %{SOURCE2} .
 %define ARCH emulator
 %endif
 
-%cmake \
 %if "%{?tizen_profile_name}" == "wearable"
-       -DMICRO_DD=YES \
+%define PROFILE wearable
+%else if "%{?tizen_profile_name}" == "mobile"
+%define PROFILE mobile
 %endif
-       . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=%{ARCH}
+
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=%{ARCH} -DPROFILE=%{PROFILE}
 make
 
 %install
diff --git a/src/common.h b/src/common.h
new file mode 100644 (file)
index 0000000..ddfae02
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+#include <stdbool.h>
+#include <errno.h>
+#include <mm_sound_private.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file common.h
+ * @brief This file contains the common information
+ */
+
+#ifndef __CONSTRUCTOR__
+#define __CONSTRUCTOR__ __attribute__ ((constructor))
+#endif
+
+#ifndef __DESTRUCTOR__
+#define __DESTRUCTOR__ __attribute__ ((destructor))
+#endif
+
+#ifndef __DD_LIST__
+#define __DD_LIST__
+#include <glib.h>
+typedef GList dd_list;
+#define DD_LIST_PREPEND(a, b)       \
+       a = g_list_prepend(a, b)
+#define DD_LIST_APPEND(a, b)        \
+       a = g_list_append(a, b)
+#define DD_LIST_REMOVE(a, b)        \
+       a = g_list_remove(a, b)
+#define DD_LIST_FOREACH(head, elem, node)   \
+       for (elem = head; elem && ((node = elem->data) != NULL); elem = elem->next, node = NULL)
+#endif
+
+#define FEEDBACK_DATA_DIR                      "/opt/usr/share/feedback"
+#define FEEDBACK_ORIGIN_DATA_DIR       "/usr/share/feedback"
+
+#define FEEDBACK_RETRY_CNT       1
+
+#define DEFAULT_VIB_LEVEL       3
+#define HAPTIC_FEEDBACK_STEP    20 /**< feedback max / slider step */
+
+int is_sound_mode(void);
+int is_touch_sndstatus(void);
+int is_keytone_sndstatus(void);
+int is_vibration_mode(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/dbus.h b/src/dbus.h
new file mode 100644 (file)
index 0000000..9710b59
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * feedback
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __DBUS_H__
+#define __DBUS_H__
+
+#include <dbus/dbus.h>
+
+/*
+ * Device daemon
+ */
+#define DEVICED_BUS_NAME                    "org.tizen.system.deviced"
+#define DEVICED_OBJECT_PATH                 "/Org/Tizen/System/DeviceD"
+#define DEVICED_INTERFACE_NAME              DEVICED_BUS_NAME
+/* Led service: play/stop led operations about led */
+#define DEVICED_PATH_LED                    DEVICED_OBJECT_PATH"/Led"
+#define DEVICED_INTERFACE_LED               DEVICED_INTERFACE_NAME".Led"
+/* Haptic service: operatioins about haptic */
+#define DEVICED_PATH_HAPTIC                 DEVICED_OBJECT_PATH"/Haptic"
+#define DEVICED_INTERFACE_HAPTIC            DEVICED_INTERFACE_NAME".haptic"
+
+struct dbus_byte {
+       const unsigned char *data;
+       int size;
+};
+
+int dbus_method_sync(const char *dest, const char *path,
+               const char *interface, const char *method,
+               const char *sig, char *param[]);
+#endif
index e135e078802cd10d07e23e651c9eb145b233c11d..8d351e4aa928046b4ce82e42742c7d941657999f 100644 (file)
 
 
 #include <stdio.h>
-#include <glib.h>
 
 #include "devices.h"
-#include "common.h"
 #include "log.h"
 
-#define DD_LIST_PREPEND(a, b)          \
-       a = g_list_prepend(a, b)
-#define DD_LIST_APPEND(a, b)           \
-       a = g_list_append(a, b)
-#define DD_LIST_REMOVE(a, b)           \
-       a = g_list_remove(a, b)
-#define DD_LIST_FOREACH(head, elem, node)      \
-       for (elem = head; elem && ((node = elem->data) != NULL); elem = elem->next, node = NULL)
-
-typedef GList dd_list;
 static dd_list *dev_head;
 
 void add_device(const struct device_ops *dev)
@@ -64,7 +52,7 @@ void devices_init(void)
        const struct device_ops *dev;
 
        DD_LIST_FOREACH(dev_head, elem, dev) {
-               _D("[%s] initialize", str_type[dev->type]);
+               _D("[%s] initialize", dev->name);
                if (dev->init)
                        dev->init();
        }
@@ -76,30 +64,45 @@ void devices_exit(void)
        const struct device_ops *dev;
 
        DD_LIST_FOREACH(dev_head, elem, dev) {
-               _D("[%s] deinitialize", str_type[dev->type]);
+               _D("[%s] deinitialize", dev->name);
                if (dev->exit)
                        dev->exit();
        }
 }
 
-void devices_play(int pattern)
+int devices_play(int pattern)
 {
        dd_list *elem;
        const struct device_ops *dev;
+       int ret, prev = -EPERM;
 
        DD_LIST_FOREACH(dev_head, elem, dev) {
-               if (dev->play)
-                       dev->play(pattern);
+               if (dev->play) {
+                       ret = dev->play(pattern);
+                       if ((prev < 0 && ret == 0) ||
+                           (prev == 0 && ret < 0))
+                               prev = 0;
+                       else if ((prev < 0 && ret == -ENOTSUP) ||
+                                (prev == -ENOTSUP && ret < 0))
+                               prev = -ENOTSUP;
+                       else
+                               prev = ret;
+               }
        }
+
+       return prev;
 }
 
-void devices_stop(void)
+int devices_stop(void)
 {
        dd_list *elem;
        const struct device_ops *dev;
+       int ret = -ENOTSUP;
 
        DD_LIST_FOREACH(dev_head, elem, dev) {
                if (dev->stop)
-                       dev->stop();
+                       ret = dev->stop();
        }
+
+       return ret;
 }
diff --git a/src/devices.h b/src/devices.h
new file mode 100644 (file)
index 0000000..2774967
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * libfeedback
+
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __DEVICES_H__
+#define __DEVICES_H__
+
+#include <stdbool.h>
+#include "common.h"
+
+struct device_ops {
+       int type;
+       const char *name;
+       void (*init) (void);
+       void (*exit) (void);
+       int (*play) (int);
+       int (*stop) (void);
+       int (*is_supported) (int, bool *);
+       int (*get_path) (int, char *, unsigned int);
+       int (*set_path) (int, char *);
+};
+
+void devices_init(void);
+void devices_exit(void);
+int devices_play(int pattern);
+int devices_stop(void);
+
+#define DEVICE_OPS_REGISTER(dev)       \
+static void __CONSTRUCTOR__ module_init(void)  \
+{      \
+       add_device(dev);        \
+}
+
+void add_device(const struct device_ops *dev);
+void remove_device(const struct device_ops *dev);
+const struct device_ops *find_device(int type);
+
+#endif
index f14ffefd13b938ebe2577cb5b6c5d704efa52d0b..273318d428eb52efdceb6f75211a78d6d9e02d63 100644 (file)
 #include <stdbool.h>
 #include <string.h>
 #include <limits.h>
-#include <vconf.h>
 
 #include "feedback.h"
-#include "common.h"
-#include "log.h"
+#include "profiles.h"
 #include "devices.h"
+#include "log.h"
 
 #ifndef API
 #define API __attribute__ ((visibility("default")))
 #endif
 
-int callstatus;
-int alert_callstatus;
-
 static bool binit;
 
-static void feedback_callstatus_cb(keynode_t *key, void* data)
+API int feedback_initialize(void)
 {
-       callstatus = vconf_keynode_get_int(key);
-}
-
-static void feedback_alertstatus_cb(keynode_t *key, void* data)
-{
-       alert_callstatus = vconf_keynode_get_int(key);
-}
+       if (binit)
+               return FEEDBACK_ERROR_NONE;
 
-static feedback_pattern_e get_alert_on_call_key(feedback_pattern_e pattern)
-{
-       switch(pattern) {
-       case FEEDBACK_PATTERN_MESSAGE:
-       case FEEDBACK_PATTERN_EMAIL:
-       case FEEDBACK_PATTERN_WAKEUP:
-       case FEEDBACK_PATTERN_SCHEDULE:
-       case FEEDBACK_PATTERN_TIMER:
-       case FEEDBACK_PATTERN_GENERAL:
-       case FEEDBACK_PATTERN_CHARGERCONN:
-       case FEEDBACK_PATTERN_CHARGING_ERROR:
-       case FEEDBACK_PATTERN_FULLCHARGED:
-       case FEEDBACK_PATTERN_LOWBATT:
-               return (feedback_pattern_e)(pattern+1);
-       default:
-               break;
+       if (!profile) {
+               _E("there is no valid profile module.");
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
        }
 
-       return pattern;
+       /* initialize device */
+       devices_init();
+
+       /* initialize profile feature */
+       if (profile->init)
+               profile->init();
+
+       binit = true;
+       return FEEDBACK_ERROR_NONE;
 }
 
-static void __DESTRUCTOR__ module_exit(void)
+API int feedback_deinitialize(void)
 {
        if (!binit)
-               return;
-
-       vconf_ignore_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb);
-       vconf_ignore_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb);
+               return FEEDBACK_ERROR_NOT_INITIALIZED;
 
        /* deinitialize device */
        devices_exit();
 
+       /* deinitialize profile feature */
+       if (profile->exit)
+               profile->exit();
+
        binit = false;
+       return FEEDBACK_ERROR_NONE;
 }
 
-API int feedback_initialize()
+API int feedback_play(feedback_pattern_e pattern)
 {
-       if (binit)
-               return FEEDBACK_ERROR_NONE;
-
-       /* check call status */
-       if (vconf_get_int(VCONFKEY_CALL_STATE, &callstatus) < 0)
-               _W("VCONFKEY_CALL_STATE ==> FAIL!!");
+       int err;
+       bool result;
+       int switched;
 
+       /* check initialize */
+       if (!binit) {
+               _E("Not initialized");
+               return FEEDBACK_ERROR_NOT_INITIALIZED;
+       }
 
-       /* alert option on call */
-       if (vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alert_callstatus) < 0)
-               _W("VCONFKEY_CISSAPPL_ON_CALL_INT ==> FAIL!!");
+       if (pattern <= FEEDBACK_PATTERN_NONE ||
+           pattern >= profile->max_pattern) {
+               _E("Invalid parameter : pattern(%d)", pattern);
+               return FEEDBACK_ERROR_INVALID_PARAMETER;
+       }
 
-       /* add watch for status value */
-       vconf_notify_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb, NULL);
-       vconf_notify_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb, NULL);
+       /* if you need to switch pattern */
+       if (profile->get_switched_pattern) {
+               result = profile->get_switched_pattern(pattern, &switched);
+               if (result) {
+                       _W("pattern is changed : (%s) -> (%s)",
+                                       profile->str_pattern[pattern], profile->str_pattern[switched]);
+                       pattern = switched;
+               }
+       }
 
-       /* initialize device */
-       devices_init();
+       /* play all device */
+       err = devices_play(pattern);
+       /**
+        * devices_play() returns error even if all devices are failed.
+        * It means if to play anything is successful,
+        * this function regards as success.
+        */
+       if (err == -ENOTSUP)
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
+       else if (err < 0)
+               return FEEDBACK_ERROR_OPERATION_FAILED;
 
-       binit = true;
        return FEEDBACK_ERROR_NONE;
 }
 
-API int feedback_deinitialize()
+API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern)
 {
-       return FEEDBACK_ERROR_NONE;
-}
+       const struct device_ops *dev;
+       int err;
+       bool result;
+       int switched;
 
-API int feedback_play(feedback_pattern_e pattern)
-{
        /* check initialize */
        if (!binit) {
                _E("Not initialized");
                return FEEDBACK_ERROR_NOT_INITIALIZED;
        }
 
-       if (pattern < FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
+       if (type <= FEEDBACK_TYPE_NONE ||
+           type >= profile->max_type) {
+               _E("Invalid parameter : type(%d)", type);
+               return FEEDBACK_ERROR_INVALID_PARAMETER;
+       }
+
+       if (pattern <= FEEDBACK_PATTERN_NONE ||
+           pattern >= profile->max_pattern) {
                _E("Invalid parameter : pattern(%d)", pattern);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       if (pattern == FEEDBACK_PATTERN_NONE) {
-               _D("pattern is NONE");
-               return FEEDBACK_ERROR_NONE;
+       /* if you need to switch pattern */
+       if (profile->get_switched_pattern) {
+               result = profile->get_switched_pattern(pattern, &switched);
+               if (result) {
+                       _W("pattern is changed : (%s) -> (%s)",
+                                       profile->str_pattern[pattern], profile->str_pattern[switched]);
+                       pattern = switched;
+               }
        }
 
-       /* in case of call connected or connecting */
-       if (callstatus != VCONFKEY_CALL_OFF) {
-               pattern = get_alert_on_call_key(pattern);
-               _D("Call status is connected or connecting. pattern changed : %s", str_pattern[pattern]);
+       /* play proper device */
+       dev = find_device(type);
+       if (!dev) {
+               _E("Not supported device : type(%s)", profile->str_type[type]);
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
        }
 
-       /* play all device */
-       devices_play(pattern);
+       err = dev->play(pattern);
+       if (err == -ENOTSUP)
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
+       else if (err == -ECOMM)
+               return FEEDBACK_ERROR_PERMISSION_DENIED;
+       else
+               return FEEDBACK_ERROR_OPERATION_FAILED;
 
        return FEEDBACK_ERROR_NONE;
 }
 
-API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern)
+API int feedback_stop(void)
 {
-       const struct device_ops *dev;
        int err;
 
        /* check initialize */
@@ -152,75 +175,106 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern)
                return FEEDBACK_ERROR_NOT_INITIALIZED;
        }
 
-       if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
-               _E("Invalid parameter : type(%d)", type);
-               return FEEDBACK_ERROR_INVALID_PARAMETER;
+       /* stop all device */
+       err = devices_stop();
+       if (err == -ENOTSUP)
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
+       else if (err == -ECOMM)
+               return FEEDBACK_ERROR_PERMISSION_DENIED;
+       else
+               return FEEDBACK_ERROR_OPERATION_FAILED;
+
+       return FEEDBACK_ERROR_NONE;
+}
+
+API int feedback_is_supported_pattern(feedback_type_e type, feedback_pattern_e pattern, bool *status)
+{
+       const struct device_ops *dev;
+       bool supported;
+       int err;
+       bool result;
+       int switched;
+
+       /* check initialize */
+       if (!binit) {
+               _E("Not initialized");
+               return FEEDBACK_ERROR_NOT_INITIALIZED;
        }
 
-       if (pattern < FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
-               _E("Invalid parameter : pattern(%d)", pattern);
+       if (!status) {
+               _E("Invalid parameter : status(NULL)");
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       if (pattern == FEEDBACK_PATTERN_NONE) {
-               _D("pattern is NONE");
-               return FEEDBACK_ERROR_NONE;
+       if (type <= FEEDBACK_TYPE_NONE ||
+           type >= profile->max_type) {
+               _E("Invalid parameter : type(%d)", type);
+               return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       /* in case of call connected or connecting */
-       if (callstatus != VCONFKEY_CALL_OFF) {
-               pattern = get_alert_on_call_key(pattern);
-               _D("Call status is connected or connecting. pattern changed : %s", str_pattern[pattern]);
+       if (pattern <= FEEDBACK_PATTERN_NONE ||
+           pattern >= profile->max_pattern) {
+               _E("Invalid parameter : pattern(%d)", pattern);
+               return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       /* should play led regardless of sound or vibration */
-       dev = find_device(FEEDBACK_TYPE_LED);
-       if (dev) {
-               err = dev->play(pattern);
-               if (err < 0)
-                       _E("feedback_play_led is failed");
+       /* if you need to switch pattern */
+       if (profile->get_switched_pattern) {
+               result = profile->get_switched_pattern(pattern, &switched);
+               if (result) {
+                       _W("pattern is changed : (%s) -> (%s)",
+                                       profile->str_pattern[pattern], profile->str_pattern[switched]);
+                       pattern = switched;
+               }
        }
 
-       if (type == FEEDBACK_TYPE_LED)
-               return FEEDBACK_ERROR_NONE;
-
        /* play proper device */
        dev = find_device(type);
-       if (dev) {
-               err = dev->play(pattern);
-               if (err < 0)
-                       _E("fail to play sound");
+       if (!dev) {
+               _E("Not supported device : type(%s)", profile->str_type[type]);
+               return FEEDBACK_ERROR_NOT_SUPPORTED;
+       }
+
+       err = dev->is_supported(pattern, &supported);
+       if (err < 0) {
+               _E("fail to invoke is_supported() : pattern(%s)", profile->str_pattern[pattern]);
+               return FEEDBACK_ERROR_OPERATION_FAILED;
        }
 
        return FEEDBACK_ERROR_NONE;
 }
 
+/* Internal APIs */
 API int feedback_play_type_by_name(char *type, char *pattern)
 {
        feedback_type_e etype;
        feedback_pattern_e epattern;
+       int type_max;
+       int pattern_max;
 
        if (!type || !pattern) {
                _E("Invalid parameter : type(%x), pattern(%x)", type, pattern);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       for (etype = FEEDBACK_TYPE_NONE; etype < FEEDBACK_TYPE_END; ++etype) {
-               if (!strncmp(type, str_type[etype], strlen(type)))
+       type_max = profile->max_type;
+       for (etype = 0; etype < type_max; ++etype) {
+               if (!strncmp(type, profile->str_type[etype], strlen(type)))
                        break;
        }
 
-       if (etype == FEEDBACK_TYPE_END) {
+       if (etype == type_max) {
                _E("Invalid parameter : type(%s)", type);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       for (epattern = 0; epattern < FEEDBACK_PATTERN_END; ++epattern) {
-               if (!strncmp(pattern, str_pattern[epattern], strlen(pattern)))
+       pattern_max = profile->max_pattern;
+       for (epattern = 0; epattern < pattern_max; ++epattern) {
+               if (!strncmp(pattern, profile->str_pattern[epattern], strlen(pattern)))
                        break;
        }
 
-       if (epattern == FEEDBACK_PATTERN_END) {
+       if (epattern == pattern_max) {
                _E("Invalid parameter : pattern(%d)", pattern);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
@@ -228,20 +282,6 @@ API int feedback_play_type_by_name(char *type, char *pattern)
        return feedback_play_type(etype, epattern);
 }
 
-API int feedback_stop(void)
-{
-       /* check initialize */
-       if (!binit) {
-               _E("Not initialized");
-               return FEEDBACK_ERROR_NOT_INITIALIZED;
-       }
-
-       /* stop all device */
-       devices_stop();
-
-       return FEEDBACK_ERROR_NONE;
-}
-
 API int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char** path)
 {
        const struct device_ops *dev;
@@ -253,12 +293,14 @@ API int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e patt
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
+       if (type <= FEEDBACK_TYPE_NONE ||
+           type >= profile->max_type) {
                _E("Invalid parameter : type(%d)", type);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
+       if (pattern <= FEEDBACK_PATTERN_NONE ||
+           pattern >= profile->max_pattern) {
                _E("Invalid parameter : pattern(%d)", pattern);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
@@ -280,12 +322,14 @@ API int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e patt
        const struct device_ops *dev;
        int err;
 
-       if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) {
+       if (type <= FEEDBACK_TYPE_NONE ||
+           type >= profile->max_type) {
                _E("Invalid parameter : type(%d)", type);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
 
-       if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= FEEDBACK_PATTERN_END) {
+       if (pattern <= FEEDBACK_PATTERN_NONE ||
+           pattern >= profile->max_pattern) {
                _E("Invalid parameter : pattern(%d)", pattern);
                return FEEDBACK_ERROR_INVALID_PARAMETER;
        }
diff --git a/src/log.h b/src/log.h
new file mode 100644 (file)
index 0000000..d07bb81
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,36 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __LOG_H__
+#define __LOG_H__
+
+#define FEATURE_FEEDBACK_DLOG
+
+#ifdef FEATURE_FEEDBACK_DLOG
+       #define LOG_TAG "FEEDBACK"
+       #include <dlog.h>
+       #define _D(fmt, args...)                SLOGD(fmt, ##args)
+       #define _W(fmt, args...)                SLOGW(fmt, ##args)
+       #define _E(fmt, args...)                SLOGE(fmt, ##args)
+#else
+       #define _D(x, ...)
+       #define _W(x, ...)
+       #define _E(x, ...)
+#endif
+
+#endif //__LOG_H__
diff --git a/src/profiles.c b/src/profiles.c
new file mode 100644 (file)
index 0000000..1f7f2f9
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * deviced
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <limits.h>
+
+#include "profiles.h"
+#include "log.h"
+
+static dd_list *profile_head;
+
+void add_profile(const struct profile_ops *ops)
+{
+       DD_LIST_APPEND(profile_head, (struct profile_ops*)ops);
+}
+
+void remove_profile(const struct profile_ops *ops)
+{
+       DD_LIST_REMOVE(profile_head, (struct profile_ops*)ops);
+}
diff --git a/src/profiles.h b/src/profiles.h
new file mode 100644 (file)
index 0000000..786b4c7
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * libfeedback
+
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __PROFILES_H__
+#define __PROFILES_H__
+
+#include <stdbool.h>
+#include "common.h"
+
+struct profile_ops {
+       const char *profile;
+       void (*init) (void);
+       void (*exit) (void);
+       bool (*get_switched_pattern)(int pattern, int *switched);
+       bool (*get_always_alert_case)(int type, int pattern);
+       bool (*get_always_off_case)(int type, int pattern);
+       int (*get_strength_type)(int type, int pattern);
+       const int max_type;
+       const int max_pattern;
+       const char **str_type;
+       const char **str_pattern;
+};
+
+#define PROFILE_OPS_REGISTER(ops)      \
+       const struct profile_ops *profile = ops
+
+extern const struct profile_ops *profile;
+
+#define CHECK_VIBRATION(type)   (type == FEEDBACK_TYPE_VIBRATION)
+#define CHECK_SOUND(type)       (type == FEEDBACK_TYPE_SOUND)
+
+#endif
index 0d14b2243b953b3f13672f5a603d8ca2d70d0c16..49fba53f747a83c76f3698b19aebc98656cbd190 100644 (file)
 #include <mm_sound_private.h>
 
 #include "feedback-ids.h"
-#include "common.h"
-#include "log.h"
+#include "profiles.h"
 #include "devices.h"
+#include "log.h"
 #include "xmlparser.h"
 
 #define SOUND_XML                                      "/usr/share/feedback/sound.xml"
 
+/* Temporary keys */
+#ifndef VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL
+#define VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL "db/setting/sound/button_sounds"
+#endif
+
 static int sndstatus;
 static int touch_sndstatus;
-static int lock_sndstatus;
-static int camerastatus;
-static int shutter_sndstatus;
+static int keytone_sndstatus;
 
 static xmlDocPtr v_doc;
 
-static char sound_file[FEEDBACK_PATTERN_END][NAME_MAX];
+static char sound_file[FEEDBACK_PATTERN_END][PATH_MAX];
 
 inline int is_sound_mode(void)
 {
        return sndstatus;
 }
 
-static void feedback_touch_sndstatus_cb(keynode_t *key, void* data)
-{
-       touch_sndstatus = vconf_keynode_get_bool(key);
-}
-
-static void feedback_lock_sndstatus_cb(keynode_t *key, void* data)
-{
-       lock_sndstatus = vconf_keynode_get_bool(key);
-}
-
-static void feedback_camerastatus_cb(keynode_t *key, void* data)
+inline int is_touch_sndstatus(void)
 {
-       camerastatus = vconf_keynode_get_int(key);
+       return touch_sndstatus;
 }
 
-static volume_type_t get_volume_type(feedback_pattern_e pattern)
+inline int is_keytone_sndstatus(void)
 {
-       if (pattern == FEEDBACK_PATTERN_TAP)
-               return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_TOUCH;
-       else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_BACK)
-               return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_DIALER;
-       else if (pattern == FEEDBACK_PATTERN_VOLUME_KEY)
-               return VOLUME_TYPE_RINGTONE;
-       else if (camerastatus && shutter_sndstatus && pattern == FEEDBACK_PATTERN_SCREEN_CAPTURE)
-               return VOLUME_TYPE_FIXED;
-
-       return VOLUME_TYPE_SYSTEM;
+       return keytone_sndstatus;
 }
 
-static bool get_always_alert_case(feedback_pattern_e pattern)
+static void feedback_touch_sndstatus_cb(keynode_t *key, void* data)
 {
-       switch (pattern) {
-       case FEEDBACK_PATTERN_WAKEUP:
-       case FEEDBACK_PATTERN_WAKEUP_ON_CALL:
-               return true;
-       case FEEDBACK_PATTERN_MESSAGE_ON_CALL:
-       case FEEDBACK_PATTERN_EMAIL_ON_CALL:
-       case FEEDBACK_PATTERN_GENERAL_ON_CALL:
-               if (alert_callstatus)
-                       return true;
-               break;
-       case FEEDBACK_PATTERN_SMART_ALERT:
-       case FEEDBACK_PATTERN_SEND_SOS_MESSAGE:
-       case FEEDBACK_PATTERN_END_SOS_MESSAGE:
-       case FEEDBACK_PATTERN_CMAS:
-               return true;
-       case FEEDBACK_PATTERN_SCREEN_CAPTURE:
-               if (camerastatus && shutter_sndstatus)
-                       return true;
-               break;
-       case FEEDBACK_PATTERN_OUTGOING_CALL:
-               return true;
-       default:
-               break;
-       }
-       return false;
+       touch_sndstatus = vconf_keynode_get_bool(key);
 }
 
-static bool get_always_off_case(feedback_pattern_e pattern)
+static void feedback_keytone_sndstatus_cb(keynode_t *key, void* data)
 {
-       switch (pattern) {
-       case FEEDBACK_PATTERN_TAP ... FEEDBACK_PATTERN_MAX_CHARACTER:
-       case FEEDBACK_PATTERN_HOLD ... FEEDBACK_PATTERN_HW_HOLD:
-               if (!touch_sndstatus)
-                       return true;
-               break;
-       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
-               break;
-       case FEEDBACK_PATTERN_LOCK:
-       case FEEDBACK_PATTERN_UNLOCK:
-       case FEEDBACK_PATTERN_LOCK_SWIPE:
-       case FEEDBACK_PATTERN_UNLOCK_SWIPE:
-               if (!lock_sndstatus)
-                       return true;
-               break;
-       default:
-               break;
-       }
-       return false;
+       keytone_sndstatus = vconf_keynode_get_bool(key);
 }
 
 static int get_xml_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlData **data)
@@ -136,7 +78,8 @@ static int get_xml_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlDat
        xmlNodePtr cur;
        struct xmlData *retData;
 
-       cur = xml_find(doc, SOUND_STR, (const xmlChar*)str_pattern[pattern]);
+       cur = xml_find(doc, SOUND_STR,
+                       (const xmlChar*)profile->str_pattern[pattern]);
        /* This pattern does not have sound file to play */
        if (cur == NULL)
                return -ENOENT;
@@ -172,30 +115,19 @@ static void sound_init(void)
        if (vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &touch_sndstatus) < 0)
                _W("VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL ==> FAIL!!");
 
-       if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &lock_sndstatus) < 0)
-               _W("VCONFKEY_SETAPPL_SOUND_LOCK_BOOL ==> FAIL!!");
-
-       /* check camera status */
-       if (vconf_get_int(VCONFKEY_CAMERA_STATE, &camerastatus) < 0)
-               _W("VCONFKEY_CAMERA_STATE ==> FAIL!!");
-
-       /* shutter sound policy */
-       // This vconf is read just once, because this value is not changed in running time.
-       if (vconf_get_int(VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY, &shutter_sndstatus) < 0)
-               _W("VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY ==> FAIL!!");
+       if (vconf_get_bool(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, &keytone_sndstatus) < 0)
+               _W("VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL ==> FAIL!!");
 
        /* add watch for status value */
        vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb, NULL);
-       vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb, NULL);
-       vconf_notify_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb, NULL);
 }
 
 static void sound_exit(void)
 {
        /* remove watch */
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb);
-       vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb);
-       vconf_ignore_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb);
 
        if (v_doc) {
                xml_close(v_doc);
@@ -209,6 +141,7 @@ static int sound_play(feedback_pattern_e pattern)
        int retry = FEEDBACK_RETRY_CNT, ret;
        char *path;
        struct xmlData *data = NULL;
+       int level;
 
        if (!v_doc) {
                _E("Not initialize");
@@ -220,27 +153,18 @@ static int sound_play(feedback_pattern_e pattern)
                sndstatus = 0;
        }
 
-       if (sndstatus == 0 && !get_always_alert_case(pattern)) {
+       if (sndstatus == 0 && profile->get_always_alert_case &&
+           !profile->get_always_alert_case(FEEDBACK_TYPE_SOUND, pattern)) {
                _D("Sound condition is OFF (sndstatus : %d)", sndstatus);
                return 0;
        }
 
-       if (sndstatus && get_always_off_case(pattern)) {
+       if (sndstatus && profile->get_always_off_case &&
+           profile->get_always_off_case(FEEDBACK_TYPE_SOUND, pattern)) {
                _D("Sound always off condition");
                return 0;
        }
 
-       /* check if the state of voice recorder is recording */
-       if (vconf_get_int(VCONFKEY_SOUND_STATUS, &ret) < 0) {
-               _D("fail to get media sound status, status will be zero");
-               ret = 0;
-       }
-
-       if (ret & VCONFKEY_SOUND_STATUS_AVRECORDING) {
-               _D("voice recording status is RECORDING");
-               return 0;
-       }
-
        /* check whether there is a user defined file */
        path = sound_file[pattern];
 
@@ -248,8 +172,8 @@ static int sound_play(feedback_pattern_e pattern)
        if (!(*path)) {
                ret = get_xml_data(v_doc, pattern, &data);
                if (ret == -ENOENT) {
-                       _D("No sound case(%s)", str_pattern[pattern]);
-                       return 0;
+                       _E("No sound case(%s)", profile->str_pattern[pattern]);
+                       return -ENOTSUP;
                }
 
                if (ret < 0) {
@@ -258,9 +182,9 @@ static int sound_play(feedback_pattern_e pattern)
                }
 
                if (!data->data) {
-                       _D("No sound case(%s)", str_pattern[pattern]);
+                       _E("No sound case(%s)", profile->str_pattern[pattern]);
                        release_xml_data(data);
-                       return 0;
+                       return -ENOTSUP;
                }
 
                path = data->data;
@@ -268,12 +192,17 @@ static int sound_play(feedback_pattern_e pattern)
 
        if (stat(path, &buf)) {
                _E("%s is not presents", path);
-               return -ENOENT;
+               return -ENOTSUP;
        }
 
        /* play sound file */
        do {
-               ret = mm_sound_play_keysound(path, get_volume_type(pattern));
+               if (profile->get_strength_type)
+                       level = profile->get_strength_type(FEEDBACK_TYPE_SOUND, pattern);
+               else
+                       level = VOLUME_TYPE_SYSTEM;
+
+               ret = mm_sound_play_keysound(path, level);
                if (ret == MM_ERROR_NONE) {
                        _D("Play success! SND filename is %s", path);
                        release_xml_data(data);
@@ -286,6 +215,66 @@ static int sound_play(feedback_pattern_e pattern)
        return -EPERM;
 }
 
+static int sound_is_supported(feedback_pattern_e pattern, bool *supported)
+{
+       struct stat buf;
+       char *path;
+       struct xmlData *data = NULL;
+       int ret;
+
+       if (!supported) {
+               _E("Invalid parameter : supported(NULL)");
+               return -EINVAL;
+       }
+
+       if (!v_doc) {
+               _E("Not initialize");
+               return -EPERM;
+       }
+
+       /* check whether there is a user defined file */
+       path = sound_file[pattern];
+
+       /* if not */
+       if (!(*path)) {
+               ret = get_xml_data(v_doc, pattern, &data);
+               if (ret == -ENOENT) {
+                       _D("No sound case(%s)", profile->str_pattern[pattern]);
+                       goto out;
+               }
+
+               if (ret < 0) {
+                       _E("get_xml_data fail");
+                       return -EPERM;
+               }
+
+               if (!data->data) {
+                       _D("No sound case(%s)", profile->str_pattern[pattern]);
+                       goto out;
+               }
+
+               path = data->data;
+       }
+
+       if (stat(path, &buf)) {
+               _E("%s is not presents", path);
+               release_xml_data(data);
+               return -ENOENT;
+       }
+
+       release_xml_data(data);
+
+       *supported = true;
+       return 0;
+
+out:
+       if (data)
+               release_xml_data(data);
+
+       *supported = false;
+       return 0;
+}
+
 static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen)
 {
        char *cur_path;
@@ -303,7 +292,8 @@ static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int bu
        }
 
        if (!cur_path) {
-               _E("This pattern(%s) in sound type is not supported to play", str_pattern[pattern]);
+               _E("This pattern(%s) in sound type is not supported to play",
+                               profile->str_pattern[pattern]);
                cur_path = "NULL";
                ret = -ENOENT;
        }
@@ -335,15 +325,18 @@ static int sound_set_path(feedback_pattern_e pattern, char *path)
        else
                memset(ppath, 0, NAME_MAX);
 
-       _D("The file of pattern(%s) is changed to [%s]", str_pattern[pattern], path);
+       _D("The file of pattern(%s) is changed to [%s]",
+                       profile->str_pattern[pattern], path);
        return 0;
 }
 
 static const struct device_ops sound_device_ops = {
        .type = FEEDBACK_TYPE_SOUND,
+       .name = "Sound",
        .init = sound_init,
        .exit = sound_exit,
        .play = sound_play,
+       .is_supported = sound_is_supported,
        .get_path = sound_get_path,
        .set_path = sound_set_path,
 };
diff --git a/src/str.c b/src/str.c
deleted file mode 100644 (file)
index 13c2b53..0000000
--- a/src/str.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-
-const char *str_type[] =
-{
-       "FEEDBACK_TYPE_NONE",
-       "FEEDBACK_TYPE_SOUND",
-       "FEEDBACK_TYPE_VIBRATION",
-       "FEEDBACK_TYPE_LED",
-       "FEEDBACK_TYPE_END",
-};
-
-const char *str_pattern[] =
-{
-       "FEEDBACK_PATTERN_TAP",
-       "FEEDBACK_PATTERN_SIP",
-       "FEEDBACK_PATTERN_SIP_BACKSPACE",
-       "FEEDBACK_PATTERN_SIP_FUNCTION",
-       "FEEDBACK_PATTERN_SIP_FJKEY",
-       "FEEDBACK_PATTERN_MAX_CHARACTER",
-       "FEEDBACK_PATTERN_KEY0",
-       "FEEDBACK_PATTERN_KEY1",
-       "FEEDBACK_PATTERN_KEY2",
-       "FEEDBACK_PATTERN_KEY3",
-       "FEEDBACK_PATTERN_KEY4",
-       "FEEDBACK_PATTERN_KEY5",
-       "FEEDBACK_PATTERN_KEY6",
-       "FEEDBACK_PATTERN_KEY7",
-       "FEEDBACK_PATTERN_KEY8",
-       "FEEDBACK_PATTERN_KEY9",
-       "FEEDBACK_PATTERN_KEY_STAR",
-       "FEEDBACK_PATTERN_KEY_SHARP",
-       "FEEDBACK_PATTERN_KEY_BACK",
-       "FEEDBACK_PATTERN_HOLD",
-       "FEEDBACK_PATTERN_MULTI_TAP",
-       "FEEDBACK_PATTERN_HW_TAP",
-       "FEEDBACK_PATTERN_HW_HOLD",
-
-       "FEEDBACK_PATTERN_MESSAGE",
-       "FEEDBACK_PATTERN_MESSAGE_ON_CALL",
-       "FEEDBACK_PATTERN_EMAIL",
-       "FEEDBACK_PATTERN_EMAIL_ON_CALL",
-       "FEEDBACK_PATTERN_WAKEUP",
-       "FEEDBACK_PATTERN_WAKEUP_ON_CALL",
-       "FEEDBACK_PATTERN_SCHEDULE",
-       "FEEDBACK_PATTERN_SCHEDULE_ON_CALL",
-       "FEEDBACK_PATTERN_TIMER",
-       "FEEDBACK_PATTERN_TIMER_ON_CALL",
-       "FEEDBACK_PATTERN_GENERAL",
-       "FEEDBACK_PATTERN_GENERAL_ON_CALL",
-       "FEEDBACK_PATTERN_SMART_ALERT",
-
-       "FEEDBACK_PATTERN_POWERON",
-       "FEEDBACK_PATTERN_POWEROFF",
-       "FEEDBACK_PATTERN_CHARGERCONN",
-       "FEEDBACK_PATTERN_CHARGERCONN_ON_CALL",
-       "FEEDBACK_PATTERN_CHARGING_ERROR",
-       "FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL",
-       "FEEDBACK_PATTERN_FULLCHARGED",
-       "FEEDBACK_PATTERN_FULLCHARGED_ON_CALL",
-       "FEEDBACK_PATTERN_LOWBATT",
-       "FEEDBACK_PATTERN_LOWBATT_ON_CALL",
-       "FEEDBACK_PATTERN_LOCK",
-       "FEEDBACK_PATTERN_UNLOCK",
-       "FEEDBACK_PATTERN_LOCK_SWIPE",
-       "FEEDBACK_PATTERN_UNLOCK_SWIPE",
-       "FEEDBACK_PATTERN_GEOMETRIC_LOCK",
-       "FEEDBACK_PATTERN_CALLCONNECT",
-       "FEEDBACK_PATTERN_DISCALLCONNECT",
-       "FEEDBACK_PATTERN_OUTGOING_CALL",
-       "FEEDBACK_PATTERN_MINUTEMINDER",
-       "FEEDBACK_PATTERN_VIBRATION_ON",
-       "FEEDBACK_PATTERN_SILENT_OFF",
-       "FEEDBACK_PATTERN_BT_CONNECTED",
-       "FEEDBACK_PATTERN_BT_DISCONNECTED",
-       "FEEDBACK_PATTERN_BT_PAIRING",
-       "FEEDBACK_PATTERN_BT_WAITING",
-       "FEEDBACK_PATTERN_SCREEN_CAPTURE",
-       "FEEDBACK_PATTERN_LIST_REORDER",
-       "FEEDBACK_PATTERN_LIST_SLIDER",
-       "FEEDBACK_PATTERN_VOLUME_KEY",
-       "FEEDBACK_PATTERN_MMS",
-       "FEEDBACK_PATTERN_HOURLY_ALERT",
-
-       "FEEDBACK_PATTERN_SAFETY_ALERT",
-       "FEEDBACK_PATTERN_ACCIDENT_DETECT",
-       "FEEDBACK_PATTERN_SEND_SOS_MESSAGE",
-       "FEEDBACK_PATTERN_END_SOS_MESSAGE",
-       "FEEDBACK_PATTERN_EMERGENCY_BUZZER",
-       "FEEDBACK_PATTERN_SAFETY_LOW_POWER",
-       "FEEDBACK_PATTERN_CMAS",
-       "FEEDBACK_PATTERN_SPEED_UP",
-       "FEEDBACK_PATTERN_SLOW_DOWN",
-       "FEEDBACK_PATTERN_KEEP_THIS_PACE",
-       "FEEDBACK_PATTERN_GOAL_ACHIEVED",
-       "FEEDBACK_PATTERN_EXERCISE_COUNT",
-       "FEEDBACK_PATTERN_START_CUE",
-       "FEEDBACK_PATTERN_HEALTH_PACE",
-       "FEEDBACK_PATTERN_INACTIVE_TIME",
-       "FEEDBACK_PATTERN_MEASURING_SUCCESS",
-       "FEEDBACK_PATTERN_MEASURING_FAILURE",
-       "FEEDBACK_PATTERN_UV_PROCESSING",
-       "FEEDBACK_PATTERN_SHEALTH_START",
-       "FEEDBACK_PATTERN_SHEALTH_PAUSE",
-       "FEEDBACK_PATTERN_SHEALTH_STOP",
-       "FEEDBACK_PATTERN_3RD_APPLICATION",
-};
index b212597ce37ab8f6205e5da31742a1f99d214247..8aae412ea5d0735c17ec284436bc6fb0a281380b 100644 (file)
 #include <sys/stat.h>
 
 #include "feedback-ids.h"
-#include "common.h"
-#include "log.h"
+#include "profiles.h"
 #include "devices.h"
-#include "xmlparser.h"
+#include "log.h"
 #include "dbus.h"
 
-#define DEFAULT_VIB_LEVEL                      3
-#define HAPTIC_FEEDBACK_STEP           20 /**< feedback max / slider step */
-
 #define HAPTIC_DEVICE                          0
 
 enum haptic_priority
@@ -54,21 +50,22 @@ enum haptic_iteration
 
 #define METHOD_OPEN                 "OpenDevice"
 #define METHOD_CLOSE                "CloseDevice"
-#define METHOD_VIBRATE_BUFFER       "VibrateBuffer"
 #define METHOD_VIBRATE_MONOTONE     "VibrateMonotone"
 #define METHOD_STOP                 "StopDevice"
 
 #define DEFAULT_DURATION            100
 
 static int vibstatus;
-static int vib_level;
-static int noti_level;
 
 static unsigned int v_handle;
-static xmlDocPtr v_doc;
 
 static char haptic_file[FEEDBACK_PATTERN_END][NAME_MAX];
 
+inline int is_vibration_mode(void)
+{
+       return vibstatus;
+}
+
 static int haptic_open(void)
 {
        char *arr[1];
@@ -120,37 +117,6 @@ static int haptic_vibrate_monotone(unsigned int handle,
                        "uiii", arr);
 }
 
-static int haptic_vibrate_buffer(unsigned int handle,
-                                                               const unsigned char *buffer,
-                                                               int size,
-                                                               int iteration,
-                                                               int feedback,
-                                                               int priority)
-{
-       char *arr[6];
-       char buf_handle[32];
-       char buf_iteration[32];
-       char buf_feedback[32];
-       char buf_priority[32];
-       struct dbus_byte bytes;
-
-       snprintf(buf_handle, sizeof(buf_handle), "%u", handle);
-       arr[0] = buf_handle;
-       bytes.size = size;
-       bytes.data = buffer;
-       arr[2] = (char*)&bytes;
-       snprintf(buf_iteration, sizeof(buf_iteration), "%d", iteration);
-       arr[3] = buf_iteration;
-       snprintf(buf_feedback, sizeof(buf_feedback), "%d", feedback);
-       arr[4] = buf_feedback;
-       snprintf(buf_priority, sizeof(buf_priority), "%d", priority);
-       arr[5] = buf_priority;
-
-       return dbus_method_sync(DEVICED_BUS_NAME, DEVICED_PATH_HAPTIC,
-                       DEVICED_INTERFACE_HAPTIC, METHOD_VIBRATE_BUFFER,
-                       "uayiii", arr);
-}
-
 static int haptic_vibrate_stop(unsigned int handle)
 {
        char *arr[1];
@@ -164,63 +130,6 @@ static int haptic_vibrate_stop(unsigned int handle)
                        "u", arr);
 }
 
-static unsigned char* convert_file_to_buffer(const char *file_name, int *size)
-{
-       FILE *pf;
-       long file_size;
-       unsigned char *pdata = NULL;
-
-       if (!file_name)
-               return NULL;
-
-       /* Get File Stream Pointer */
-       pf = fopen(file_name, "rb");
-       if (!pf) {
-               _E("fopen failed : %s", strerror(errno));
-               return NULL;
-       }
-
-       if (fseek(pf, 0, SEEK_END))
-               goto error;
-
-       file_size = ftell(pf);
-       if (fseek(pf, 0, SEEK_SET))
-               goto error;
-
-       if (file_size < 0)
-               goto error;
-
-       pdata = (unsigned char*)malloc(file_size);
-       if (!pdata)
-               goto error;
-
-       if (fread(pdata, 1, file_size, pf) != file_size)
-               goto err_free;
-
-       fclose(pf);
-       *size = file_size;
-       return pdata;
-
-err_free:
-       free(pdata);
-
-error:
-       fclose(pf);
-
-       _E("failed to convert file to buffer (%s)", strerror(errno));
-       return NULL;
-}
-
-static void feedback_vib_cb(keynode_t *key, void* data)
-{
-       vib_level = vconf_keynode_get_int(key);
-}
-
-static void feedback_noti_cb(keynode_t *key, void* data)
-{
-       noti_level = vconf_keynode_get_int(key);
-}
-
 static int get_priority(feedback_pattern_e pattern)
 {
        if (pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD)
@@ -229,198 +138,77 @@ static int get_priority(feedback_pattern_e pattern)
        return HAPTIC_PRIORITY_MIDDLE;
 }
 
-static int get_haptic_level(feedback_pattern_e pattern)
-{
-       int level;
-
-       if (pattern >= FEEDBACK_PATTERN_MESSAGE && pattern <= FEEDBACK_PATTERN_SMART_ALERT)
-               level = noti_level * HAPTIC_FEEDBACK_STEP;
-       else
-               level = vib_level * HAPTIC_FEEDBACK_STEP;
-
-       _D("Call status : %d, pattern : %s, level : %d", callstatus, str_pattern[pattern], level);
-       if (callstatus == VCONFKEY_CALL_VOICE_ACTIVE
-           || callstatus == VCONFKEY_CALL_VIDEO_ACTIVE) {
-               // if call status is ON, vibration magnitude is 20%
-               level = 20;
-               _D("level changed : %d", level);
-       }
-
-       return level;
-}
-
-static bool get_always_alert_case(feedback_pattern_e pattern)
-{
-       switch (pattern) {
-       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
-       case FEEDBACK_PATTERN_HOLD:
-               break;
-       case FEEDBACK_PATTERN_SIP:
-       case FEEDBACK_PATTERN_SIP_BACKSPACE:
-       case FEEDBACK_PATTERN_SIP_FUNCTION:
-       case FEEDBACK_PATTERN_SIP_FJKEY:
-               return true;
-       case FEEDBACK_PATTERN_TIMER:
-       case FEEDBACK_PATTERN_TIMER_ON_CALL:
-       case FEEDBACK_PATTERN_WAKEUP:
-       case FEEDBACK_PATTERN_WAKEUP_ON_CALL:
-               return true;
-       case FEEDBACK_PATTERN_MESSAGE_ON_CALL:
-       case FEEDBACK_PATTERN_EMAIL_ON_CALL:
-       case FEEDBACK_PATTERN_GENERAL_ON_CALL:
-               if (alert_callstatus)
-                       return true;
-               break;
-       case FEEDBACK_PATTERN_MESSAGE:
-       case FEEDBACK_PATTERN_EMAIL:
-       case FEEDBACK_PATTERN_3RD_APPLICATION:
-       case FEEDBACK_PATTERN_SMART_ALERT:
-       case FEEDBACK_PATTERN_SEND_SOS_MESSAGE:
-       case FEEDBACK_PATTERN_END_SOS_MESSAGE:
-       case FEEDBACK_PATTERN_CMAS:
-       case FEEDBACK_PATTERN_OUTGOING_CALL:
-       case FEEDBACK_PATTERN_MMS:
-       case FEEDBACK_PATTERN_HOURLY_ALERT:
-               return true;
-       case FEEDBACK_PATTERN_SPEED_UP:
-       case FEEDBACK_PATTERN_SLOW_DOWN:
-       case FEEDBACK_PATTERN_KEEP_THIS_PACE:
-       case FEEDBACK_PATTERN_GOAL_ACHIEVED:
-       case FEEDBACK_PATTERN_EXERCISE_COUNT:
-       case FEEDBACK_PATTERN_START_CUE:
-               /* except mute case */
-               if (is_sound_mode() ||  vibstatus)
-                       return true;
-               break;
-       case FEEDBACK_PATTERN_CHARGERCONN_ON_CALL:
-       case FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL:
-       case FEEDBACK_PATTERN_LOWBATT_ON_CALL:
-               /* no matter sound profile */
-               return true;
-       default:
-               break;
-       }
-       return false;
-}
-
-static bool get_always_off_case(feedback_pattern_e pattern)
-{
-       return false;
-}
-
-static int get_xml_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlData **data)
-{
-       xmlNodePtr cur;
-       struct xmlData *retData;
-
-       cur = xml_find(doc, VIBRATION_STR, (const xmlChar*)str_pattern[pattern]);
-       /* This pattern does not have sound file to play */
-       if (cur == NULL)
-               return -ENOENT;
-
-       retData = xml_parse(doc, cur);
-       if (retData == NULL) {
-               _E("xml_parse fail");
-               return -EPERM;
-       }
-
-       *data = retData;
-       return 0;
-}
-
-static void release_xml_data(struct xmlData *data)
-{
-       if (data == NULL)
-               return;
-
-       xml_free(data);
-}
-
 static void vibrator_init(void)
 {
        int ret;
 
-       /* xml Init */
-       v_doc = xml_open(VIBRATION_XML);
-       if (v_doc == NULL) {
-               _E("xml_open(%s) fail", VIBRATION_XML);
-               return;
-       }
-
        /* Vibration Init */
        ret = haptic_open();
        if (ret < 0) {
                _E("haptic_open ==> FAIL!! : %d", ret);
-               xml_close(v_doc);
-               v_doc = NULL;
+               v_handle = -ENOTSUP;
                return;
        }
 
        /* Set vibration handle */
        v_handle = (unsigned int)ret;
-
-       /* check vib_level */
-       if (vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vib_level) < 0)
-               _W("VCONFKEY_FEEDBACK_VIBRATION_LEVEL_INT ==> FAIL!!");
-
-       /* check noti_level */
-       if (vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &noti_level) < 0)
-               _W("VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT ==> FAIL!!");
-
-       /* add watch for status value */
-       vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb, NULL);
-       vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb, NULL);
 }
 
 static void vibrator_exit(void)
 {
        int ret;
 
-       /* remove watch */
-       vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb);
-       vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb);
-
-       if (v_handle) {
+       if (v_handle > 0) {
                ret = haptic_close(v_handle);
                if (ret < 0)
                        _E("haptic_close is failed : %d", ret);
                v_handle = 0;
        }
-
-       if (v_doc) {
-               xml_close(v_doc);
-               v_doc = NULL;
-       }
 }
 
 static int vibrator_play(feedback_pattern_e pattern)
 {
        int ret;
+       int level;
 
-       if (!v_handle || !v_doc) {
+       if (!v_handle) {
                _E("Not initialize");
                return -EPERM;
        }
 
+       if (v_handle == -ENOTSUP) {
+               _E("Not supported vibration");
+               return -ENOTSUP;
+       }
+
        if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) < 0) {
                _D("fail to get vibration status, will work as turning off");
                vibstatus = 0;
        }
 
-       if (vibstatus == 0 && !get_always_alert_case(pattern))  {
+       if (vibstatus == 0 && profile->get_always_alert_case &&
+           !profile->get_always_alert_case(FEEDBACK_TYPE_VIBRATION, pattern))  {
                _D("Vibration condition is OFF (vibstatus : %d)", vibstatus);
                return 0;
        }
 
-       if (vibstatus && get_always_off_case(pattern)) {
+       if (vibstatus && profile->get_always_off_case &&
+           profile->get_always_off_case(FEEDBACK_TYPE_VIBRATION, pattern)) {
                _D("Vibration always off condition");
                return 0;
        }
 
+       if (profile->get_strength_type)
+               level = profile->get_strength_type(FEEDBACK_TYPE_VIBRATION, pattern);
+       else
+               level = DEFAULT_VIB_LEVEL * HAPTIC_FEEDBACK_STEP;
+
        ret = haptic_vibrate_monotone(v_handle, DEFAULT_DURATION,
-                       get_haptic_level(pattern), get_priority(pattern));
+                       level, get_priority(pattern));
        if (ret < 0) {
                _E("haptic_vibrate_monotone is failed");
+               if (ret == -ECOMM)
+                       return ret;
                return -EPERM;
        }
 
@@ -431,18 +219,47 @@ static int vibrator_stop(void)
 {
        int ret;
 
-       if (!v_handle || !v_doc) {
+       if (!v_handle) {
                _E("Not initialize");
                return -EPERM;
        }
 
+       if (v_handle == -ENOTSUP) {
+               _E("Not supported vibration");
+               return -ENOTSUP;
+       }
+
        /* stop haptic device */
        ret = haptic_vibrate_stop(v_handle);
        if (ret < 0) {
                _E("haptic_vibrate_stop is failed");
+               if (ret == -ECOMM)
+                       return ret;
+               return -EPERM;
+       }
+
+       return 0;
+}
+
+static int vibrator_is_supported(int pattern, bool *supported)
+{
+       if (!supported) {
+               _E("Invalid parameter : supported(NULL)");
+               return -EINVAL;
+       }
+
+       if (!v_handle) {
+               _E("Not initialize");
                return -EPERM;
        }
 
+       if (v_handle == -ENOTSUP) {
+               _E("Not supported vibration");
+               *supported = false;
+               return 0;
+       }
+
+       *supported = true;
        return 0;
 }
 
@@ -454,7 +271,8 @@ static int vibrator_get_path(feedback_pattern_e pattern, char *buf, unsigned int
 
        cur_path = haptic_file[pattern];
        if (*cur_path) {
-               _E("This pattern(%s) in vibrator type is not supported to play", str_pattern[pattern]);
+               _E("This pattern(%s) in vibrator type is not supported to play",
+                               profile->str_pattern[pattern]);
                snprintf(buf, buflen, "NULL");
                return -ENOENT;
        }
@@ -485,16 +303,19 @@ static int vibrator_set_path(feedback_pattern_e pattern, char *path)
        else
                memset(ppath, 0, NAME_MAX);
 
-       _D("The file of pattern(%s) is changed to [%s]", str_pattern[pattern], path);
+       _D("The file of pattern(%s) is changed to [%s]",
+                       profile->str_pattern[pattern], path);
        return 0;
 }
 
 static const struct device_ops vibrator_device_ops = {
        .type = FEEDBACK_TYPE_VIBRATION,
+       .name = "Vibrator",
        .init = vibrator_init,
        .exit = vibrator_exit,
        .play = vibrator_play,
        .stop = vibrator_stop,
+       .is_supported = vibrator_is_supported,
        .get_path = vibrator_get_path,
        .set_path = vibrator_set_path,
 };
diff --git a/src/xmlparser.h b/src/xmlparser.h
new file mode 100644 (file)
index 0000000..0c38672
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __XMLPARSER_H__
+#define __XMLPARSER_H__
+
+#include <libxml/parser.h>
+
+struct xmlData {
+    char *label;
+    char *data;
+       int size;
+};
+
+enum xmlType {
+       XML_LABEL = 0,
+       XML_DATA,
+};
+
+#define VIBRATION_STR          "vibration"
+#define SOUND_STR                      "sound"
+
+xmlDocPtr xml_open(const char *xml);
+void xml_close(xmlDocPtr doc);
+
+xmlNodePtr xml_find(xmlDocPtr doc, const char *label, const xmlChar* expr);
+struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur);
+int xml_decode_data(struct xmlData *data);
+int xml_save(xmlDocPtr doc, const char *path);
+void xml_free(struct xmlData* data);
+
+#endif //__XMLPARSER_H__
diff --git a/wearable/data/sound.xml b/wearable/data/sound.xml
new file mode 100644 (file)
index 0000000..d4e2a86
--- /dev/null
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="utf-8"?>
+<config>
+       <label>svi-data</label>
+       <description>Sound Resource</description>
+       <sound>
+               <label>FEEDBACK_PATTERN_TAP</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SIP</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY0</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY1</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY2</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY3</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY4</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY5</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY6</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY7</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY8</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY9</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_STAR</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_SHARP</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_KEY_BACK</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_POWERON</label>
+               <data>/usr/share/feedback/sound/operation/power_on.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_CHARGERCONN</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_CHARGING_ERROR</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_LOWBATT</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_SILENT_OFF</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_BT_CONNECTED</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_BT_DISCONNECTED</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_VOLUME_KEY</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SIP_BACKSPACE</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SIP_FUNCTION</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SIP_FJKEY</label>
+               <data>/usr/share/feedback/sound/touch/touch.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_WAKEUP_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SCHEDULE_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_TIMER_ON_CALL</label>
+               <data>/usr/share/feedback/sound/operation/notification.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SAFETY_ALERT</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_CALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_DISCALLCONNECT</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_BT_PAIRING</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_BT_WAITING</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SCREEN_CAPTURE</label>
+               <data>/usr/share/feedback/sound/operation/shutter.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SAFETY_LOW_POWER</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_CMAS</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_GOAL_ACHIEVED</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_MEASURING_SUCCESS</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_MEASURING_FAILURE</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_UV_PROCESSING</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SHEALTH_START</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SHEALTH_PAUSE</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+       <sound>
+               <label>FEEDBACK_PATTERN_WEARABLE_SHEALTH_STOP</label>
+               <data>/usr/share/feedback/sound/operation/system.ogg</data>
+       </sound>
+</config>
diff --git a/wearable/data/sound/operation/notification.ogg b/wearable/data/sound/operation/notification.ogg
new file mode 100755 (executable)
index 0000000..457f7e8
Binary files /dev/null and b/wearable/data/sound/operation/notification.ogg differ
diff --git a/wearable/data/sound/operation/power_on.ogg b/wearable/data/sound/operation/power_on.ogg
new file mode 100755 (executable)
index 0000000..7756406
Binary files /dev/null and b/wearable/data/sound/operation/power_on.ogg differ
diff --git a/wearable/data/sound/operation/ringtone.ogg b/wearable/data/sound/operation/ringtone.ogg
new file mode 100755 (executable)
index 0000000..2653dd6
Binary files /dev/null and b/wearable/data/sound/operation/ringtone.ogg differ
diff --git a/wearable/data/sound/operation/shutter.ogg b/wearable/data/sound/operation/shutter.ogg
new file mode 100755 (executable)
index 0000000..c22c810
Binary files /dev/null and b/wearable/data/sound/operation/shutter.ogg differ
diff --git a/wearable/data/sound/operation/system.ogg b/wearable/data/sound/operation/system.ogg
new file mode 100755 (executable)
index 0000000..69c8425
Binary files /dev/null and b/wearable/data/sound/operation/system.ogg differ
diff --git a/wearable/data/sound/touch/touch.ogg b/wearable/data/sound/touch/touch.ogg
new file mode 100755 (executable)
index 0000000..8be60ce
Binary files /dev/null and b/wearable/data/sound/touch/touch.ogg differ
diff --git a/wearable/include/feedback-ids-wearable.h b/wearable/include/feedback-ids-wearable.h
new file mode 100644 (file)
index 0000000..fb7188c
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __FEEDBACK_IDS_WEARABLE_H__
+#define __FEEDBACK_IDS_WEARABLE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file feedback-ids-mobile.h
+ * @brief This file contains the feedback API
+ */
+
+/**
+ * @addtogroup CAPI_FEEDBACK_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumerations of the system pre-defined patterns for feedback interface
+ * @details
+ * Each feedback pattern can have separate media files of each types.
+ * But Depending on vendor design, pattern may not have any type of file.
+ *
+ */
+typedef enum
+{
+       FEEDBACK_PATTERN_WEARABLE_NONE = -1,
+
+       FEEDBACK_PATTERN_WEARABLE_SIP_BACKSPACE = FEEDBACK_PATTERN_END, /**< feedback pattern when touch backspace key */
+       FEEDBACK_PATTERN_WEARABLE_SIP_FUNCTION,                         /**< feedback pattern when touch function key */
+       FEEDBACK_PATTERN_WEARABLE_SIP_FJKEY,                            /**< feedback pattern when touch F,J key */
+       FEEDBACK_PATTERN_WEARABLE_MAX_CHARACTER,                        /**< feedback pattern when max character */
+
+       FEEDBACK_PATTERN_WEARABLE_MESSAGE_ON_CALL,              /**< feedback pattern when incoming a message on call */
+       FEEDBACK_PATTERN_WEARABLE_EMAIL_ON_CALL,                /**< feedback pattern when incoming an email on call */
+       FEEDBACK_PATTERN_WEARABLE_WAKEUP_ON_CALL,               /**< feedback pattern when alert wake up call on call */
+       FEEDBACK_PATTERN_WEARABLE_SCHEDULE_ON_CALL,             /**< feedback pattern when alert schedule alarm on call */
+       FEEDBACK_PATTERN_WEARABLE_TIMER_ON_CALL,                /**< feedback pattern when alert timer on call */
+       FEEDBACK_PATTERN_WEARABLE_GENERAL_ON_CALL,              /**< feedback pattern when alert general event on call */
+       FEEDBACK_PATTERN_WEARABLE_SMART_ALERT,                  /**< feedback pattern when alert noti on motion */
+
+       FEEDBACK_PATTERN_WEARABLE_CHARGERCONN_ON_CALL,  /**< feedback pattern when connecting charger on call */
+       FEEDBACK_PATTERN_WEARABLE_CHARGING_ERROR_ON_CALL,/**< feedback pattern when occuring charging error on call */
+       FEEDBACK_PATTERN_WEARABLE_FULLCHARGED_ON_CALL,  /**< feedback pattern when full charged on call */
+       FEEDBACK_PATTERN_WEARABLE_LOWBATT_ON_CALL,      /**< feedback pattern when low battery on call */
+       FEEDBACK_PATTERN_WEARABLE_CALLCONNECT,          /**< feedback pattern when connecting call */
+       FEEDBACK_PATTERN_WEARABLE_DISCALLCONNECT,       /**< feedback pattern when disconnecting call */
+       FEEDBACK_PATTERN_WEARABLE_OUTGOING_CALL,        /**< feedback pattern when connected outgoing call */
+       FEEDBACK_PATTERN_WEARABLE_MINUTEMINDER,         /**< feedback pattern when minute minder */
+       FEEDBACK_PATTERN_WEARABLE_BT_PAIRING,           /**< feedback pattern when starting pare with bluetooth */
+       FEEDBACK_PATTERN_WEARABLE_BT_WAITING,           /**< feedback pattern when pairing bluetooth */
+       FEEDBACK_PATTERN_WEARABLE_SCREEN_CAPTURE,       /**< feedback pattern when screen capture */
+       FEEDBACK_PATTERN_WEARABLE_MMS,                  /**< feedback pattern when message state changed to MMS */
+       FEEDBACK_PATTERN_WEARABLE_HOURLY_ALERT,         /**< feedback pattern when alert every hour on the hour */
+
+       FEEDBACK_PATTERN_WEARABLE_SAFETY_ALERT,         /**< feedback pattern when safety alert from phone */
+       FEEDBACK_PATTERN_WEARABLE_ACCIDENT_DETECT,      /**< feedback pattern when accident detect */
+       FEEDBACK_PATTERN_WEARABLE_SEND_SOS_MESSAGE,     /**< feedback pattern when sending SOS message */
+       FEEDBACK_PATTERN_WEARABLE_END_SOS_MESSAGE,      /**< feedback pattern when finishing SOS message */
+       FEEDBACK_PATTERN_WEARABLE_EMERGENCY_BUZZER,     /**< feedback pattern when occurs emergency buzzer */
+       FEEDBACK_PATTERN_WEARABLE_SAFETY_LOW_POWER,     /**< this pattern is a low power ringtone */
+       FEEDBACK_PATTERN_WEARABLE_CMAS,                 /**< feedback pattern when alerting commercial mobile */
+       FEEDBACK_PATTERN_WEARABLE_SPEED_UP,             /**< feedback pattern when advising user to speed up */
+       FEEDBACK_PATTERN_WEARABLE_SLOW_DOWN,            /**< feedback pattern when advising user to slow down */
+       FEEDBACK_PATTERN_WEARABLE_KEEP_THIS_PACE,       /**< feedback pattern when advising user to keep this pace */
+       FEEDBACK_PATTERN_WEARABLE_GOAL_ACHIEVED,        /**< feedback pattern when alerting goal achieved */
+       FEEDBACK_PATTERN_WEARABLE_EXERCISE_COUNT,       /**< feedback pattern when changing count number */
+       FEEDBACK_PATTERN_WEARABLE_START_CUE,            /**< feedback pattern when starting cue */
+       FEEDBACK_PATTERN_WEARABLE_HEALTH_PACE,          /**< feedback pattern when alerting health pace */
+       FEEDBACK_PATTERN_WEARABLE_INACTIVE_TIME,        /**< feedback pattern when alerting inactive time */
+       FEEDBACK_PATTERN_WEARABLE_MEASURING_SUCCESS,    /**< feedback pattern when measuring is succeeded */
+       FEEDBACK_PATTERN_WEARABLE_MEASURING_FAILURE,    /**< feedback pattern when measuring is failed */
+       FEEDBACK_PATTERN_WEARABLE_UV_PROCESSING,        /**< feedback pattern when UV is processing */
+       FEEDBACK_PATTERN_WEARABLE_SHEALTH_START,        /**< feedback pattern when starting s-health */
+       FEEDBACK_PATTERN_WEARABLE_SHEALTH_PAUSE,        /**< feedback pattern when pausing s-health */
+       FEEDBACK_PATTERN_WEARABLE_SHEALTH_STOP,         /**< feedback pattern when stoping s-health */
+       FEEDBACK_PATTERN_WEARABLE_3RD_APPLICATION,      /**< feedback pattern when alert 3rd event */
+
+       FEEDBACK_PATTERN_WEARABLE_END,
+
+} feedback_pattern_wearable_e;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__FEEDBACK_IDS_WEARABLE_H__
diff --git a/wearable/src/check.c b/wearable/src/check.c
new file mode 100644 (file)
index 0000000..345b102
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * libfeedback
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <vconf.h>
+
+#include "feedback.h"
+#include "feedback-ids-wearable.h"
+#include "profiles.h"
+#include "log.h"
+
+
+static const char *wearable_str_type[] =
+{
+       "FEEDBACK_TYPE_NONE",
+       "FEEDBACK_TYPE_SOUND",
+       "FEEDBACK_TYPE_VIBRATION",
+};
+
+static const char *wearable_str_pattern[] =
+{
+       "FEEDBACK_PATTERN_TAP",
+       "FEEDBACK_PATTERN_SIP",
+       "FEEDBACK_PATTERN_KEY0",
+       "FEEDBACK_PATTERN_KEY1",
+       "FEEDBACK_PATTERN_KEY2",
+       "FEEDBACK_PATTERN_KEY3",
+       "FEEDBACK_PATTERN_KEY4",
+       "FEEDBACK_PATTERN_KEY5",
+       "FEEDBACK_PATTERN_KEY6",
+       "FEEDBACK_PATTERN_KEY7",
+       "FEEDBACK_PATTERN_KEY8",
+       "FEEDBACK_PATTERN_KEY9",
+       "FEEDBACK_PATTERN_KEY_STAR",
+       "FEEDBACK_PATTERN_KEY_SHARP",
+       "FEEDBACK_PATTERN_KEY_BACK",
+       "FEEDBACK_PATTERN_HOLD",
+       "FEEDBACK_PATTERN_HW_TAP",
+       "FEEDBACK_PATTERN_HW_HOLD",
+
+       "FEEDBACK_PATTERN_MESSAGE",
+       "FEEDBACK_PATTERN_EMAIL",
+       "FEEDBACK_PATTERN_WAKEUP",
+       "FEEDBACK_PATTERN_SCHEDULE",
+       "FEEDBACK_PATTERN_TIMER",
+       "FEEDBACK_PATTERN_GENERAL",
+
+       "FEEDBACK_PATTERN_POWERON",
+       "FEEDBACK_PATTERN_POWEROFF",
+       "FEEDBACK_PATTERN_CHARGERCONN",
+       "FEEDBACK_PATTERN_CHARGING_ERROR",
+       "FEEDBACK_PATTERN_FULLCHARGED",
+       "FEEDBACK_PATTERN_LOWBATT",
+       "FEEDBACK_PATTERN_LOCK",
+       "FEEDBACK_PATTERN_UNLOCK",
+       "FEEDBACK_PATTERN_VIBRATION_ON",
+       "FEEDBACK_PATTERN_SILENT_OFF",
+       "FEEDBACK_PATTERN_BT_CONNECTED",
+       "FEEDBACK_PATTERN_BT_DISCONNECTED",
+       "FEEDBACK_PATTERN_LIST_REORDER",
+       "FEEDBACK_PATTERN_LIST_SLIDER",
+       "FEEDBACK_PATTERN_VOLUME_KEY",
+
+       "FEEDBACK_PATTERN_WEARABLE_SIP_BACKSPACE",
+       "FEEDBACK_PATTERN_WEARABLE_SIP_FUNCTION",
+       "FEEDBACK_PATTERN_WEARABLE_SIP_FJKEY",
+       "FEEDBACK_PATTERN_WEARABLE_MAX_CHARACTER",
+
+       "FEEDBACK_PATTERN_WEARABLE_MESSAGE_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_EMAIL_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_WAKEUP_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_SCHEDULE_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_TIMER_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_GENERAL_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_SMART_ALERT",
+
+       "FEEDBACK_PATTERN_WEARABLE_CHARGERCONN_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_CHARGING_ERROR_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_FULLCHARGED_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_LOWBATT_ON_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_CALLCONNECT",
+       "FEEDBACK_PATTERN_WEARABLE_DISCALLCONNECT",
+       "FEEDBACK_PATTERN_WEARABLE_OUTGOING_CALL",
+       "FEEDBACK_PATTERN_WEARABLE_MINUTEMINDER",
+       "FEEDBACK_PATTERN_WEARABLE_BT_PAIRING",
+       "FEEDBACK_PATTERN_WEARABLE_BT_WAITING",
+       "FEEDBACK_PATTERN_WEARABLE_SCREEN_CAPTURE",
+       "FEEDBACK_PATTERN_WEARABLE_MMS",
+       "FEEDBACK_PATTERN_WEARABLE_HOURLY_ALERT",
+
+       "FEEDBACK_PATTERN_WEARABLE_SAFETY_ALERT",
+       "FEEDBACK_PATTERN_WEARABLE_ACCIDENT_DETECT",
+       "FEEDBACK_PATTERN_WEARABLE_SEND_SOS_MESSAGE",
+       "FEEDBACK_PATTERN_WEARABLE_END_SOS_MESSAGE",
+       "FEEDBACK_PATTERN_WEARABLE_EMERGENCY_BUZZER",
+       "FEEDBACK_PATTERN_WEARABLE_SAFETY_LOW_POWER",
+       "FEEDBACK_PATTERN_WEARABLE_CMAS",
+       "FEEDBACK_PATTERN_WEARABLE_SPEED_UP",
+       "FEEDBACK_PATTERN_WEARABLE_SLOW_DOWN",
+       "FEEDBACK_PATTERN_WEARABLE_KEEP_THIS_PACE",
+       "FEEDBACK_PATTERN_WEARABLE_GOAL_ACHIEVED",
+       "FEEDBACK_PATTERN_WEARABLE_EXERCISE_COUNT",
+       "FEEDBACK_PATTERN_WEARABLE_START_CUE",
+       "FEEDBACK_PATTERN_WEARABLE_HEALTH_PACE",
+       "FEEDBACK_PATTERN_WEARABLE_INACTIVE_TIME",
+       "FEEDBACK_PATTERN_WEARABLE_MEASURING_SUCCESS",
+       "FEEDBACK_PATTERN_WEARABLE_MEASURING_FAILURE",
+       "FEEDBACK_PATTERN_WEARABLE_UV_PROCESSING",
+       "FEEDBACK_PATTERN_WEARABLE_SHEALTH_START",
+       "FEEDBACK_PATTERN_WEARABLE_SHEALTH_PAUSE",
+       "FEEDBACK_PATTERN_WEARABLE_SHEALTH_STOP",
+       "FEEDBACK_PATTERN_WEARABLE_3RD_APPLICATION",
+};
+
+static int callstatus;
+static int alert_callstatus;
+static int camerastatus;
+static int shutter_sndstatus;
+static int noti_vibstatus;
+static int vib_level;
+static int noti_level;
+static int feedbackstatus;
+
+static void feedback_callstatus_cb(keynode_t *key, void* data)
+{
+       callstatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_alertstatus_cb(keynode_t *key, void* data)
+{
+       alert_callstatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_camerastatus_cb(keynode_t *key, void* data)
+{
+       camerastatus = vconf_keynode_get_int(key);
+}
+
+static void feedback_noti_vibstatus_cb(keynode_t *key, void* data)
+{
+       noti_vibstatus = vconf_keynode_get_bool(key);
+}
+
+static void feedback_vib_cb(keynode_t *key, void* data)
+{
+       vib_level = vconf_keynode_get_int(key);
+}
+
+static void feedback_noti_cb(keynode_t *key, void* data)
+{
+       noti_level = vconf_keynode_get_int(key);
+}
+
+static void feedback_feedbackstatus_cb(keynode_t *key, void* data)
+{
+       feedbackstatus = vconf_keynode_get_bool(key);
+}
+
+static void wearable_init(void)
+{
+       /* check call status */
+       if (vconf_get_int(VCONFKEY_CALL_STATE, &callstatus) < 0)
+               _W("VCONFKEY_CALL_STATE ==> FAIL!!");
+
+       /* alert option on call */
+       if (vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alert_callstatus) < 0)
+               _W("VCONFKEY_CISSAPPL_ON_CALL_INT ==> FAIL!!");
+
+       /* check camera status */
+       if (vconf_get_int(VCONFKEY_CAMERA_STATE, &camerastatus) < 0)
+               _W("VCONFKEY_CAMERA_STATE ==> FAIL!!");
+
+       /* shutter sound policy */
+       // This vconf is read just once, because this value is not changed in running time.
+       if (vconf_get_int(VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY, &shutter_sndstatus) < 0)
+               _W("VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY ==> FAIL!!");
+
+       /* check vibration status */
+       if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, &noti_vibstatus) < 0)
+               _W("VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL ==> FAIL!!");
+
+       /* check vib_level */
+       if (vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vib_level) < 0)
+               _W("VCONFKEY_FEEDBACK_VIBRATION_LEVEL_INT ==> FAIL!!");
+
+       /* check noti_level */
+       if (vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &noti_level) < 0)
+               _W("VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT ==> FAIL!!");
+
+       /* feedback Init */
+       if(vconf_get_bool(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, &feedbackstatus) < 0)
+               _W("VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL ==> FAIL!!");
+
+       /* add watch for status value */
+       vconf_notify_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, feedback_noti_vibstatus_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb, NULL);
+       vconf_notify_key_changed(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, feedback_feedbackstatus_cb, NULL);
+}
+
+static void wearable_exit(void)
+{
+       /* remove watch */
+       vconf_ignore_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, feedback_noti_vibstatus_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb);
+       vconf_ignore_key_changed(VCONFKEY_SETAPPL_HAPTIC_FEEDBACK_STATUS_BOOL, feedback_feedbackstatus_cb);
+}
+
+static bool wearable_get_switched_pattern(int pattern, int *switched)
+{
+       if (!switched)
+               return false;
+
+       if (callstatus == VCONFKEY_CALL_OFF)
+               return false;
+
+       /* in case of call connected or connecting */
+       _D("Call status is connected or connecting.");
+       if (pattern == FEEDBACK_PATTERN_MESSAGE)
+               *switched = FEEDBACK_PATTERN_WEARABLE_MESSAGE_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_EMAIL)
+               *switched = FEEDBACK_PATTERN_WEARABLE_EMAIL_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_WAKEUP)
+               *switched = FEEDBACK_PATTERN_WEARABLE_WAKEUP_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_SCHEDULE)
+               *switched = FEEDBACK_PATTERN_WEARABLE_SCHEDULE_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_TIMER)
+               *switched = FEEDBACK_PATTERN_WEARABLE_TIMER_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_GENERAL)
+               *switched = FEEDBACK_PATTERN_WEARABLE_GENERAL_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_CHARGERCONN)
+               *switched = FEEDBACK_PATTERN_WEARABLE_CHARGERCONN_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_CHARGING_ERROR)
+               *switched = FEEDBACK_PATTERN_WEARABLE_CHARGING_ERROR_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_FULLCHARGED)
+               *switched = FEEDBACK_PATTERN_WEARABLE_FULLCHARGED_ON_CALL;
+       else if (pattern == FEEDBACK_PATTERN_LOWBATT)
+               *switched = FEEDBACK_PATTERN_WEARABLE_LOWBATT_ON_CALL;
+
+       return true;
+}
+
+static bool wearable_get_always_alert_case(int type, int pattern)
+{
+       switch (pattern) {
+       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
+       case FEEDBACK_PATTERN_HOLD:
+               if (CHECK_VIBRATION(type) && feedbackstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_WEARABLE_SIP_BACKSPACE:
+       case FEEDBACK_PATTERN_WEARABLE_SIP_FUNCTION:
+       case FEEDBACK_PATTERN_WEARABLE_SIP_FJKEY:
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_MESSAGE:
+       case FEEDBACK_PATTERN_EMAIL:
+               if (CHECK_VIBRATION(type) && noti_vibstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_TIMER:
+       case FEEDBACK_PATTERN_WEARABLE_TIMER_ON_CALL:
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WAKEUP:
+       case FEEDBACK_PATTERN_WEARABLE_WAKEUP_ON_CALL:
+               return true;
+       case FEEDBACK_PATTERN_WEARABLE_MESSAGE_ON_CALL:
+       case FEEDBACK_PATTERN_WEARABLE_EMAIL_ON_CALL:
+       case FEEDBACK_PATTERN_WEARABLE_GENERAL_ON_CALL:
+               if (alert_callstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WEARABLE_CHARGERCONN_ON_CALL:
+       case FEEDBACK_PATTERN_WEARABLE_CHARGING_ERROR_ON_CALL:
+       case FEEDBACK_PATTERN_WEARABLE_LOWBATT_ON_CALL:
+       case FEEDBACK_PATTERN_WEARABLE_3RD_APPLICATION:
+       case FEEDBACK_PATTERN_WEARABLE_MMS:
+       case FEEDBACK_PATTERN_WEARABLE_HOURLY_ALERT:
+               /* no matter sound profile */
+               if (CHECK_VIBRATION(type))
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WEARABLE_SMART_ALERT:
+       case FEEDBACK_PATTERN_WEARABLE_SEND_SOS_MESSAGE:
+       case FEEDBACK_PATTERN_WEARABLE_END_SOS_MESSAGE:
+       case FEEDBACK_PATTERN_WEARABLE_CMAS:
+       case FEEDBACK_PATTERN_WEARABLE_OUTGOING_CALL:
+               return true;
+       case FEEDBACK_PATTERN_WEARABLE_SCREEN_CAPTURE:
+               if (CHECK_SOUND(type) && camerastatus && shutter_sndstatus)
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_WEARABLE_SPEED_UP:
+       case FEEDBACK_PATTERN_WEARABLE_SLOW_DOWN:
+       case FEEDBACK_PATTERN_WEARABLE_KEEP_THIS_PACE:
+       case FEEDBACK_PATTERN_WEARABLE_GOAL_ACHIEVED:
+       case FEEDBACK_PATTERN_WEARABLE_EXERCISE_COUNT:
+       case FEEDBACK_PATTERN_WEARABLE_START_CUE:
+               /* except mute case */
+               if (CHECK_VIBRATION(type) &&
+                       (is_sound_mode() || is_vibration_mode()))
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
+
+static bool wearable_get_always_off_case(int type, int pattern)
+{
+       int ret;
+
+       /* check if the state of voice recorder is recording */
+       if (vconf_get_int(VCONFKEY_SOUND_STATUS, &ret) < 0) {
+               _D("fail to get media sound status, status will be zero");
+               ret = 0;
+       }
+
+       if (CHECK_SOUND(type) && ret & VCONFKEY_SOUND_STATUS_AVRECORDING) {
+               _D("voice recording status is RECORDING");
+               return true;
+       }
+
+       switch (pattern) {
+       case FEEDBACK_PATTERN_TAP ... FEEDBACK_PATTERN_SIP:
+       case FEEDBACK_PATTERN_HOLD ... FEEDBACK_PATTERN_HW_HOLD:
+       case FEEDBACK_PATTERN_WEARABLE_SIP_BACKSPACE ... FEEDBACK_PATTERN_WEARABLE_MAX_CHARACTER:
+               if (CHECK_SOUND(type) && !is_touch_sndstatus())
+                       return true;
+               break;
+       case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK:
+               if (CHECK_SOUND(type) && !is_keytone_sndstatus())
+                       return true;
+               else if (CHECK_VIBRATION(type) && !feedbackstatus)
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
+
+static int wearable_get_strength_type(int type, int pattern)
+{
+       if (CHECK_SOUND(type)) {
+               if (pattern == FEEDBACK_PATTERN_TAP)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_TOUCH;
+               else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_BACK)
+                       return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_DIALER;
+               else if (pattern == FEEDBACK_PATTERN_VOLUME_KEY)
+                       return VOLUME_TYPE_RINGTONE;
+               else if (camerastatus && shutter_sndstatus && pattern == FEEDBACK_PATTERN_WEARABLE_SCREEN_CAPTURE)
+                       return VOLUME_TYPE_FIXED;
+               else
+                       return VOLUME_TYPE_SYSTEM;
+       } else if (CHECK_VIBRATION(type)) {
+               if (pattern >= FEEDBACK_PATTERN_MESSAGE &&
+                   pattern <= FEEDBACK_PATTERN_GENERAL)
+                       return noti_level * HAPTIC_FEEDBACK_STEP;
+               else
+                       return vib_level * HAPTIC_FEEDBACK_STEP;
+       }
+
+       return -EINVAL;
+}
+
+static const struct profile_ops wearable_profile_ops = {
+       .profile               = "wearable",
+       .init                  = wearable_init,
+       .exit                  = wearable_exit,
+       .get_switched_pattern  = wearable_get_switched_pattern,
+       .get_always_alert_case = wearable_get_always_alert_case,
+       .get_always_off_case   = wearable_get_always_off_case,
+       .get_strength_type     = wearable_get_strength_type,
+       .max_type              = FEEDBACK_TYPE_END,
+       .max_pattern           = FEEDBACK_PATTERN_WEARABLE_END,
+       .str_type              = wearable_str_type,
+       .str_pattern           = wearable_str_pattern,
+};
+
+PROFILE_OPS_REGISTER(&wearable_profile_ops);