Add notification type check for mobile 56/93556/6
authorpr.jung <pr.jung@samsung.com>
Tue, 25 Oct 2016 02:12:29 +0000 (11:12 +0900)
committerJung <pr.jung@samsung.com>
Thu, 27 Oct 2016 06:36:37 +0000 (23:36 -0700)
Change-Id: I0c2706b97fcba44ed913d3c2663c6568118a32ae
Signed-off-by: pr.jung <pr.jung@samsung.com>
mobile/src/check.c
src/profiles.h

index 0f99bd5..4a80953 100644 (file)
@@ -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,
index 786b4c7..306485a 100644 (file)
@@ -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;