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

@@ -67,7 +67,7 @@ public class ProcessStatsPreference extends Preference {
setIcon(new ColorDrawable(0));
}
boolean statsForeground = entry.mRunWeight > entry.mBgWeight;
setSummary(statsForeground ? entry.getRunningFrequency(getContext())
setSummary(entry.mRunDuration > entry.mBgDuration ? entry.getRunningFrequency(getContext())
: entry.getBackgroundFrequency(getContext()));
mAvgRatio = (statsForeground ? entry.mAvgRunMem : entry.mAvgBgMem) / maxMemory;
mMaxRatio = (statsForeground ? entry.mMaxRunMem : entry.mMaxBgMem) / maxMemory - mAvgRatio;