* @section CAPI_SYSTEM_FEEDBACK_MODULE_OVERVIEW Overview
* The FEEDBACK API is responsible for playing simple sound and vibration.
* It plays sound using mm-sound library and vibration with system framework.
+
+ * @section CAPI_SYSTEM_FEEDBACK_FEATURE Related Features
+ * This API is related with the following features:\n
+ * - %http://tizen.org/feature/feedback.vibration\n
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ *
+ * You can check if a device 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="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature List</b>.</a>
+ *
*
*/
#define __FEEDBACK_INTERNAL_H__
#include <tizen_error.h>
-#include "feedback-ids.h"
+#include <feedback-ids.h>
#include "feedback-ids-internal.h"
#ifdef __cplusplus
#include <tizen.h>
#include <tizen_error.h>
-#include "feedback-ids.h"
+#include <feedback-ids.h>
#ifdef __cplusplus
extern "C" {
* @return @c 0 on success,
* otherwise a negative error value
* @retval #FEEDBACK_ERROR_NONE Successful
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
* @post feedback_deinitialize()
* @see feedback_deinitialize()
*/
* otherwise a negative error value
* @retval #FEEDBACK_ERROR_NONE Successful
* @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
* @pre feedback_initialize()
* @see feedback_initialize()
*/
}
if (type == FEEDBACK_TYPE_VIBRATION)
- return FEEDBACK_ERROR_NOT_SUPPORTED;
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
if (pattern <= FEEDBACK_PATTERN_NONE ||
pattern >= profile->max_pattern) {
if (type == FEEDBACK_TYPE_VIBRATION) {
_E("Not supported type"); //LCOV_EXCL_LINE
- return FEEDBACK_ERROR_NOT_SUPPORTED;
+ return FEEDBACK_ERROR_INVALID_PARAMETER;
}
/* proper device set path */
#include <vconf.h>
#include <mm_sound_private.h>
-#include "feedback-ids.h"
+#include <feedback-ids.h>
#include "profiles.h"
#include "devices.h"
#include "log.h"
#include <limits.h>
#include <vconf.h>
#include <sys/stat.h>
+#include <system_info.h>
#include "feedback.h"
#include "profiles.h"
#define DEFAULT_DURATION 100
#define SIP_DURATION 60
-#define WHITESPACE " \t"
+#define WHITESPACE " \t"
+
+#define VIBRATION_FEATURE "http://tizen.org/feature/feedback.vibration"
static int vibstatus;
static unsigned int v_handle;
static void vibrator_init(void)
{
int ret;
+ bool haptic_avail;
+
+ ret = system_info_get_platform_bool(VIBRATION_FEATURE, &haptic_avail);
+ if (ret < 0) {
+ v_handle = -ENOTSUP;
+ return;
+ } else if (ret == 0 && !haptic_avail) {
+ v_handle = -ENOTSUP;
+ return;
+ }
/* Vibration Init */
ret = haptic_open();