| 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);
|
| + }
|
| + }
|
| }
|
|
|