Add S_LCDDIM in process_background and process_foreground 26/245026/2
authorlokilee73 <changjoo.lee@samsung.com>
Tue, 29 Sep 2020 07:59:38 +0000 (16:59 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 5 Oct 2020 02:35:57 +0000 (11:35 +0900)
S_NORMAL is affected by signal, AppStatusChange.
ex) lock status of process with the signal
    node->background: true, LOCK is ignored
    node->background: false, LOCK is valid

Add S_LCDDIM to make it controlled by AppStatusChange as well.

Change-Id: I4f97a07c39bc58c8599a8dae68601849bff12791
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/display/display-lock.c

index f97b973..c7d88c7 100644 (file)
@@ -407,7 +407,13 @@ int process_background(void *data)
        node = find_node(S_NORMAL, pid);
        if (node) {
                node->background = true;
-               _I("Process(%d) is background, then PM will be unlocked LCD_NORMAL.", pid);
+               _I("Process(%d) goes background. LCD_NORMAL will be unlocked.", pid);
+       }
+
+       node = find_node(S_LCDDIM, pid);
+       if (node) {
+               node->background = true;
+               _I("Process(%d) goes background. LCD_DIM will be unlocked.", pid);
        }
 
        return 0;
@@ -423,7 +429,13 @@ int process_foreground(void *data)
        node = find_node(S_NORMAL, pid);
        if (node) {
                node->background = false;
-               _I("Process(%d) is foreground, then PM will be locked LCD_NORMAL.", pid);
+               _I("Process(%d) goes foreground. LCD_NORMAL will be locked.", pid);
+       }
+
+       node = find_node(S_LCDDIM, pid);
+       if (node) {
+               node->background = false;
+               _I("Process(%d) goes foreground. LCD_DIM will be locked.", pid);
        }
 
        return 0;