Index: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java |
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java |
index c2d596e381171221391cd2491fc42715dd773ac0..3ddf18a321bf42e31cc90f5f71cb3c13dd21be36 100644 |
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java |
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java |
@@ -429,4 +429,16 @@ 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); |
+ } |
+ } |
} |