Changes the condition for alarmmgr_set_repeat_mode 71/78471/3
authorMyungki Lee <mk5004.lee@samsung.com>
Tue, 5 Jul 2016 14:12:09 +0000 (23:12 +0900)
committerMyungKi Lee <mk5004.lee@samsung.com>
Wed, 6 Jul 2016 03:36:58 +0000 (20:36 -0700)
- If week_flag is 0, alarmmgr_set_repeat_mode return invlid param err.

Change-Id: I37c44809d30609d64eedd8977a2974d5dbe463c8
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/notification_setting_service.c

index 979124c..1817dda 100644 (file)
@@ -565,10 +565,12 @@ int noti_system_setting_set_alarm(int week_flag, int hour, int min, alarm_cb_t h
                goto out;
        }
 
-       err = alarmmgr_set_repeat_mode(alarm_info, ALARM_REPEAT_MODE_WEEKLY, week_flag);
-       if (err != ALARMMGR_RESULT_SUCCESS) {
-               NOTIFICATION_ERR("alarmmgr_set_repeat_mode failed (%d)", err);
-               goto out;
+       if (week_flag) {
+               err = alarmmgr_set_repeat_mode(alarm_info, ALARM_REPEAT_MODE_WEEKLY, week_flag);
+               if (err != ALARMMGR_RESULT_SUCCESS) {
+                       NOTIFICATION_ERR("alarmmgr_set_repeat_mode failed (%d)", err);
+                       goto out;
+               }
        }
 
        err = alarmmgr_set_type(alarm_info, ALARM_TYPE_VOLATILE);