diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-08-24 17:37:31 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-08-24 17:37:31 -0700 |
commit | 49d228b3f31789f4aed361b526b7edb619a542e9 (patch) | |
tree | 92ac8671ca58e7f2670ba3057fd2592104f4151d /core/java/android/app | |
parent | 2da59ffbda80594e6312f400341810f91e1d333a (diff) | |
download | frameworks_base-49d228b3f31789f4aed361b526b7edb619a542e9.zip frameworks_base-49d228b3f31789f4aed361b526b7edb619a542e9.tar.gz frameworks_base-49d228b3f31789f4aed361b526b7edb619a542e9.tar.bz2 |
New API to determine if device has lots of RAM.
Change-Id: Ie243e851960fdd9e1ebeaf1c1929879193620051
Diffstat (limited to 'core/java/android/app')
-rw-r--r-- | core/java/android/app/ActivityManager.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 93e30af..102fac1 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -235,6 +235,24 @@ public class ActivityManager { } /** + * Use to decide whether the running device can be considered a "large + * RAM" device. Exactly what memory limit large RAM is will vary, but + * it essentially means there is plenty of RAM to have lots of background + * processes running under decent loads. + * @hide + */ + static public boolean isLargeRAM() { + MemInfoReader reader = new MemInfoReader(); + reader.readMemInfo(); + if (reader.getTotalSize() >= (640*1024*1024)) { + // Currently 640MB RAM available to the kernel is the point at + // which we have plenty of RAM to spare. + return true; + } + return false; + } + + /** * Information you can retrieve about tasks that the user has most recently * started or visited. */ |