package com.bumptech.glide.load.data;

import android.content.ContentResolver;
import android.content.res.AssetManager;
import android.net.Uri;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.DataSource;
import java.io.Closeable;
import java.io.FileNotFoundException;
import java.io.IOException;

/* JADX INFO: loaded from: classes.dex */
public abstract class b implements e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f5607a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f5608b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Comparable f5609c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Object f5610d;

    public /* synthetic */ b(Object obj, Comparable comparable, int i10) {
        this.f5607a = i10;
        this.f5610d = obj;
        this.f5609c = comparable;
    }

    @Override // com.bumptech.glide.load.data.e
    public final void b() {
        switch (this.f5607a) {
            case 0:
                Object obj = this.f5608b;
                if (obj != null) {
                    try {
                        c(obj);
                    } catch (IOException unused) {
                        return;
                    }
                    break;
                }
                break;
            default:
                Object obj2 = this.f5608b;
                if (obj2 != null) {
                    try {
                        c(obj2);
                    } catch (IOException unused2) {
                        return;
                    }
                }
                break;
        }
    }

    public abstract void c(Object obj);

    @Override // com.bumptech.glide.load.data.e
    public final void cancel() {
    }

    @Override // com.bumptech.glide.load.data.e
    public final DataSource d() {
        return DataSource.f5589a;
    }

    @Override // com.bumptech.glide.load.data.e
    public final void e(Priority priority, d dVar) {
        int i10 = this.f5607a;
        Object obj = this.f5610d;
        Comparable comparable = this.f5609c;
        switch (i10) {
            case 0:
                try {
                    Closeable closeableF = f((AssetManager) obj, (String) comparable);
                    this.f5608b = closeableF;
                    dVar.onDataReady(closeableF);
                } catch (IOException e10) {
                    dVar.c(e10);
                }
                break;
            default:
                try {
                    Object objG = g((ContentResolver) obj, (Uri) comparable);
                    this.f5608b = objG;
                    dVar.onDataReady(objG);
                } catch (FileNotFoundException e11) {
                    dVar.c(e11);
                    return;
                }
                break;
        }
    }

    public abstract Closeable f(AssetManager assetManager, String str);

    public abstract Object g(ContentResolver contentResolver, Uri uri);
}
