android11源码中如何提⾼应⽤oom_adj级别,保活应⽤动态调整某个应⽤的进程级别,防⽌系统因低内存被kill,可配合读取⽩名单列表(列表中是应⽤包名列表)使⽤,这⾥只是介绍思路。
1.找到⽂件frameworks/ba/rvices/core/java/com/android/rver/am/OomAdjuster.java什么是俚语
下终南山过斟斯山人宿置酒
//引⽤此包
网上辅导import com.android.rver.am.ProcessList;nenu
德文翻译在线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();
puppy love
// don't compact during bootup
if (mCachedAppOptimizer.uCompaction() && mService.mBooted) {学习英语需要多少钱
// Cached and prev/home compaction
all i want is everythingif (app.curAdj != app.tAdj) {
eager// Perform a minor compaction when a perceptible app becomes the prev/home