author | xiaoliang.wang <xiaoliang.wang@amlogic.com> | 2017-12-13 03:22:58 (GMT) |
---|---|---|
committer | xiaoliang.wang <xiaoliang.wang@amlogic.com> | 2017-12-13 03:22:58 (GMT) |
commit | 6d0878315fe01d0566f197a4246de895cb586431 (patch) | |
tree | a75d2fa7cba814e59db136a4ffb0c0652ec26b2d | |
parent | fd796838b73c9e5d44d146a7fb21206f07b75907 (diff) | |
download | frameworks-6d0878315fe01d0566f197a4246de895cb586431.zip frameworks-6d0878315fe01d0566f197a4246de895cb586431.tar.gz frameworks-6d0878315fe01d0566f197a4246de895cb586431.tar.bz2 |
Optimization: change check logic for cts and gts test[1/1]
PD#156706
change check logic for cts and gts test
Change-Id: I330ac1f35e489f4fa5d94657e9b9aa4999fc5a1f
-rw-r--r-- | core/res/src/com/droidlogic/Optimization.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/res/src/com/droidlogic/Optimization.java b/core/res/src/com/droidlogic/Optimization.java index 95fd481..6165f98 100644 --- a/core/res/src/com/droidlogic/Optimization.java +++ b/core/res/src/com/droidlogic/Optimization.java @@ -55,11 +55,13 @@ public class Optimization extends Service { public void run() { int retProc = -1; int retPkg = -1; + boolean isInProcOpt = false; + boolean isInPkgOpt = false; ActivityManager am = (ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE); while (true) { try { - if (retProc != 0 && retProc != -4) {//0:PKG_BENCH, -4:PKG_SAME + if (!isInProcOpt) { List< ActivityManager.RunningTaskInfo > task = am.getRunningTasks (1); if (!task.isEmpty()) { ComponentName cn = task.get (0).topActivity; @@ -67,10 +69,16 @@ public class Optimization extends Service { String cls = cn.getClassName(); retPkg = nativeOptimization(pkg, cls);//bench match + if (retPkg == 0) {//0:PKG_BENCH, -4:PKG_SAME + isInPkgOpt = true; + } + else if (retPkg != -4) { + isInPkgOpt = false; + } } } - if (retPkg != 0/* && retPkg != -4*/) { + if (!isInPkgOpt) { List< ActivityManager.RunningAppProcessInfo> apInfo = am.getRunningAppProcesses(); int len = apInfo.size(); //Log.i(TAG, "apInfo.size():" + len); @@ -80,6 +88,12 @@ public class Optimization extends Service { proc[i] = apInfo.get(i).processName; } retProc = nativeOptimization(proc); + if (retProc == 0) { + isInProcOpt = true; + } + else if (retProc != -4) { + isInProcOpt = false; + } } Thread.sleep(50); |