| Index: base/android/sys_utils_android.cc
|
| diff --git a/base/android/sys_utils_android.cc b/base/android/sys_utils_android.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cd9c6b27b2c75ae67481d50d1b1ee95d83eadf70
|
| --- /dev/null
|
| +++ b/base/android/sys_utils_android.cc
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "base/android/sys_utils_android.h"
|
| +
|
| +#include "base/android/build_info.h"
|
| +#include "base/sys_info.h"
|
| +#include "jni/SysUtils_jni.h"
|
| +
|
| +namespace base {
|
| +namespace android {
|
| +
|
| +bool SysUtilsAndroid::Register(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| +bool SysUtilsAndroid::IsLowEndDeviceFromJni() {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + return Java_SysUtils_isLowEndDevice(env);
|
| +}
|
| +} // namespace android
|
| +
|
| +static base::LazyInstance<
|
| + base::internal::LazySysInfoValue<bool,
|
| + android::SysUtilsAndroid::IsLowEndDeviceFromJni> >::Leaky
|
| + g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +bool SysUtils::IsLowEndDevice() {
|
| + return g_lazy_low_end_device.Get().value();
|
| +}
|
| +} // namespace base
|
| +
|
|
|