diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-08-05 17:51:48 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-08-05 17:51:48 -0700 |
commit | 2826bc4ca52686f6863409e36eaea1a7f45de3eb (patch) | |
tree | c088281a5c865e349b500a01ac69b1d0682dd579 /src/com | |
parent | 5c2d982f8e2bc1fc58ea89d747fde2c581095b37 (diff) | |
download | packages_apps_settings-2826bc4ca52686f6863409e36eaea1a7f45de3eb.zip packages_apps_settings-2826bc4ca52686f6863409e36eaea1a7f45de3eb.tar.gz packages_apps_settings-2826bc4ca52686f6863409e36eaea1a7f45de3eb.tar.bz2 |
Use new more efficient API for retrieving pss.
Change-Id: Ibcbcc397c2a7c19acd2de640528392df9bb780bb
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/applications/RunningState.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/settings/applications/RunningState.java b/src/com/android/settings/applications/RunningState.java index 8ca17a5..e9053b9 100644 --- a/src/com/android/settings/applications/RunningState.java +++ b/src/com/android/settings/applications/RunningState.java @@ -388,8 +388,8 @@ public class RunningState { return changed; } - boolean updateSize(Context context, Debug.MemoryInfo mem, int curSeq) { - mSize = ((long)mem.getTotalPss()) * 1024; + boolean updateSize(Context context, long pss, int curSeq) { + mSize = pss * 1024; if (mCurSeq == curSeq) { String sizeStr = Formatter.formatShortFileSize( context, mSize); @@ -964,12 +964,12 @@ public class RunningState { for (int i=0; i<numProc; i++) { pids[i] = mAllProcessItems.get(i).mPid; } - Debug.MemoryInfo[] mem = ActivityManagerNative.getDefault() - .getProcessMemoryInfo(pids); + long[] pss = ActivityManagerNative.getDefault() + .getProcessPss(pids); int bgIndex = 0; for (int i=0; i<pids.length; i++) { ProcessItem proc = mAllProcessItems.get(i); - changed |= proc.updateSize(context, mem[i], mSequence); + changed |= proc.updateSize(context, pss[i], mSequence); if (proc.mCurSeq == mSequence) { serviceProcessMemory += proc.mSize; } else if (proc.mRunningProcessInfo.importance >= |