From 2c73cf09b10ff7f068fafefc6eb651fc4db8d9f1 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Tue, 5 Dec 2017 20:33:29 +0000 Subject: [PATCH] Android: remove isAtLeastO from robolectric test This removes the final use of BuildInfo.isAtLeastO from chromium code. This was previously blocked on robolectric not supporting O (but this has since been resolved by crbug.com/729135). Bug: 783418 Test: ninja chrome_junit_tests Change-Id: Ib7d4af9ff74912ccadfa3c9cae57553f3a217e94 Reviewed-on: https://chromium-review.googlesource.com/806745 Reviewed-by: Richard Coles Reviewed-by: Mounir Lamouri Commit-Queue: Nate Fischer Cr-Commit-Position: refs/heads/master@{#521811} --- .../java/src/org/chromium/base/BuildInfo.java | 23 +------------------ .../ui/MediaNotificationFaviconTest.java | 4 ++-- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java index e7011a46637361..89fee6263bd252 100644 --- a/base/android/java/src/org/chromium/base/BuildInfo.java +++ b/base/android/java/src/org/chromium/base/BuildInfo.java @@ -127,20 +127,7 @@ public static boolean isDebugAndroid() { // The markers Begin:BuildCompat and End:BuildCompat delimit code // that is autogenerated from Android sources. - // Begin:BuildCompat O,OMR1,P - - /** - * Checks if the device is running on a pre-release version of Android O or newer. - *

- * @return {@code true} if O APIs are available for use, {@code false} otherwise - * @deprecated Android O is a finalized release and this method is no longer necessary. It will - * be removed in a future release of the Support Library. Instead use - * {@code Build.SDK_INT >= Build.VERSION_CODES#O}. - */ - @Deprecated - public static boolean isAtLeastO() { - return VERSION.SDK_INT >= 26; - } + // Begin:BuildCompat OMR1,P /** * Checks if the device is running on a pre-release version of Android O MR1 or newer. @@ -168,14 +155,6 @@ public static boolean isAtLeastP() { return VERSION.CODENAME.equals("P"); } - /** - * Checks if the application targets at least released SDK O - */ - @Deprecated - public static boolean targetsAtLeastO() { - return ContextUtils.getApplicationContext().getApplicationInfo().targetSdkVersion >= 26; - } - /** * Checks if the application targets at least released SDK OMR1 */ diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationFaviconTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationFaviconTest.java index e780414401a811..db27defb072652 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationFaviconTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationFaviconTest.java @@ -20,7 +20,6 @@ import org.chromium.base.BaseChromiumApplication; import org.chromium.base.BaseSwitches; -import org.chromium.base.BuildInfo; import org.chromium.base.CommandLine; import org.chromium.chrome.R; import org.chromium.chrome.browser.media.ui.MediaNotificationManager.ListenerService; @@ -88,7 +87,8 @@ public void testSetNotificationIcon_lowMem_O() { mTabHolder.simulateMediaSessionStateChanged(true, false); mTabHolder.simulateFaviconUpdated(mFavicon); - assertEquals(BuildInfo.isAtLeastO() ? null : mFavicon, getDisplayedIcon()); + assertEquals(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? null : mFavicon, + getDisplayedIcon()); } private Bitmap getDisplayedIcon() {