Commit 0050d7e3 authored by Tommy Nyquist's avatar Tommy Nyquist Committed by Commit Bot

Update checks for Android O to use generalized check

A couple of places in our code-based were hand-written to check for
whether the code was running on Android O, before we added support
for this through BuildInfo#isAtLeastO().

This CL makes them both call the generic method, so if that
generic method is changed, they will both benefit from that.

BUG=704209

Change-Id: I44b583af0744a67c889ef786eef7e6a96ddf8eed
Reviewed-on: https://chromium-review.googlesource.com/488129Reviewed-by: default avatarDan Alcantara <dfalcantara@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#467585}
parent 3eb135e0
...@@ -8,8 +8,8 @@ import android.content.BroadcastReceiver; ...@@ -8,8 +8,8 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build;
import org.chromium.base.BuildInfo;
import org.chromium.chrome.browser.notifications.ChannelsUpdater; import org.chromium.chrome.browser.notifications.ChannelsUpdater;
/** /**
...@@ -31,7 +31,7 @@ public final class PackageReplacedBroadcastReceiver extends BroadcastReceiver { ...@@ -31,7 +31,7 @@ public final class PackageReplacedBroadcastReceiver extends BroadcastReceiver {
public void onReceive(final Context context, Intent intent) { public void onReceive(final Context context, Intent intent) {
if (!Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())) return; if (!Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())) return;
updateChannelsIfNecessary(); updateChannelsIfNecessary();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) return; if (BuildInfo.isAtLeastO()) return;
UpgradeIntentService.startMigrationIfNecessary(context); UpgradeIntentService.startMigrationIfNecessary(context);
} }
......
...@@ -7,12 +7,12 @@ package org.chromium.chrome.browser.widget; ...@@ -7,12 +7,12 @@ package org.chromium.chrome.browser.widget;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Build;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.ViewParent; import android.view.ViewParent;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import org.chromium.base.BuildInfo;
import org.chromium.ui.resources.dynamics.ViewResourceAdapter; import org.chromium.ui.resources.dynamics.ViewResourceAdapter;
/** /**
...@@ -66,7 +66,7 @@ public class ViewResourceFrameLayout extends FrameLayout { ...@@ -66,7 +66,7 @@ public class ViewResourceFrameLayout extends FrameLayout {
protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
// TODO(tedchoc): Switch to a better API when available. crbug.com/681877 // TODO(tedchoc): Switch to a better API when available. crbug.com/681877
if (Build.VERSION.CODENAME.equals("O") && isReadyForCapture()) { if (BuildInfo.isAtLeastO() && isReadyForCapture()) {
mResourceAdapter.invalidate(null); mResourceAdapter.invalidate(null);
} }
} }
......
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