应用加入白名单添加如下
增加低内存白名单:
perry@perry-li:/androidDev/android_source/POCft18/frameworks/base$ git show cbf62cbd6d45adf16fc6a3
204f86aa65349f4bc7
commit cbf62cbd6d45adf16fc6a3204f86aa65349f4bc7
Author: lijp <lijp@flyscale.cn>
Date: Mon Dec 16 15:44:28 2024 +0800
dmr对讲加入白名单,防止被杀死
Change-Id: I347e307944b3b3ea18c9d0c26c80217958a849fd
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 0a74abc92485..48d3cb9d88e4 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -197,6 +197,10 @@
<!-- Whether dialogs should close automatically when the user touches outside
of them. This should not normally be modified. -->
<bool name="config_closeDialogWhenTouchOutside">true</bool>
+<string-array translatable="false" name="low_memory_killer_tracker_whitelist" >
+ <item>"com.flyscale.dmr"</item>
+</string-array>
+
<!-- Device configuration indicating whether we should avoid using accelerated graphics
in certain places to reduce RAM footprint. This is ignored if ro.config.low_ram
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index b1e02f7dd536..9d6002d67f54 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -4800,4 +4800,5 @@
<java-symbol type="string" name="status_bar_hdvoice" />
<java-symbol type="array" name="config_trim_recent_task_exempt" />
+ <java-symbol type="array" name="low_memory_killer_tracker_whitelist" />
</resources>
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/and
roid/server/am/OomAdjuster.java
index 0070269ed8c9..0905a7e2136d 100755
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -121,6 +121,9 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
+import android.content.res.Resources;
+
/**