package w1; import android.os.ParcelFileDescriptor; import android.util.Log; import com.bumptech.glide.load.data.d; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import w1.m; /* loaded from: classes.dex */ public class f implements m { /* renamed from: a, reason: collision with root package name */ private final d f15023a; public static class a implements n { /* renamed from: a, reason: collision with root package name */ private final d f15024a; public a(d dVar) { this.f15024a = dVar; } @Override // w1.n public final m b(q qVar) { return new f(this.f15024a); } } public static class b extends a { class a implements d { a() { } @Override // w1.f.d public Class a() { return ParcelFileDescriptor.class; } @Override // w1.f.d /* renamed from: d, reason: merged with bridge method [inline-methods] */ public void b(ParcelFileDescriptor parcelFileDescriptor) { parcelFileDescriptor.close(); } @Override // w1.f.d /* renamed from: e, reason: merged with bridge method [inline-methods] */ public ParcelFileDescriptor c(File file) { return ParcelFileDescriptor.open(file, 268435456); } } public b() { super(new a()); } } private static final class c implements com.bumptech.glide.load.data.d { /* renamed from: a, reason: collision with root package name */ private final File f15025a; /* renamed from: b, reason: collision with root package name */ private final d f15026b; /* renamed from: c, reason: collision with root package name */ private Object f15027c; c(File file, d dVar) { this.f15025a = file; this.f15026b = dVar; } @Override // com.bumptech.glide.load.data.d public Class a() { return this.f15026b.a(); } @Override // com.bumptech.glide.load.data.d public void b() { Object obj = this.f15027c; if (obj != null) { try { this.f15026b.b(obj); } catch (IOException unused) { } } } @Override // com.bumptech.glide.load.data.d public void cancel() { } @Override // com.bumptech.glide.load.data.d public q1.a d() { return q1.a.LOCAL; } @Override // com.bumptech.glide.load.data.d public void f(com.bumptech.glide.g gVar, d.a aVar) { try { Object c10 = this.f15026b.c(this.f15025a); this.f15027c = c10; aVar.e(c10); } catch (FileNotFoundException e10) { if (Log.isLoggable("FileLoader", 3)) { Log.d("FileLoader", "Failed to open file", e10); } aVar.c(e10); } } } public interface d { Class a(); void b(Object obj); Object c(File file); } public static class e extends a { class a implements d { a() { } @Override // w1.f.d public Class a() { return InputStream.class; } @Override // w1.f.d /* renamed from: d, reason: merged with bridge method [inline-methods] */ public void b(InputStream inputStream) { inputStream.close(); } @Override // w1.f.d /* renamed from: e, reason: merged with bridge method [inline-methods] */ public InputStream c(File file) { return new FileInputStream(file); } } public e() { super(new a()); } } public f(d dVar) { this.f15023a = dVar; } @Override // w1.m /* renamed from: c, reason: merged with bridge method [inline-methods] */ public m.a b(File file, int i10, int i11, q1.h hVar) { return new m.a(new l2.b(file), new c(file, this.f15023a)); } @Override // w1.m /* renamed from: d, reason: merged with bridge method [inline-methods] */ public boolean a(File file) { return true; } }