package w1; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.text.TextUtils; import com.bumptech.glide.load.data.d; import java.io.File; import java.io.FileNotFoundException; import w1.m; /* loaded from: classes.dex */ public final class k implements m { /* renamed from: a, reason: collision with root package name */ private final Context f15045a; public static final class a implements n { /* renamed from: a, reason: collision with root package name */ private final Context f15046a; public a(Context context) { this.f15046a = context; } @Override // w1.n public m b(q qVar) { return new k(this.f15046a); } } private static class b implements com.bumptech.glide.load.data.d { /* renamed from: c, reason: collision with root package name */ private static final String[] f15047c = {"_data"}; /* renamed from: a, reason: collision with root package name */ private final Context f15048a; /* renamed from: b, reason: collision with root package name */ private final Uri f15049b; b(Context context, Uri uri) { this.f15048a = context; this.f15049b = uri; } @Override // com.bumptech.glide.load.data.d public Class a() { return File.class; } @Override // com.bumptech.glide.load.data.d public void b() { } @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) { Cursor query = this.f15048a.getContentResolver().query(this.f15049b, f15047c, null, null, null); if (query != null) { try { r0 = query.moveToFirst() ? query.getString(query.getColumnIndexOrThrow("_data")) : null; } finally { query.close(); } } if (!TextUtils.isEmpty(r0)) { aVar.e(new File(r0)); return; } aVar.c(new FileNotFoundException("Failed to find file path for: " + this.f15049b)); } } public k(Context context) { this.f15045a = context; } @Override // w1.m /* renamed from: c, reason: merged with bridge method [inline-methods] */ public m.a b(Uri uri, int i10, int i11, q1.h hVar) { return new m.a(new l2.b(uri), new b(this.f15045a, uri)); } @Override // w1.m /* renamed from: d, reason: merged with bridge method [inline-methods] */ public boolean a(Uri uri) { return r1.b.b(uri); } }