Skip to content

Commit 440f387

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue #6921726: Prime: Cannot make or receive phone calls..." into jb-mr1-dev
2 parents 7c927b1 + f1c0aed commit 440f387

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphics/java/android/graphics/drawable/Drawable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,8 @@ public static Drawable createFromResourceStream(Resources res, TypedValue value,
778778
// to the compatibility density only to have them scaled back up when
779779
// drawn to the screen.
780780
if (opts == null) opts = new BitmapFactory.Options();
781-
opts.inScreenDensity = res.getDisplayMetrics().noncompatDensityDpi;
781+
opts.inScreenDensity = res != null
782+
? res.getDisplayMetrics().noncompatDensityDpi : DisplayMetrics.DENSITY_DEVICE;
782783
Bitmap bm = BitmapFactory.decodeResourceStream(res, value, is, pad, opts);
783784
if (bm != null) {
784785
byte[] np = bm.getNinePatchChunk();

0 commit comments

Comments
 (0)