| Index: base/android/sys_utils.cc
|
| diff --git a/base/android/sys_utils.cc b/base/android/sys_utils.cc
|
| index 2a7db192bfb2e62c7f36593dc93310185b291e14..103324d95da36c6e091325857e39f9f4ff8bd864 100644
|
| --- a/base/android/sys_utils.cc
|
| +++ b/base/android/sys_utils.cc
|
| @@ -8,23 +8,6 @@
|
| #include "base/sys_info.h"
|
| #include "jni/SysUtils_jni.h"
|
|
|
| -// Any device that reports a physical RAM size less than this, in megabytes
|
| -// is considered 'low-end'. IMPORTANT: Read the LinkerLowMemoryThresholdTest
|
| -// comments in build/android/pylib/linker/test_case.py before modifying this
|
| -// value.
|
| -#define ANDROID_LOW_MEMORY_DEVICE_THRESHOLD_MB 512
|
| -
|
| -const int64 kLowEndMemoryThreshold =
|
| - 1024 * 1024 * ANDROID_LOW_MEMORY_DEVICE_THRESHOLD_MB;
|
| -
|
| -// Only support low end device changes on builds greater than JB MR2.
|
| -const int kLowEndSdkIntThreshold = 18;
|
| -
|
| -// Defined and called by JNI
|
| -static jboolean IsLowEndDevice(JNIEnv* env, jclass clazz) {
|
| - return base::android::SysUtils::IsLowEndDevice();
|
| -}
|
| -
|
| namespace base {
|
| namespace android {
|
|
|
| @@ -33,8 +16,13 @@ bool SysUtils::Register(JNIEnv* env) {
|
| }
|
|
|
| bool SysUtils::IsLowEndDevice() {
|
| - return SysInfo::AmountOfPhysicalMemory() <= kLowEndMemoryThreshold &&
|
| - BuildInfo::GetInstance()->sdk_int() > kLowEndSdkIntThreshold;
|
| + JNIEnv* env = AttachCurrentThread();
|
| + return Java_SysUtils_isLowEndDevice(env);
|
| +}
|
| +
|
| +size_t SysUtils::AmountOfPhysicalMemoryKB() {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + return static_cast<size_t>(Java_SysUtils_amountOfPhysicalMemoryKB(env));
|
| }
|
|
|
| SysUtils::SysUtils() { }
|
|
|