Check the option which indicates whether window is enabled or not.
If the corresponding option is turned off, then do not execute
window related code in proc and lowmem modules.
If the option is turned on,
- Update window stack each time
- Active 'ForegroundAppList' config
- Consider window information during LMK
Change-Id: Id976634628ca9bdd49e8e508ebc70739c410f7e3
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
--- /dev/null
+/*
+ * resourced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "proc-common.h"
+
+static bool foreground_app_list_status_enabled = false;
+
+void proc_enable_foreground_app_list_status(void)
+{
+ foreground_app_list_status_enabled = true;
+}
+
+bool proc_is_enabled_of_foreground_app_list_status(void)
+{
+ return foreground_app_list_status_enabled;
+}
struct proc_conf_info* fixed_app_and_service_exist_check(const char *name, enum proc_type proc_type);
enum proc_action fixed_app_and_service_watchdog_action(const char *name, enum proc_type proc_type);
+void proc_enable_foreground_app_list_status(void);
+bool proc_is_enabled_of_foreground_app_list_status(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
int z = 0;
int ret;
+ if (!proc_is_enabled_of_foreground_app_list_status())
+ return RESOURCED_ERROR_NONE;
+
ret = d_bus_call_method_sync_gvariant_with_reply(WINDOW_SYSTEM_BUS_NAME,
WINDOW_SYSTEM_OBJECT_PATH, WINDOW_SYSTEM_INTERFACE_NAME,
GET_VISIBLE_WINDOW_INFO_V2, NULL, &reply);
static bool is_foreground_app(int oom_score_adj,
int foreground_oom_score_adj)
{
+ if (!proc_is_enabled_of_foreground_app_list_status())
+ return false;
+
if (oom_score_adj != OOMADJ_FOREGRD_LOCKED &&
oom_score_adj != OOMADJ_FOREGRD_UNLOCKED)
return false;
GArray *task_info_app_array = NULL;
GArray *task_info_proc_array = NULL;
+ if (!proc_is_enabled_of_foreground_app_list_status()) {
+ switch (oom_level) {
+ case OOM_LEVEL_BACKGROUND_LEAST_RECENTLY_USED:
+ case OOM_LEVEL_BACKGROUND_MOST_RECENTLY_USED:
+ case OOM_LEVEL_FOREGROUND_AND_PROC:
+ case OOM_LEVEL_ALL:
+ break;
+ case OOM_LEVEL_FOREGROUND:
+ status = LOWMEM_RECLAIM_NEXT_TYPE;
+ goto leave;
+ default:
+ _E("oom level is out of range");
+ assert(0);
+ }
+ }
+
task_info_app_array = lowmem_get_task_info_app(flags, start_oom, end_oom);
/**
* If start_oom == OOMADJ_SU, processes in /proc will be