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

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

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « base/BUILD.gn ('k') | base/android/java/src/org/chromium/base/CommandLine.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 4198853e168917eb931e62098fa36db220e99268..71b79b1b7f09a8fe6366352de6b427b05ed726b5 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -14,6 +14,8 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.content.res.Resources.NotFoundException;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
@@ -480,4 +482,25 @@ public class ApiCompatibilityUtils {
window.setStatusBarColor(statusBarColor);
}
}
+
+ /**
+ * @see android.content.res.Resources#getDrawable(int id).
+ */
+ @SuppressWarnings("deprecation")
+ public static Drawable getDrawable(Resources res, int id) throws NotFoundException {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return res.getDrawable(id, null);
+ } else {
+ return res.getDrawable(id);
+ }
+ }
+
+ /**
+ * @see android.view.View#announceForAccessibility(CharSequence text)
+ */
+ public static void announceForAccessibility(View view, CharSequence text) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ view.announceForAccessibility(text);
+ }
+ }
}
« no previous file with comments | « base/BUILD.gn ('k') | base/android/java/src/org/chromium/base/CommandLine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698