Commit aa783bb6 authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Move isAndroidGo() to SysUtils

Bug: 1012975
Change-Id: Ic57e9d4aff392373c0ec9b5bf178b3e1701fea79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079541Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745458}
parent 2284efb3
...@@ -234,6 +234,14 @@ public class SysUtils { ...@@ -234,6 +234,14 @@ public class SysUtils {
sAmountOfPhysicalMemoryKB = physicalMemoryKB; sAmountOfPhysicalMemoryKB = physicalMemoryKB;
} }
/**
* @return Whether this device is running Android Go. This is assumed when we're running Android
* O or later and we're on a low-end device.
*/
public static boolean isAndroidGo() {
return isLowEndDevice() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
}
@NativeMethods @NativeMethods
interface Natives { interface Natives {
void logPageFaultCountToTracing(); void logPageFaultCountToTracing();
......
...@@ -275,15 +275,6 @@ public class CachedFeatureFlags { ...@@ -275,15 +275,6 @@ public class CachedFeatureFlags {
setForTesting(ChromeFeatureList.START_SURFACE_ANDROID, isEnabled); setForTesting(ChromeFeatureList.START_SURFACE_ANDROID, isEnabled);
} }
/**
* @return Whether this device is running Android Go. This is assumed when we're running Android
* O or later and we're on a low-end device.
*/
public static boolean isAndroidGo() {
return SysUtils.isLowEndDevice()
&& android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O;
}
/** /**
* Cache whether warming up network service process is enabled, so that the value * Cache whether warming up network service process is enabled, so that the value
* can be made available immediately on next start up. * can be made available immediately on next start up.
......
...@@ -23,6 +23,7 @@ import androidx.browser.customtabs.CustomTabsIntent; ...@@ -23,6 +23,7 @@ import androidx.browser.customtabs.CustomTabsIntent;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.SysUtils;
import org.chromium.base.task.PostTask; import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskTraits; import org.chromium.base.task.TaskTraits;
import org.chromium.chrome.R; import org.chromium.chrome.R;
...@@ -30,7 +31,6 @@ import org.chromium.chrome.browser.IntentHandler; ...@@ -30,7 +31,6 @@ import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.browserservices.BrowserServicesIntentDataProvider.CustomTabsUiType; import org.chromium.chrome.browser.browserservices.BrowserServicesIntentDataProvider.CustomTabsUiType;
import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider;
import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import java.util.Locale; import java.util.Locale;
...@@ -233,12 +233,12 @@ public class MediaViewerUtils { ...@@ -233,12 +233,12 @@ public class MediaViewerUtils {
private static boolean shouldEnableMediaLauncherActivity() { private static boolean shouldEnableMediaLauncherActivity() {
return sIsMediaLauncherActivityForceEnabledForTest return sIsMediaLauncherActivityForceEnabledForTest
|| ((CachedFeatureFlags.isAndroidGo() || isEnterpriseManaged()) || ((SysUtils.isAndroidGo() || isEnterpriseManaged())
&& ChromeFeatureList.isEnabled(ChromeFeatureList.HANDLE_MEDIA_INTENTS)); && ChromeFeatureList.isEnabled(ChromeFeatureList.HANDLE_MEDIA_INTENTS));
} }
private static boolean shouldEnableAudioLauncherActivity() { private static boolean shouldEnableAudioLauncherActivity() {
return shouldEnableMediaLauncherActivity() && !CachedFeatureFlags.isAndroidGo(); return shouldEnableMediaLauncherActivity() && !SysUtils.isAndroidGo();
} }
private static boolean isEnterpriseManaged() { private static boolean isEnterpriseManaged() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment