/* hardkey vibration variable */
#define HARDKEY_VIB_ITERATION 1
#define HARDKEY_VIB_FEEDBACK 3
-#define HARDKEY_VIB_PRIORITY 2
#define HARDKEY_VIB_DURATION 30
#define HAPTIC_FEEDBACK_STEP 20
#define DEFAULT_FEEDBACK_LEVEL 3
#define CHECK_VALID_OPS(ops, r) ((ops) ? true : !(r = -ENODEV))
#define RETRY_CNT 3
+enum poweroff_type {
+ POWER_OFF_NONE = 0,
+ POWER_OFF_POPUP,
+ POWER_OFF_DIRECT,
+ POWER_OFF_RESTART,
+};
+
struct haptic_info {
char *sender;
dd_list *handle_list;
}
ret = h_ops->vibrate_monotone(g_handle, HARDKEY_VIB_DURATION,
- level*HAPTIC_FEEDBACK_STEP, HARDKEY_VIB_PRIORITY, &e_handle);
+ level*HAPTIC_FEEDBACK_STEP, PRIORITY_HIGH, &e_handle);
if (ret < 0)
_E("fail to vibrate buffer : %d", ret);
GVariant *param,
gpointer data)
{
+ int type = POWER_OFF_NONE;
int e_handle, ret;
struct timespec time = {0,};
+ g_variant_get(param, "(i)", &type);
+
+ if (type != POWER_OFF_DIRECT && type != POWER_OFF_RESTART)
+ return;
+
+ _D("Poweroff: %d", type);
+
if (!CHECK_VALID_OPS(h_ops, ret)) {
ret = haptic_module_load();
if (ret < 0)
haptic_internal_init();
/* power off vibration */
+ _I("Handle %d dur %dms pri %d level %d",
+ g_handle, POWER_OFF_VIB_DURATION, PRIORITY_HIGH, POWER_VIB_FEEDBACK);
ret = h_ops->vibrate_monotone(g_handle, POWER_OFF_VIB_DURATION,
- POWER_VIB_FEEDBACK, HARDKEY_VIB_PRIORITY, &e_handle);
+ POWER_VIB_FEEDBACK, PRIORITY_HIGH, &e_handle);
if (ret < 0) {
_E("fail to vibrate_monotone : %d", ret);
return;