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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user