Skip to content
Snippets Groups Projects
Commit f4760e96 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "LocalImageResolver: log when Icon.loadDrawable fails" into main

parents 53667488 eb90e97e
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,11 @@ public class LocalImageResolver {
// Fallback to straight drawable load if we fail with more efficient approach.
try {
return icon.loadDrawable(context);
final Drawable iconDrawable = icon.loadDrawable(context);
if (iconDrawable == null) {
Log.w(TAG, "Couldn't load drawable for icon: " + icon);
}
return iconDrawable;
} catch (Resources.NotFoundException e) {
return null;
}
......@@ -233,8 +237,7 @@ public class LocalImageResolver {
});
// ImageDecoder documentation is misleading a bit - it'll throw NotFoundException
// in some cases despite it not saying so. Rethrow it as an IOException to keep
// our API contract.
// in some cases despite it not saying so.
} catch (IOException | Resources.NotFoundException e) {
Log.d(TAG, "Couldn't use ImageDecoder for drawable, falling back to non-resized load.");
return null;
......
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