Commit acb0e1da authored by aurimas's avatar aurimas Committed by Commit bot

Remove ICS support code in chrome/ and components/precache/

BUG=473837,431717
TBR=bengr@chromium.org

Review URL: https://codereview.chromium.org/1103293003

Cr-Commit-Position: refs/heads/master@{#327192}
parent da19048a
...@@ -11,7 +11,6 @@ import android.content.Context; ...@@ -11,7 +11,6 @@ import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
...@@ -222,8 +221,7 @@ public class AppMenu implements OnItemClickListener, OnKeyListener { ...@@ -222,8 +221,7 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
} }
// Don't animate the menu items for low end devices. // Don't animate the menu items for low end devices.
if (!SysUtils.isLowEndDevice() if (!SysUtils.isLowEndDevice()) {
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mPopup.getListView().addOnLayoutChangeListener(new View.OnLayoutChangeListener() { mPopup.getListView().addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override @Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, public void onLayoutChange(View v, int left, int top, int right, int bottom,
......
...@@ -9,7 +9,6 @@ import android.animation.AnimatorListenerAdapter; ...@@ -9,7 +9,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.app.Activity; import android.app.Activity;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
...@@ -51,8 +50,7 @@ public class ChromeFullscreenManager ...@@ -51,8 +50,7 @@ public class ChromeFullscreenManager
// Maximum length of the slide in/out animation of the toolbar (in ms). // Maximum length of the slide in/out animation of the toolbar (in ms).
private static final long MAX_ANIMATION_DURATION_MS = 500; private static final long MAX_ANIMATION_DURATION_MS = 500;
private static final int MSG_ID_CONTROLS_REQUEST_LAYOUT = 1; private static final int MSG_ID_HIDE_CONTROLS = 1;
private static final int MSG_ID_HIDE_CONTROLS = 2;
private final HashSet<Integer> mPersistentControlTokens = new HashSet<Integer>(); private final HashSet<Integer> mPersistentControlTokens = new HashSet<Integer>();
...@@ -166,9 +164,6 @@ public class ChromeFullscreenManager ...@@ -166,9 +164,6 @@ public class ChromeFullscreenManager
ChromeFullscreenManager chromeFullscreenManager = mChromeFullscreenManager.get(); ChromeFullscreenManager chromeFullscreenManager = mChromeFullscreenManager.get();
if (chromeFullscreenManager == null) return; if (chromeFullscreenManager == null) return;
switch (msg.what) { switch (msg.what) {
case MSG_ID_CONTROLS_REQUEST_LAYOUT:
chromeFullscreenManager.mControlContainer.requestLayout();
break;
case MSG_ID_HIDE_CONTROLS: case MSG_ID_HIDE_CONTROLS:
chromeFullscreenManager.update(false); chromeFullscreenManager.update(false);
break; break;
...@@ -505,14 +500,6 @@ public class ChromeFullscreenManager ...@@ -505,14 +500,6 @@ public class ChromeFullscreenManager
scheduleVisibilityUpdate(); scheduleVisibilityUpdate();
if (shouldShowAndroidControls()) mControlContainer.setTranslationY(getControlOffset()); if (shouldShowAndroidControls()) mControlContainer.setTranslationY(getControlOffset());
// In ICS, the toolbar can appear clipped when compositor content is not being drawn
// beneath it (at the top of the page, during side swipe). Requesting a layout clears
// up the issue (see crbug.com/172631).
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
if (!mHandler.hasMessages(MSG_ID_CONTROLS_REQUEST_LAYOUT)) {
mHandler.sendEmptyMessage(MSG_ID_CONTROLS_REQUEST_LAYOUT);
}
}
for (int i = 0; i < mListeners.size(); i++) { for (int i = 0; i < mListeners.size(); i++) {
mListeners.get(i).onVisibleContentOffsetChanged(getVisibleContentOffset()); mListeners.get(i).onVisibleContentOffsetChanged(getVisibleContentOffset());
} }
......
...@@ -9,8 +9,6 @@ import android.animation.AnimatorListenerAdapter; ...@@ -9,8 +9,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet; import android.animation.AnimatorSet;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder; import android.animation.PropertyValuesHolder;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View; import android.view.View;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateDecelerateInterpolator;
...@@ -217,15 +215,13 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener ...@@ -217,15 +215,13 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
mTargetWrapperView.startTransition(); mTargetWrapperView.startTransition();
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
mTargetWrapperView.finishTransition(); mTargetWrapperView.finishTransition();
mContainer.finishTransition(); mContainer.finishTransition();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && mToShow != null if (mToShow != null && (mAnimationType == ANIMATION_TYPE_SHOW
&& (mAnimationType == ANIMATION_TYPE_SHOW || mAnimationType == ANIMATION_TYPE_SWAP)) {
|| mAnimationType == ANIMATION_TYPE_SWAP)) {
TextView messageView = (TextView) mToShow.findViewById(R.id.infobar_message); TextView messageView = (TextView) mToShow.findViewById(R.id.infobar_message);
if (messageView != null) { if (messageView != null) {
mToShow.announceForAccessibility(messageView.getText()); mToShow.announceForAccessibility(messageView.getText());
......
...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.media.remote; ...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.media.remote;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
...@@ -106,7 +107,7 @@ public abstract class LockScreenTransportControl ...@@ -106,7 +107,7 @@ public abstract class LockScreenTransportControl
// wallpaper (which we set to the poster of the current video) when the phone is // wallpaper (which we set to the poster of the current video) when the phone is
// locked. Also, once the minSdkVersion is updated in the manifest, get rid of the // locked. Also, once the minSdkVersion is updated in the manifest, get rid of the
// code for older SDK versions. // code for older SDK versions.
if (android.os.Build.VERSION.SDK_INT < 18) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
sInstance = new LockScreenTransportControlV16(context); sInstance = new LockScreenTransportControlV16(context);
} else { } else {
sInstance = new LockScreenTransportControlV18(context); sInstance = new LockScreenTransportControlV18(context);
......
...@@ -12,7 +12,6 @@ import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW; ...@@ -12,7 +12,6 @@ import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW;
import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE; import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE;
import static android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN; import static android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN;
import android.os.Build;
import android.os.SystemClock; import android.os.SystemClock;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
...@@ -75,8 +74,6 @@ public class MemoryUma { ...@@ -75,8 +74,6 @@ public class MemoryUma {
private static void memoryNotificationForeground(int notification) { private static void memoryNotificationForeground(int notification) {
assert notification >= 0 && notification < FOREGROUND_MAX; assert notification >= 0 && notification < FOREGROUND_MAX;
// Before Jelly Bean we have only LowMemory foreground notification.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
RecordHistogram.recordEnumeratedHistogram("MemoryAndroid.NotificationForeground", RecordHistogram.recordEnumeratedHistogram("MemoryAndroid.NotificationForeground",
notification, FOREGROUND_MAX); notification, FOREGROUND_MAX);
} }
......
...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.contextmenu; ...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.contextmenu;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.test.FlakyTest; import android.test.FlakyTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.view.ContextMenu; import android.view.ContextMenu;
...@@ -96,8 +95,6 @@ public class ContextMenuTest extends ChromeShellTestBase { ...@@ -96,8 +95,6 @@ public class ContextMenuTest extends ChromeShellTestBase {
// @MediumTest // @MediumTest
@Feature({"Browser"}) @Feature({"Browser"})
public void testCopyImageToClipboard() throws InterruptedException, TimeoutException { public void testCopyImageToClipboard() throws InterruptedException, TimeoutException {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
Tab tab = getActivity().getActiveTab(); Tab tab = getActivity().getActiveTab();
ContextMenuUtils.selectContextMenuItem(this, tab, "testImage", ContextMenuUtils.selectContextMenuItem(this, tab, "testImage",
R.id.contextmenu_copy_image); R.id.contextmenu_copy_image);
......
...@@ -16,7 +16,6 @@ import android.test.suitebuilder.annotation.SmallTest; ...@@ -16,7 +16,6 @@ import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.ContentSetting;
import org.chromium.chrome.browser.preferences.website.PushNotificationInfo; import org.chromium.chrome.browser.preferences.website.PushNotificationInfo;
import org.chromium.chrome.browser.widget.RoundedIconGenerator; import org.chromium.chrome.browser.widget.RoundedIconGenerator;
...@@ -36,7 +35,6 @@ import java.util.concurrent.TimeoutException; ...@@ -36,7 +35,6 @@ import java.util.concurrent.TimeoutException;
* *
* Web Notifications are only supported on Android JellyBean and beyond. * Web Notifications are only supported on Android JellyBean and beyond.
*/ */
@MinAndroidSdkLevel(Build.VERSION_CODES.JELLY_BEAN)
public class NotificationUIManagerTest extends ChromeShellTestBase { public class NotificationUIManagerTest extends ChromeShellTestBase {
private static final String NOTIFICATION_TEST_PAGE = private static final String NOTIFICATION_TEST_PAGE =
TestHttpServerClient.getUrl("chrome/test/data/notifications/android_test.html"); TestHttpServerClient.getUrl("chrome/test/data/notifications/android_test.html");
......
...@@ -4,21 +4,16 @@ ...@@ -4,21 +4,16 @@
package org.chromium.chrome.browser.preferences.website; package org.chromium.chrome.browser.preferences.website;
import android.os.Build;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.Smoke; import android.test.suitebuilder.annotation.Smoke;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.content.browser.test.NativeLibraryTestBase; import org.chromium.content.browser.test.NativeLibraryTestBase;
/** /**
* Tests for WebsiteAddress. * Tests for WebsiteAddress.
* loadNativeLibraryAndInitBrowserProcess seems to be flaky on ICS.
* http://crbug.com/431717
*/ */
@MinAndroidSdkLevel(Build.VERSION_CODES.JELLY_BEAN)
public class WebsiteAddressTest extends NativeLibraryTestBase { public class WebsiteAddressTest extends NativeLibraryTestBase {
@Smoke @Smoke
......
...@@ -196,7 +196,6 @@ public class PrintingControllerTest extends ChromeShellTestBase { ...@@ -196,7 +196,6 @@ public class PrintingControllerTest extends ChromeShellTestBase {
} }
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void callLayoutOnUiThread( private void callLayoutOnUiThread(
final PrintingControllerImpl controller, final PrintingControllerImpl controller,
final PrintAttributes oldAttributes, final PrintAttributes oldAttributes,
......
...@@ -7,7 +7,6 @@ package org.chromium.components.precache; ...@@ -7,7 +7,6 @@ package org.chromium.components.precache;
import android.content.Context; import android.content.Context;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.os.Build;
import org.chromium.base.VisibleForTesting; import org.chromium.base.VisibleForTesting;
...@@ -52,10 +51,6 @@ public class NetworkInfoDelegate { ...@@ -52,10 +51,6 @@ public class NetworkInfoDelegate {
} }
protected boolean isActiveNetworkMetered() { protected boolean isActiveNetworkMetered() {
// ConnectivityManager.isActiveNetworkMetered was added in SDK API 16.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
return false;
}
return mConnectivityManager.isActiveNetworkMetered(); return mConnectivityManager.isActiveNetworkMetered();
} }
} }
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