Merge "New API to determine if device has lots of RAM."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1fc756da43
@@ -234,6 +234,24 @@ public class ActivityManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Information you can retrieve about tasks that the user has most recently
|
||||||
* started or visited.
|
* started or visited.
|
||||||
|
|||||||
Reference in New Issue
Block a user