From d21d271d29ce617c9a7326d3f5e8e51f2073bc8e Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Tue, 25 Oct 2016 11:12:29 +0900 Subject: [PATCH] Add notification type check for mobile Change-Id: I0c2706b97fcba44ed913d3c2663c6568118a32ae Signed-off-by: pr.jung --- mobile/src/check.c | 19 +++++++++++++++++++ src/profiles.h | 1 + 2 files changed, 20 insertions(+) diff --git a/mobile/src/check.c b/mobile/src/check.c index 0f99bd5..4a80953 100644 --- a/mobile/src/check.c +++ b/mobile/src/check.c @@ -264,6 +264,22 @@ static bool mobile_get_switched_pattern(int pattern, int *switched) return true; } +static bool mobile_is_notification_type(int pattern) +{ + switch (pattern) { + case FEEDBACK_PATTERN_WAKEUP: + case FEEDBACK_PATTERN_WAKEUP_ON_CALL: + case FEEDBACK_PATTERN_TIMER: + case FEEDBACK_PATTERN_TIMER_ON_CALL: + case FEEDBACK_PATTERN_MESSAGE ... FEEDBACK_PATTERN_EMAIL_ON_CALL: + case FEEDBACK_PATTERN_SCHEDULE: + case FEEDBACK_PATTERN_SCHEDULE_ON_CALL: + case FEEDBACK_PATTERN_GENERAL ... FEEDBACK_PATTERN_LOWBATT_ON_CALL: + return true; + } + return false; +} + static bool mobile_get_always_alert_case(int type, int pattern) { switch (pattern) { @@ -307,6 +323,8 @@ static bool mobile_get_always_alert_case(int type, int pattern) if (CHECK_SOUND(type) && camerastatus && shutter_sndstatus) return true; break; + case FEEDBACK_PATTERN_RINGER: + return true; default: break; } @@ -383,6 +401,7 @@ static const struct profile_ops mobile_profile_ops = { .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, + .is_notification_type = mobile_is_notification_type, .max_type = FEEDBACK_TYPE_END, .max_pattern = FEEDBACK_PATTERN_INTERNAL_END, .str_type = mobile_str_type, diff --git a/src/profiles.h b/src/profiles.h index 786b4c7..306485a 100644 --- a/src/profiles.h +++ b/src/profiles.h @@ -31,6 +31,7 @@ struct profile_ops { 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); + bool (*is_notification_type)(int pattern); const int max_type; const int max_pattern; const char **str_type; -- 2.7.4