Skip to content

Commit

Permalink
Avoid referencing resource names within Resource Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminRomano authored and falhassen committed Apr 29, 2024
1 parent acced70 commit a7351b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ private Uri getResourceUri(Integer model) {
+ "://"
+ resources.getResourcePackageName(model)
+ '/'
+ resources.getResourceTypeName(model)
+ '/'
+ resources.getResourceEntryName(model));
+ model);
} catch (Resources.NotFoundException e) {
if (Log.isLoggable(TAG, Log.WARN)) {
Log.w(TAG, "Received invalid resource id: " + model, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void setUp() {
@Test
public void testCanHandleId() {
int id = android.R.drawable.star_off;
Uri contentUri = Uri.parse("android.resource://android/drawable/star_off");
Uri contentUri = Uri.parse("android.resource://android/" + String.valueOf(id));
when(uriLoader.buildLoadData(eq(contentUri), anyInt(), anyInt(), any(Options.class)))
.thenReturn(new ModelLoader.LoadData<>(key, fetcher));

Expand Down

0 comments on commit a7351b0

Please sign in to comment.