Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: android/java/src/org/chromium/base/ApiCompatibilityUtils.java

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698