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

Unified Diff: base/android/java/src/org/chromium/base/SysUtils.java

Issue 17151011: Add a method for catching low end devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment Created 7 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
« no previous file with comments | « base/android/base_jni_registrar.cc ('k') | base/android/sys_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..535fdc27ab004845a26fdb420c27b0066c96635c
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/SysUtils.java
@@ -0,0 +1,30 @@
+// Copyright (c) 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.
+
+package org.chromium.base;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.MemoryInfo;
+import android.content.Context;
+import android.os.Build;
+
+/**
+ * Exposes system related information about the current device.
+ */
+public class SysUtils {
+ private static Boolean sLowEndDevice;
+
+ private SysUtils() { }
+
+ /**
+ * @return Whether or not this device should be considered a low end device.
+ */
+ public static boolean isLowEndDevice() {
+ if (sLowEndDevice == null) sLowEndDevice = nativeIsLowEndDevice();
+
+ return sLowEndDevice.booleanValue();
+ }
+
+ private static native boolean nativeIsLowEndDevice();
+}
« no previous file with comments | « base/android/base_jni_registrar.cc ('k') | base/android/sys_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698