Optimized flasg (Thanks to mrg666)
Ported ONDEMAND and INTERACTIVE from https://android.googlesource.com/kernel/common.git/+/android-3.0 (Google Common android-3.0 kernel)