Commit 3e583180 authored by Nate Fischer's avatar Nate Fischer Committed by Chromium LUCI CQ

Android: inline deprecated BuildInfo methods (/ui/android)

No change to logic. This inlines BuildInfo.isAtLeast{Q,R} and
BuildInfo.targetsAtLeast{Q,R} (and their C++ equivalents) in
/ui/android.

The methods themselves will be removed in a follow-up CL once all call
sites have been removed.

This CL was uploaded by git cl split.

R=jaekyun@chromium.org

Bug: 1106920
Test: autoninja -C out/Default monochrome_public_apk
Change-Id: Iaf4c1102c9b464887cd30ab3f47b6fe2d8b52294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575334
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834428}
parent ccb9ddfe
...@@ -26,7 +26,6 @@ import androidx.annotation.Nullable; ...@@ -26,7 +26,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.BuildInfo;
import org.chromium.base.Callback; import org.chromium.base.Callback;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.StrictModeContext; import org.chromium.base.StrictModeContext;
...@@ -393,7 +392,9 @@ public class Clipboard implements ClipboardManager.OnPrimaryClipChangedListener ...@@ -393,7 +392,9 @@ public class Clipboard implements ClipboardManager.OnPrimaryClipChangedListener
* @param hasFocus Whether or not {@code activity} gained or lost focus. * @param hasFocus Whether or not {@code activity} gained or lost focus.
*/ */
public void onWindowFocusChanged(boolean hasFocus) { public void onWindowFocusChanged(boolean hasFocus) {
if (mNativeClipboard == 0 || !hasFocus || !BuildInfo.isAtLeastQ()) return; if (mNativeClipboard == 0 || !hasFocus || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
return;
}
onPrimaryClipTimestampInvalidated(); onPrimaryClipTimestampInvalidated();
} }
......
...@@ -32,7 +32,6 @@ import androidx.annotation.VisibleForTesting; ...@@ -32,7 +32,6 @@ import androidx.annotation.VisibleForTesting;
import org.chromium.base.ActivityState; import org.chromium.base.ActivityState;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.BuildInfo;
import org.chromium.base.Callback; import org.chromium.base.Callback;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.LifetimeAssert; import org.chromium.base.LifetimeAssert;
...@@ -227,7 +226,7 @@ public class WindowAndroid implements AndroidPermissionDelegate, DisplayAndroidO ...@@ -227,7 +226,7 @@ public class WindowAndroid implements AndroidPermissionDelegate, DisplayAndroidO
// if the API is used. See crbug.com/990646. // if the API is used. See crbug.com/990646.
// Disable refresh rate change on TV platforms, as it may cause black screen flicker due to // Disable refresh rate change on TV platforms, as it may cause black screen flicker due to
// display mode changes. // display mode changes.
mAllowChangeRefreshRate = BuildInfo.isAtLeastQ() && !isTv(context); mAllowChangeRefreshRate = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && !isTv(context);
// Multiple refresh rate support is only available on M+. // Multiple refresh rate support is only available on M+.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) recomputeSupportedRefreshRates(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) recomputeSupportedRefreshRates();
...@@ -712,7 +711,7 @@ public class WindowAndroid implements AndroidPermissionDelegate, DisplayAndroidO ...@@ -712,7 +711,7 @@ public class WindowAndroid implements AndroidPermissionDelegate, DisplayAndroidO
// gamut (on supported hardware and os). However it is important for embedders like WebView // gamut (on supported hardware and os). However it is important for embedders like WebView
// which do not make the wide gamut decision to check this at run time. // which do not make the wide gamut decision to check this at run time.
private boolean getWindowIsWideColorGamut() { private boolean getWindowIsWideColorGamut() {
if (!BuildInfo.isAtLeastQ()) return false; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) return false;
Window window = getWindow(); Window window = getWindow();
if (window == null) return false; if (window == null) return false;
return ApiHelperForOMR1.isWideColorGamut(window); return ApiHelperForOMR1.isWideColorGamut(window);
......
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