MTK快霸加入白名单

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

MTK快霸加入白名单

  • 前言
  • 一、直接反射修改


前言

快霸是MTK自己做的对手机内存控制的一个app,会在低内存的时候,优化系统,杀掉后台服务,即使是系统级的app也会被杀掉


一、直接反射修改

diff --git a/alps/vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/am/AmsExtImpl.java b/alps/vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/am/AmsExtImpl.java
index 236d2ad7c9..de8bded4b4 100755
--- a/alps/vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/am/AmsExtImpl.java
+++ b/alps/vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/am/AmsExtImpl.java
@@ -229,6 +229,26 @@ public class AmsExtImpl extends AmsExt {
             mAalUtils = AalUtils.getInstance();
         }
         ///@}
+               
+                //add 过滤应用 begin    
+               try {
+                Method method= mDuraSpeedService.getClass().getMethod("getPlatformWhitelist", null);
+                //获取白名单列表
+                Object obj = method.invoke(mDuraSpeedService);                
+                if(obj != null && obj instanceof List) {
+                        List<String> list = (List<String>) obj;
+                        //加入自己的过滤app
+                        list.add("xxxxx");
+                        //更新白名单
+                        method = mDuraSpeedService.getClass().getMethod("setAppWhitelist", List.class);
+                        method.invoke(mDuraSpeedService, list);
+                }
+        }catch (Exception e){
+                Slog.e("AmsExtImpl add app to whitelist ", e.toString());
+        }
+        
+       //add 过滤应用 end
+          
     }

你可能感兴趣的:(android,java)