package defpackage;

import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import java.io.InputStream;
import java.util.ArrayDeque;

/* renamed from: ᵩᵖʾ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3810 implements InterfaceC4541 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final Object f14199;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final /* synthetic */ int f14200;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final Object f14201;

    public C3810(Resources resources, InterfaceC4541 interfaceC4541) {
        this.f14200 = 0;
        this.f14199 = resources;
        this.f14201 = interfaceC4541;
    }

    public /* synthetic */ C3810(Object obj, int i, Object obj2) {
        this.f14200 = i;
        this.f14201 = obj;
        this.f14199 = obj2;
    }

    @Override // defpackage.InterfaceC4541
    /* renamed from: ᵥᵯˎ */
    public final boolean mo1620(Object obj, C0210 c0210) {
        switch (this.f14200) {
            case 0:
                return ((InterfaceC4541) this.f14201).mo1620(obj, c0210);
            case 1:
                return "android.resource".equals(((Uri) obj).getScheme());
            default:
                return true;
        }
    }

    @Override // defpackage.InterfaceC4541
    /* renamed from: ᵴᵳ */
    public final InterfaceC1725 mo1621(Object obj, int i, int i2, C0210 c0210) throws PackageManager.NameNotFoundException, NumberFormatException {
        boolean z;
        C0276 c0276;
        C0608 c0608;
        switch (this.f14200) {
            case 0:
                InterfaceC1725 interfaceC1725Mo1621 = ((InterfaceC4541) this.f14201).mo1621(obj, i, i2, c0210);
                Resources resources = (Resources) this.f14199;
                if (interfaceC1725Mo1621 == null) {
                    return null;
                }
                return new C2017(resources, interfaceC1725Mo1621);
            case 1:
                InterfaceC1725 interfaceC1725M8451 = ((C3807) this.f14201).m8451((Uri) obj, c0210);
                if (interfaceC1725M8451 == null) {
                    return null;
                }
                return AbstractC2787.m6880((InterfaceC2157) this.f14199, (Drawable) ((C3564) interfaceC1725M8451).get(), i, i2);
            default:
                InputStream inputStream = (InputStream) obj;
                if (inputStream instanceof C0276) {
                    c0276 = (C0276) inputStream;
                    z = false;
                } else {
                    z = true;
                    c0276 = new C0276(inputStream, (C4805) this.f14199);
                }
                ArrayDeque arrayDeque = C0608.f3070;
                synchronized (arrayDeque) {
                    c0608 = (C0608) arrayDeque.poll();
                }
                if (c0608 == null) {
                    c0608 = new C0608();
                }
                C0608 c06082 = c0608;
                c06082.f3072 = c0276;
                C0583 c0583 = new C0583(c06082);
                InterfaceC0907 interfaceC0907 = new ᵶˉᵹʣ(c0276, 25, c06082);
                try {
                    C4539 c4539 = (C4539) this.f14201;
                    C2017 c2017M9652 = c4539.m9652(new ᵧˉʙ(c0583, c4539.f16888, c4539.f16885), i, i2, c0210, interfaceC0907);
                    c06082.m2498();
                    if (z) {
                        c0276.m1614();
                    }
                    return c2017M9652;
                } finally {
                }
        }
    }
}
