Commit 31f82b3c authored by Vishal Mahaveer's avatar Vishal Mahaveer Committed by Nishanth Menon

[LIB][ANDROID] Check if OS is Android based on lowmemorykiller

More Linux distributions support wake_lock now, use lowmemory killer
driver to identify Android OS.

Fixes: https://github.com/omapconf/omapconf/issues/35Reported-By: default avatarggardet <guillaume.gardet@opensuse.org>
Signed-off-by: default avatarVishal Mahaveer <vishalm@ti.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent 1e94ad3d
......@@ -79,11 +79,11 @@ unsigned short os_is_android(void)
FILE *fp = NULL;
/*
* Try to open /sys/power/wake_lock file.
* Try to open /sys/module/lowmemorykiller/parameters/minfree file.
* If successfull, OS is Android (Generic Linux Kernel does not
* support it).
*/
fp = fopen("/sys/power/wake_lock", "r");
fp = fopen("/sys/module/lowmemorykiller/parameters/minfree", "r");
if (fp == NULL) {
return 0;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment