Skip to content
Snippets Groups Projects
Commit de2d5f71 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "BigPictureStyle: log when Icon.loadDrawable returns empty BitmapDrawable" into main

parents 89a40f08 8d018fce
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import android.annotation.Nullable;
import android.annotation.StyleRes;
import android.app.ActivityManager;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.net.Uri;
......@@ -119,6 +120,17 @@ public class BigPictureNotificationImageView extends ImageView implements
return () -> setImageDrawable(drawable);
}
@Override
public void setImageDrawable(@Nullable Drawable drawable) {
if (drawable instanceof BitmapDrawable bitmapDrawable) {
if (bitmapDrawable.getBitmap() == null) {
Log.e(TAG, "setting BitmapDrawable with null Bitmap (invalid image file?)");
}
}
super.setImageDrawable(drawable);
}
private Drawable loadImage(Uri uri) {
if (uri == null) return null;
return LocalImageResolver.resolveImage(uri, mContext, mMaximumDrawableWidth,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment