return false;
}
+static int mobile_get_priority(int pattern)
+{
+ return PRIORITY_MIDDLE;
+}
+
static bool mobile_get_always_alert_case(int type, int pattern)
{
switch (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,
+ .get_priority = mobile_get_priority,
.is_notification_type = mobile_is_notification_type,
.max_type = FEEDBACK_TYPE_END,
.max_pattern = FEEDBACK_PATTERN_INTERNAL_END,
#include <stdbool.h>
#include "common.h"
+enum priority_level {
+ PRIORITY_MIN = 0,
+ PRIORITY_MIDDLE,
+ PRIORITY_HIGH,
+ PRIORITY_TOP,
+};
+
struct profile_ops {
const char *profile;
void (*init) (void);
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);
+ int (*get_priority)(int pattern);
bool (*is_notification_type)(int pattern);
const int max_type;
const int max_pattern;
#define HAPTIC_DEVICE 0
-enum haptic_priority {
- HAPTIC_PRIORITY_MIN = 0,
- HAPTIC_PRIORITY_MIDDLE,
- HAPTIC_PRIORITY_HIGH,
-};
-
enum haptic_iteration {
HAPTIC_ITERATION_ONCE = 1,
HAPTIC_ITERATION_INFINITE = 256,
static int get_priority(feedback_pattern_e pattern)
{
- if (pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD)
- return HAPTIC_PRIORITY_MIN;
-
- return HAPTIC_PRIORITY_MIDDLE;
+ if (profile->get_priority)
+ return profile->get_priority(pattern);
+ return PRIORITY_MIDDLE;
}
static void vibrator_init(void)
return false;
}
+static int wearable_get_priority(int pattern)
+{
+ return PRIORITY_MIDDLE;
+}
+
static bool wearable_get_always_alert_case(int type, int pattern)
{
if (CHECK_SOUND(type)) {
.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,
+ .get_priority = wearable_get_priority,
.is_notification_type = wearable_is_notification_type,
.max_type = FEEDBACK_TYPE_END,
.max_pattern = FEEDBACK_PATTERN_INTERNAL_END,