Loading src/com/android/contacts/util/ImageViewDrawableSetter.java +10 −3 Original line number Diff line number Diff line Loading @@ -108,9 +108,10 @@ public class ImageViewDrawableSetter { return previousBitmap(); } final Drawable newDrawable = (compressed == null) ? defaultDrawable(c,account) : decodedBitmapDrawable(compressed); Drawable newDrawable = decodedBitmapDrawable(compressed); if (newDrawable == null) { newDrawable = defaultDrawable(c,account); } // Remember this for next time, so that we can check if it changed. mCompressed = compressed; Loading Loading @@ -171,8 +172,14 @@ public class ImageViewDrawableSetter { } private BitmapDrawable decodedBitmapDrawable(byte[] compressed) { if (compressed == null) { return null; } final Resources rsrc = mTarget.getResources(); Bitmap bitmap = BitmapFactory.decodeByteArray(compressed, 0, compressed.length); if (bitmap == null) { return null; } if (bitmap.getHeight() != bitmap.getWidth()) { // Crop the bitmap into a square. final int size = Math.min(bitmap.getWidth(), bitmap.getHeight()); Loading Loading
src/com/android/contacts/util/ImageViewDrawableSetter.java +10 −3 Original line number Diff line number Diff line Loading @@ -108,9 +108,10 @@ public class ImageViewDrawableSetter { return previousBitmap(); } final Drawable newDrawable = (compressed == null) ? defaultDrawable(c,account) : decodedBitmapDrawable(compressed); Drawable newDrawable = decodedBitmapDrawable(compressed); if (newDrawable == null) { newDrawable = defaultDrawable(c,account); } // Remember this for next time, so that we can check if it changed. mCompressed = compressed; Loading Loading @@ -171,8 +172,14 @@ public class ImageViewDrawableSetter { } private BitmapDrawable decodedBitmapDrawable(byte[] compressed) { if (compressed == null) { return null; } final Resources rsrc = mTarget.getResources(); Bitmap bitmap = BitmapFactory.decodeByteArray(compressed, 0, compressed.length); if (bitmap == null) { return null; } if (bitmap.getHeight() != bitmap.getWidth()) { // Crop the bitmap into a square. final int size = Math.min(bitmap.getWidth(), bitmap.getHeight()); Loading