diff options
| author | 2012-08-03 14:04:30 -0700 | |
|---|---|---|
| committer | 2012-08-03 14:04:30 -0700 | |
| commit | f1c0aeda259dd0dbab4356c909d33fe7e1ca0d2a (patch) | |
| tree | 78beeb1132a0c5a0897912781731d0d5be1470b5 /graphics/java | |
| parent | 5345c310af8363948cee6a91d11add3ec51e8a9c (diff) | |
Fix issue #6921726: Prime: Cannot make or receive phone calls...
[NPE at android.graphics.drawable.Drawable.createFromResourceStream]
Change-Id: I223428ffb39e883518aad817227f32851ea18aec
Diffstat (limited to 'graphics/java')
| -rw-r--r-- | graphics/java/android/graphics/drawable/Drawable.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index 540acfa6a2e0..4bc5a5a6a38c 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -778,7 +778,8 @@ public abstract class Drawable { // to the compatibility density only to have them scaled back up when // drawn to the screen. if (opts == null) opts = new BitmapFactory.Options(); - opts.inScreenDensity = res.getDisplayMetrics().noncompatDensityDpi; + opts.inScreenDensity = res != null + ? res.getDisplayMetrics().noncompatDensityDpi : DisplayMetrics.DENSITY_DEVICE; Bitmap bm = BitmapFactory.decodeResourceStream(res, value, is, pad, opts); if (bm != null) { byte[] np = bm.getNinePatchChunk(); |