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

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

Issue 1328743003: Update getColorStateList calls that were deprecated in M. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ddf18a321bf42e31cc90f5f71cb3c13dd21be36..a119acb79f1167be4bc43d1ef8e446a509403c9d 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/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;
@@ -441,4 +442,16 @@ public class ApiCompatibilityUtils {
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);
+ }
+ }
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698