proc-stat : no more freeze app soon after it goes to the background state 88/126388/2 accepted/tizen/unified/20170425.044936 submit/tizen/20170424.051821
authorKichan Kwon <k_c.kwon@samsung.com>
Fri, 21 Apr 2017 07:09:39 +0000 (16:09 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 21 Apr 2017 07:29:33 +0000 (16:29 +0900)
- We want to give a time for apps to prepare for being frozen
- The app going to the background a moment ago will skip this process

Change-Id: Ib9f453beb6a96865e424651055318dec695887bc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/proc-stat/proc-process.c

index 9ec30c2..5173403 100644 (file)
@@ -147,6 +147,16 @@ static int proc_backgrd_manage(int currentpid, int active, int oom_score_adj)
                        if (!spi->main_pid || spi->type != PROC_TYPE_GUI)
                                continue;
 
+                       /*
+                        * It checks all applications from proc_app_list
+                        * So, current background process can be checked again.
+                        * It is because lru value of this application was already changed,
+                        * it should be skipped
+                        */
+
+                       if (spi == pai)
+                               continue;
+
                        pid = spi->main_pid;
                        snprintf(buf, sizeof(buf), PROC_OOM_SCORE_ADJ_PATH, pid);
                        fp = fopen(buf, "r+");