diff options
author | Jason Monk <jmonk@google.com> | 2015-05-07 15:06:48 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-05-07 15:44:37 -0400 |
commit | f4db340daeb50572d7e0ab12f4745affae8b567f (patch) | |
tree | dfc8069daf287908a78b917da422bec83d685803 /src/com/android/settings/applications/ProcStatsPackageEntry.java | |
parent | e2d63fef3ccbfd3001b7e794b3ee1203fc1c77af (diff) | |
download | packages_apps_Settings-f4db340daeb50572d7e0ab12f4745affae8b567f.zip packages_apps_Settings-f4db340daeb50572d7e0ab12f4745affae8b567f.tar.gz packages_apps_Settings-f4db340daeb50572d7e0ab12f4745affae8b567f.tar.bz2 |
Consistently use weight to get average mem usage
Rather than just for the labels...
Also update bg mem to be converted to the same memory scale for
the bars. Also undo some bad average calculations that only made
things worse.
Bug: 20694769
Change-Id: I676803bf76d336355441891e768ba3c228dbfbca
Diffstat (limited to 'src/com/android/settings/applications/ProcStatsPackageEntry.java')
-rw-r--r-- | src/com/android/settings/applications/ProcStatsPackageEntry.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/settings/applications/ProcStatsPackageEntry.java b/src/com/android/settings/applications/ProcStatsPackageEntry.java index feb11d8..e056b06 100644 --- a/src/com/android/settings/applications/ProcStatsPackageEntry.java +++ b/src/com/android/settings/applications/ProcStatsPackageEntry.java @@ -90,10 +90,10 @@ public class ProcStatsPackageEntry implements Parcelable { for (int i=0; i < N; i++) { ProcStatsEntry entry = mEntries.get(i); mBgDuration += entry.mBgDuration; - mAvgBgMem += entry.mAvgBgMem * entry.mBgDuration; + mAvgBgMem += entry.mAvgBgMem; mBgWeight += entry.mBgWeight; mRunDuration += entry.mRunDuration; - mAvgRunMem += entry.mAvgRunMem * entry.mRunDuration; + mAvgRunMem += entry.mAvgRunMem; mRunWeight += entry.mRunWeight; // Each entry is generally a process or something similar. Since it is extremely @@ -103,12 +103,8 @@ public class ProcStatsPackageEntry implements Parcelable { mMaxBgMem += entry.mMaxBgMem; mMaxRunMem += entry.mMaxRunMem; } - if (mBgDuration != 0) { - mAvgBgMem = mAvgBgMem * N / mBgDuration; - } - if (mRunDuration != 0) { - mAvgRunMem = mAvgRunMem * N / mRunDuration; - } + mAvgBgMem /= N; + mAvgRunMem /= N; } public void retrieveUiData(Context context, PackageManager pm) { |