Make --enable-low-end-device-mode apply in C++ on Android
Currently, Android supports --enable-low-end-device-mode, but requires
that the flag be set/visible to Java. This limits the usefulness, as
we can't apply this flag via C++ in test scenarios. This change
modifies SysInfo::IsLowEndDevice to behave like
SysInfo::AmountOfAvailablePhysicalMemory in its handling of flags:
flags are checked / applied in platform-independent C++ before
forwarding to a platform-specific impl function in the case that
the default behavior was not overridden.
Change-Id: Ic2952ed5d2eb199f4daaa60aa2f1eb6dad87d205
Reviewed-on: https://chromium-review.googlesource.com/959301
Reviewed-by: danakj <[email protected]>
Commit-Queue: Eric Karl <[email protected]>
Cr-Commit-Position: refs/heads/master@{#542823}
diff --git a/base/sys_info_android.cc b/base/sys_info_android.cc
index 1d1710c7..7704796 100644
--- a/base/sys_info_android.cc
+++ b/base/sys_info_android.cc
@@ -222,7 +222,7 @@
android::SysUtils::IsLowEndDeviceFromJni> >::Leaky
g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER;
-bool SysInfo::IsLowEndDevice() {
+bool SysInfo::IsLowEndDeviceImpl() {
// This code might be used in some environments
// which might not have a Java environment.
// Note that we need to call the Java version here.