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

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

Issue 2164503003: [OfflinePages] Do not start background loading on low-end devices if app has any visible Activities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resets the SysUtils and ApplicationStatus static state so it does not leak to other robolectric tes… Created 4 years, 5 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/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 04a833257f53792eb1c1b379941b8070b13e1443..cc5a32cfded7608838bd77dcab3eafb09f3d801a 100644
--- a/base/android/java/src/org/chromium/base/SysUtils.java
+++ b/base/android/java/src/org/chromium/base/SysUtils.java
@@ -99,6 +99,14 @@ public class SysUtils {
return sLowEndDevice.booleanValue();
}
+ /**
+ * Resets the cached value, if any.
+ */
+ @VisibleForTesting
+ public static void reset() {
+ sLowEndDevice = null;
Pete Williamson 2016/07/20 18:29:59 Should reset be calling detectLowEndDevice() inste
Yaron 2016/07/21 13:48:06 true, but it's sorta moot. The next call to isLowE
+ }
+
private static boolean detectLowEndDevice() {
assert CommandLine.isInitialized();
if (CommandLine.getInstance().hasSwitch(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE)) {

Powered by Google App Engine
This is Rietveld 408576698