Skip to content

Commit

Permalink
Revert "Ensure backwards compat"
Browse files Browse the repository at this point in the history
This reverts commit 4f97f1d.
  • Loading branch information
benjaminRomano committed Apr 24, 2024
1 parent 4f97f1d commit 57882c2
Showing 1 changed file with 6 additions and 20 deletions.
Expand Up @@ -4,7 +4,6 @@
import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -48,25 +47,12 @@ public LoadData<Data> buildLoadData(
@Nullable
private Uri getResourceUri(Integer model) {
try {
// Avoid referencing resource names on SDK 19+ to allow resource table optimizations
// to strip out resource names.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return Uri.parse(
ContentResolver.SCHEME_ANDROID_RESOURCE
+ "://"
+ resources.getResourcePackageName(model)
+ '/'
+ model);
} else {
return Uri.parse(
ContentResolver.SCHEME_ANDROID_RESOURCE
+ "://"
+ resources.getResourcePackageName(model)
+ '/'
+ resources.getResourceTypeName(model)
+ '/'
+ resources.getResourceEntryName(model));
}
return Uri.parse(
ContentResolver.SCHEME_ANDROID_RESOURCE
+ "://"
+ resources.getResourcePackageName(model)
+ '/'
+ model);
} catch (Resources.NotFoundException e) {
if (Log.isLoggable(TAG, Log.WARN)) {
Log.w(TAG, "Received invalid resource id: " + model, e);
Expand Down

0 comments on commit 57882c2

Please sign in to comment.