Adds alarm_expire_mode
authorInkyun Kil <inkyun.kil@samsung.com>
Wed, 23 May 2018 06:45:58 +0000 (15:45 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Fri, 25 May 2018 03:49:14 +0000 (12:49 +0900)
Adds alarm_expire_mode to not turn on the LCD when an alarm has expired

Related patch : https://review.tizen.org/gerrit/#/c/179875/

Change-Id: I808c3854915e7de368bae4dd184c4f3998336a9b
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
alarm-manager.c

index f640ced..b44cb6c 100644 (file)
@@ -1832,12 +1832,20 @@ static int __post_notification(guchar *data, int datalen, uid_t uid)
 {
        int ret;
        notification_h noti;
+       int expire_mode = ALARM_EXPIRE_MODE_NORMAL;
 
        noti = __get_notification(data, datalen);
        if (noti == NULL)
                return -1;
 
-       device_display_change_state(DISPLAY_STATE_NORMAL);
+       if (vconf_get_int(VCONFKEY_ALARM_EXPIRE_MODE, &expire_mode) != 0)
+               ALARM_MGR_EXCEPTION_PRINT("Failed to get value of VCONFKEY_ALARM_EXPIRE_MODE");
+
+       ALARM_MGR_LOG_PRINT("Value of alarm_expire_mode [%d]", expire_mode);
+
+       if (expire_mode == ALARM_EXPIRE_MODE_NORMAL)
+               device_display_change_state(DISPLAY_STATE_NORMAL);
+
        ret = notification_post_for_uid(noti, uid);
 
        notification_free(noti);
@@ -1920,6 +1928,11 @@ static void __alarm_expired()
                                        ALARM_MGR_EXCEPTION_PRINT("Unable to add alarm id to the bundle\n");
                                } else {
                                        int result = 0;
+                                       int expire_mode = ALARM_EXPIRE_MODE_NORMAL;
+                                       if (vconf_get_int(VCONFKEY_ALARM_EXPIRE_MODE, &expire_mode) != 0)
+                                               ALARM_MGR_EXCEPTION_PRINT("Failed to get value of VCONFKEY_ALARM_EXPIRE_MODE");
+
+                                       ALARM_MGR_LOG_PRINT("Value of alarm_expire_mode [%d]", expire_mode);
 
                                        if (__compare_api_version(&result, app_pid, __alarm_info->uid) < 0) {
                                                ALARM_MGR_EXCEPTION_PRINT("Unable to check api version\n");
@@ -1954,7 +1967,8 @@ static void __alarm_expired()
                                                                ALARM_MGR_EXCEPTION_PRINT("Unable to launch app [%s] \n", appid);
                                                        } else {
                                                                ALARM_MGR_LOG_PRINT("Successfuly ran app svc\n");
-                                                               if (__is_ui_app(appid, __alarm_info->uid))
+                                                               if (__is_ui_app(appid, __alarm_info->uid) &&
+                                                                               expire_mode == ALARM_EXPIRE_MODE_NORMAL)
                                                                        device_display_change_state(DISPLAY_STATE_NORMAL);
                                                        }
                                                }
@@ -4453,6 +4467,11 @@ static void __initialize()
        g_type_init();
 #endif
 
+       //For debug
+       int expire_mode = ALARM_EXPIRE_MODE_NORMAL;
+       vconf_get_int(VCONFKEY_ALARM_EXPIRE_MODE, &expire_mode);
+       ALARM_MGR_LOG_PRINT("alarm_expire_mode : %d", expire_mode);
+
        __initialize_timer();
        if (__initialize_dbus() == false) {
                /* because dbus's initialize