summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-05-09 21:34:42 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-09 21:34:42 -0700
commit2c2864f65c5cec6aebcb1b5612331f3946893042 (patch)
tree3ab07b4425c71e63bf994b7f6e420a4082692a0f /core/java
parentdd79ae6b7201b68dbe2a223d2f371ea1a473f6c4 (diff)
parent59325eb31f25704bb88c348160bb69e7c1aa3b48 (diff)
downloadframeworks_base-2c2864f65c5cec6aebcb1b5612331f3946893042.zip
frameworks_base-2c2864f65c5cec6aebcb1b5612331f3946893042.tar.gz
frameworks_base-2c2864f65c5cec6aebcb1b5612331f3946893042.tar.bz2
Merge "Add new API to find total RAM." into jb-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActivityManager.java13
-rw-r--r--core/java/android/os/Process.java3
2 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 7746ca9..4e61c3c 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1078,13 +1078,20 @@ public class ActivityManager {
*/
public static class MemoryInfo implements Parcelable {
/**
- * The total available memory on the system. This number should not
+ * The available memory on the system. This number should not
* be considered absolute: due to the nature of the kernel, a significant
* portion of this memory is actually in use and needed for the overall
* system to run well.
*/
public long availMem;
-
+
+ /**
+ * The total memory accessible by the kernel. This is basically the
+ * RAM size of the device, not including below-kernel fixed allocations
+ * like DMA buffers, RAM for the baseband CPU, etc.
+ */
+ public long totalMem;
+
/**
* The threshold of {@link #availMem} at which we consider memory to be
* low and start killing background services and other non-extraneous
@@ -1116,6 +1123,7 @@ public class ActivityManager {
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(availMem);
+ dest.writeLong(totalMem);
dest.writeLong(threshold);
dest.writeInt(lowMemory ? 1 : 0);
dest.writeLong(hiddenAppThreshold);
@@ -1126,6 +1134,7 @@ public class ActivityManager {
public void readFromParcel(Parcel source) {
availMem = source.readLong();
+ totalMem = source.readLong();
threshold = source.readLong();
lowMemory = source.readInt() != 0;
hiddenAppThreshold = source.readLong();
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 1df53e8..18fd3cb 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -897,6 +897,9 @@ public class Process {
public static final native long getFreeMemory();
/** @hide */
+ public static final native long getTotalMemory();
+
+ /** @hide */
public static final native void readProcLines(String path,
String[] reqFields, long[] outSizes);