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 committed Apr 27, 2024
1 parent acced70 commit 5d02b0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
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
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 5d02b0c

Please sign in to comment.