Index: base/android/java/src/org/chromium/base/SysUtils.java |
diff --git a/base/android/java/src/org/chromium/base/SysUtils.java b/base/android/java/src/org/chromium/base/SysUtils.java |
index e86bd4592ec5252808621cab99fcd08368a09a0c..5979ca40008847682a29fa20bec60830bd13033d 100644 |
--- a/base/android/java/src/org/chromium/base/SysUtils.java |
+++ b/base/android/java/src/org/chromium/base/SysUtils.java |
@@ -4,6 +4,7 @@ |
package org.chromium.base; |
+import android.app.ActivityManager; |
import android.content.Context; |
import android.content.pm.PackageManager; |
import android.os.Build; |
@@ -103,6 +104,19 @@ public class SysUtils { |
return sLowEndDevice.booleanValue(); |
} |
+ /** |
+ * @return Whether or not the system has low available memory. |
+ */ |
+ @CalledByNative |
+ private static boolean isCurrentlyLowMemory() { |
+ ActivityManager am = |
+ (ActivityManager) ContextUtils.getApplicationContext().getSystemService( |
+ Context.ACTIVITY_SERVICE); |
+ ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo(); |
+ am.getMemoryInfo(info); |
+ return info.lowMemory; |
+ } |
+ |
/** |
* Resets the cached value, if any. |
*/ |