Commit 847524c6 authored by aurimas's avatar aurimas Committed by Commit bot

Remove ICS check in BookmarkUtil.

This CL also add OWNERS file for ApiCompatibilityUtils

BUG=473837

Review URL: https://codereview.chromium.org/1082303004

Cr-Commit-Position: refs/heads/master@{#327163}
parent da8b6300
......@@ -375,4 +375,16 @@ public class ApiCompatibilityUtils {
return res.getDrawable(id);
}
}
/**
* @see android.content.res.Resources#getDrawableForDensity(int id, int density).
*/
@SuppressWarnings("deprecation")
public static Drawable getDrawableForDensity(Resources res, int id, int density) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return res.getDrawableForDensity(id, density, null);
} else {
return res.getDrawableForDensity(id, density);
}
}
}
per-file ApiCompatibilityUtils.java=aurimas@chromium.org
per-file ApiCompatibilityUtils.java=newt@chromium.org
......@@ -4,7 +4,6 @@
package org.chromium.chrome.browser;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
......@@ -22,7 +21,6 @@ import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
......@@ -153,14 +151,9 @@ public class BookmarkUtils {
return bitmap;
}
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
private static Bitmap getBitmapFromResourceId(Context context, int id, int density) {
Drawable drawable = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
drawable = context.getResources().getDrawableForDensity(id, density);
} else {
drawable = ApiCompatibilityUtils.getDrawable(context.getResources(), id);
}
Drawable drawable = ApiCompatibilityUtils.getDrawableForDensity(
context.getResources(), id, density);
if (drawable instanceof BitmapDrawable) {
BitmapDrawable bd = (BitmapDrawable) drawable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment