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

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

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: address review comments. 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
« no previous file with comments | « base/android/java/src/org/chromium/base/BaseSwitches.java ('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
index a8fcdcb8169df1710447d0be0cfb2b0501f5a2c2..1108d9ed555b83b37bb84ea1f1701a7fda3c8f7f 100644
--- a/base/android/java/src/org/chromium/base/SysUtils.java
+++ b/base/android/java/src/org/chromium/base/SysUtils.java
@@ -32,14 +32,10 @@ public class SysUtils {
/**
* Return the amount of physical memory on this device in kilobytes.
- * Note: the only reason this is public is for testability reason.
* @return Amount of physical memory in kilobytes, or 0 if there was
* an error trying to access the information.
- *
- * Note that this is CalledByNative for testing purpose only.
*/
- @CalledByNative
- public static int amountOfPhysicalMemoryKB() {
+ private static int amountOfPhysicalMemoryKB() {
// Extract total memory RAM size by parsing /proc/meminfo, note that
// this is exactly what the implementation of sysconf(_SC_PHYS_PAGES)
// does. However, it can't be called because this method must be
@@ -108,11 +104,13 @@ public class SysUtils {
private static boolean detectLowEndDevice() {
if (CommandLine.isInitialized()) {
- if (CommandLine.getInstance().hasSwitch(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE)) {
- return true;
- }
- if (CommandLine.getInstance().hasSwitch(BaseSwitches.DISABLE_LOW_END_DEVICE_MODE)) {
- return false;
+ if (CommandLine.getInstance().hasSwitch(BaseSwitches.LOW_END_DEVICE_MODE)) {
+ int mode = Integer.parseInt(CommandLine.getInstance().getSwitchValue(
+ BaseSwitches.LOW_END_DEVICE_MODE));
+ if (mode == 1)
+ return true;
+ if (mode == 0)
+ return false;
}
}
« no previous file with comments | « base/android/java/src/org/chromium/base/BaseSwitches.java ('k') | base/android/sys_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698