公益活动策划方案android11源码中如何提⾼应⽤oom_adj级别,保活应⽤动态调整某个应⽤的进程级别,防⽌系统因低内存被kill,可配合读取⽩名单列表(列表中是应⽤包名列表)使⽤,这⾥只是介绍思路。
一品鲍鱼1.找到⽂件frameworks/ba/rvices/core/java/com/android/rver/am/OomAdjuster.java
//引⽤此包
import com.android.rver.am.ProcessList;
2.找到⽅法private final boolean applyOomAdjLocked(ProcessRecord app, boolean doingAll, long now,long nowElapd) boolean success = true;
赵孟頫小楷if (CurRawAdj() != app.tRawAdj) {
华为桌面壁纸app.tRawAdj = CurRawAdj();将的成语
五年级解方程练习题}
int changes = 0;
//step1.这⾥是读取⾃定义的⽩名单列表
家园共育案例String[] OomAdjusterArray();
// don't compact during bootup
if (mCachedAppOptimizer.uCompaction() && mService.mBooted) {
// Cached and prev/home compaction
if (app.curAdj != app.tAdj) {
贺卡手工// Perform a minor compaction when a perceptible app becomes the prev/home