Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: base/android/sys_utils_android.cc

Issue 258663002: Expose a low-end device mode override flags for non-android OSs as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android unittest build. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..9aa27d90a90e2f581532a5f57033f2c8d7ee09fe
--- /dev/null
+++ b/base/android/sys_utils_android.cc
@@ -0,0 +1,34 @@
+// 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/lazy_instance.h"
+#include "base/sys_info.h"
+#include "base/sys_info_internal.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
brettw 2014/06/11 21:02:40 Blank line above here.
c.shu 2014/06/12 21:12:48 Done.
+
+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
brettw 2014/06/11 21:02:40 Blank line above here
c.shu 2014/06/12 21:12:48 Done.

Powered by Google App Engine
This is Rietveld 408576698