Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 633b198a authored by Dan Sandler's avatar Dan Sandler
Browse files

Throw IOE from within resolveImage rather than NPE.

The failure will get handled gracefully by the caller (in
this case, loadImage()).

Fixes: 159780182
Test: atest frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInlineImageResolverTest.java
Change-Id: I7af94d4a85d3e3fddd435ebb1f6e16042529c31c
parent 3c34454a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -124,6 +124,9 @@ public class NotificationInlineImageResolver implements ImageResolver {
     */
    Drawable resolveImage(Uri uri) throws IOException {
        BitmapDrawable image = resolveImageInternal(uri);
        if (image == null || image.getBitmap() == null) {
            throw new IOException("resolveImageInternal returned null for uri: " + uri);
        }
        Bitmap bitmap = image.getBitmap();
        image.setBitmap(Icon.scaleDownIfNecessary(bitmap, mMaxImageWidth, mMaxImageHeight));
        return image;