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

Side by Side Diff: base/android/sys_utils.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/sys_utils.h ('k') | base/base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/android/sys_utils.h"
6
7 #include "base/sys_info.h"
8 #include "jni/SysUtils_jni.h"
9
10 const int64 kLowEndMemoryThreshold = 1024 * 1024 * 512; // 512 mb.
11
12 // Defined and called by JNI
13 static jboolean IsLowEndDevice(JNIEnv* env, jclass clazz) {
14 return base::android::SysUtils::IsLowEndDevice();
15 }
16
17 namespace base {
18 namespace android {
19
20 bool SysUtils::Register(JNIEnv* env) {
21 return RegisterNativesImpl(env);
22 }
23
24 bool SysUtils::IsLowEndDevice() {
25 return SysInfo::AmountOfPhysicalMemory() <= kLowEndMemoryThreshold;
26 }
27
28 SysUtils::SysUtils() { }
29
30 } // namespace android
31 } // namespace base
OLDNEW
« no previous file with comments | « base/android/sys_utils.h ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698