| Index: android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| diff --git a/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| index c2d596e381171221391cd2491fc42715dd773ac0..a119acb79f1167be4bc43d1ef8e446a509403c9d 100644
|
| --- a/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| +++ b/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| @@ -12,6 +12,7 @@ import android.content.ContentResolver;
|
| import android.content.Context;
|
| import android.content.Intent;
|
| import android.content.pm.PackageManager;
|
| +import android.content.res.ColorStateList;
|
| import android.content.res.Configuration;
|
| import android.content.res.Resources;
|
| import android.content.res.Resources.NotFoundException;
|
| @@ -429,4 +430,28 @@ public class ApiCompatibilityUtils {
|
| }
|
| return drawable;
|
| }
|
| +
|
| + /**
|
| + * @see android.content.res.Resources#getColor(int id).
|
| + */
|
| + @SuppressWarnings("deprecation")
|
| + public static int getColor(Resources res, int id) throws NotFoundException {
|
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
| + return res.getColor(id, null);
|
| + } else {
|
| + return res.getColor(id);
|
| + }
|
| + }
|
| +
|
| + /**
|
| + * @see android.content.res.Resources#getColorStateList(int id).
|
| + */
|
| + @SuppressWarnings("deprecation")
|
| + public static ColorStateList getColorStateList(Resources res, int id) throws NotFoundException {
|
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
| + return res.getColorStateList(id, null);
|
| + } else {
|
| + return res.getColorStateList(id);
|
| + }
|
| + }
|
| }
|
|
|