summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-08-03 14:04:30 -0700
committerDianne Hackborn <hackbod@google.com>2012-08-03 14:04:30 -0700
commitf1c0aeda259dd0dbab4356c909d33fe7e1ca0d2a (patch)
tree78beeb1132a0c5a0897912781731d0d5be1470b5 /graphics
parent5345c310af8363948cee6a91d11add3ec51e8a9c (diff)
downloadframeworks_base-f1c0aeda259dd0dbab4356c909d33fe7e1ca0d2a.zip
frameworks_base-f1c0aeda259dd0dbab4356c909d33fe7e1ca0d2a.tar.gz
frameworks_base-f1c0aeda259dd0dbab4356c909d33fe7e1ca0d2a.tar.bz2
Fix issue #6921726: Prime: Cannot make or receive phone calls...
[NPE at android.graphics.drawable.Drawable.createFromResourceStream] Change-Id: I223428ffb39e883518aad817227f32851ea18aec
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/Drawable.java3
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 540acfa..4bc5a5a 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();