package p138.p145.p146.p149.p150;

import android.util.Log;
import com.bumptech.glide.load.HttpException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import p000.p001.p002.p003.p004.C0567;
import p138.p145.p146.EnumC2812;
import p138.p145.p146.p151.EnumC2840;
import p138.p145.p146.p151.p152.InterfaceC2856;
import p138.p145.p146.p151.p158.C3015;
import p138.p145.p146.p174.C3231;
import p402.p411.p413.C6635;
import p447.AbstractC6936;
import p447.C6926;
import p447.C6933;
import p447.InterfaceC6868;
import p447.InterfaceC6870;

/* JADX INFO: renamed from: ދ.ؠ.֏.ދ.֏.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2837 implements InterfaceC2856<InputStream>, InterfaceC6870 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final InterfaceC6868.InterfaceC6869 f8787;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final C3015 f8788;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public InputStream f8789;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public AbstractC6936 f8790;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public InterfaceC2856.InterfaceC2857<? super InputStream> f8791;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public volatile InterfaceC6868 f8792;

    public C2837(InterfaceC6868.InterfaceC6869 interfaceC6869, C3015 c3015) {
        this.f8787 = interfaceC6869;
        this.f8788 = c3015;
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856
    public void cancel() {
        InterfaceC6868 interfaceC6868 = this.f8792;
        if (interfaceC6868 != null) {
            interfaceC6868.cancel();
        }
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public Class<InputStream> mo4969() {
        return InputStream.class;
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo4970(EnumC2812 enumC2812, InterfaceC2856.InterfaceC2857<? super InputStream> interfaceC2857) {
        C6926.C6927 c6927 = new C6926.C6927();
        c6927.m10124(this.f8788.m5141());
        for (Map.Entry<String, String> entry : this.f8788.f9175.mo5142().entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            if (key == null) {
                C6635.m9824("name");
                throw null;
            }
            if (value == null) {
                C6635.m9824("value");
                throw null;
            }
            c6927.f20135.m10072(key, value);
        }
        C6926 c6926M10123 = c6927.m10123();
        this.f8791 = interfaceC2857;
        this.f8792 = this.f8787.mo10028(c6926M10123);
        this.f8792.mo10024(this);
    }

    @Override // p447.InterfaceC6870
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo4971(InterfaceC6868 interfaceC6868, IOException iOException) {
        if (Log.isLoggable("OkHttpFetcher", 3)) {
            Log.d("OkHttpFetcher", "OkHttp failed to obtain result", iOException);
        }
        this.f8791.mo4989((Exception) iOException);
    }

    @Override // p447.InterfaceC6870
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo4972(InterfaceC6868 interfaceC6868, C6933 c6933) {
        this.f8790 = c6933.f20152;
        if (!c6933.m10127()) {
            this.f8791.mo4989((Exception) new HttpException(c6933.f20148, c6933.f20149));
            return;
        }
        AbstractC6936 abstractC6936 = this.f8790;
        C0567.m1858(abstractC6936, "Argument must not be null");
        C3231 c3231 = new C3231(this.f8790.mo10137().mo10441(), abstractC6936.mo10135());
        this.f8789 = c3231;
        this.f8791.mo4990(c3231);
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void mo4973() {
        try {
            if (this.f8789 != null) {
                this.f8789.close();
            }
        } catch (IOException unused) {
        }
        AbstractC6936 abstractC6936 = this.f8790;
        if (abstractC6936 != null) {
            abstractC6936.close();
        }
        this.f8791 = null;
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856
    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public EnumC2840 mo4974() {
        return EnumC2840.REMOTE;
    }
}
