Updates/fixes to memory settings

- Update memory states to be Good performance, Ok performance, etc.
 - Update header info to be based on history rather than
   instantaneous
 - Color memory bar differently based on state
 - Fix run frequency bucketing to be correct
 - Show dialog for selecting duration, and fix duration selection
 - Update process naming to:
      - If process name is "anything:xxxx" then show "Xxxx"
      - If process name is "com.app.package.interface" then show "Interface"
      - If process name is the package name then show the app name
      - Otherwise fallback to the process name string

Bug: 20694769
Change-Id: Ic1fab28bfd2422bde84dd10bd305a4cc34be98cf
This commit is contained in:
Jason Monk
2015-05-07 12:44:09 -04:00
parent 0d2a8d204b
commit 1de522323f
7 changed files with 95 additions and 50 deletions

View File

@@ -101,7 +101,14 @@ public class ProcStatsData {
}
public int getMemState() {
return mMemState;
int factor = mStats.mMemFactor;
if (factor == ProcessStats.ADJ_NOTHING) {
return ProcessStats.ADJ_MEM_FACTOR_NORMAL;
}
if (factor >= ProcessStats.ADJ_SCREEN_ON) {
factor -= ProcessStats.ADJ_SCREEN_ON;
}
return factor;
}
public MemInfo getMemInfo() {
@@ -318,9 +325,11 @@ public class ProcStatsData {
double weightToRam;
double totalRam;
double totalScale;
long memTotalTime;
private MemInfo(Context context, ProcessStats.TotalMemoryUseCollection totalMem,
long memTotalTime) {
this.memTotalTime = memTotalTime;
calculateWeightInfo(context, totalMem, memTotalTime);
double usedRam = (usedWeight * 1024) / memTotalTime;