package ඓ.ῲ.K.ᕣ.ᨨ;

import ඓ.ῲ.K.ᕣ.AbstractC1029;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.ῲ.K.ᕣ.ᨨ.㗗  reason: contains not printable characters */
/* compiled from: EngineResource */
public class C1005<Z> implements AbstractC1027<Z> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final boolean f4400;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final AbstractC1006 f4401;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final boolean f4402;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f4403;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final AbstractC1029 f4404;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final AbstractC1027<Z> f4405;

    /* renamed from: 㿎  reason: contains not printable characters */
    public boolean f4406;

    /* renamed from: ඓ.ῲ.K.ᕣ.ᨨ.㗗$K  reason: contains not printable characters */
    /* compiled from: EngineResource */
    public interface AbstractC1006 {
    }

    public C1005(AbstractC1027<Z> r2, boolean z, boolean z2, AbstractC1029 r5, AbstractC1006 k) {
        C1841.m4783(r2, "Argument must not be null");
        this.f4405 = r2;
        this.f4402 = z;
        this.f4400 = z2;
        this.f4404 = r5;
        C1841.m4783(k, "Argument must not be null");
        this.f4401 = k;
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1027
    public Z get() {
        return this.f4405.get();
    }

    public synchronized String toString() {
        return "EngineResource{isMemoryCacheable=" + this.f4402 + ", listener=" + this.f4401 + ", key=" + this.f4404 + ", acquired=" + this.f4403 + ", isRecycled=" + this.f4406 + ", resource=" + this.f4405 + '}';
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1027
    /* renamed from: ʬ  reason: contains not printable characters */
    public synchronized void m2808() {
        if (this.f4403 > 0) {
            throw new IllegalStateException("Cannot recycle a resource while it is still acquired");
        } else if (!this.f4406) {
            this.f4406 = true;
            if (this.f4400) {
                this.f4405.m2841();
            }
        } else {
            throw new IllegalStateException("Cannot recycle a resource that has already been recycled");
        }
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public void m2809() {
        boolean z;
        synchronized (this) {
            if (this.f4403 > 0) {
                z = true;
                int i = this.f4403 - 1;
                this.f4403 = i;
                if (i != 0) {
                    z = false;
                }
            } else {
                throw new IllegalStateException("Cannot release a recycled or not yet acquired resource");
            }
        }
        if (z) {
            ((C1013) this.f4401).m2826(this.f4404, (C1005<?>) this);
        }
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1027
    /* renamed from: ῲ  reason: contains not printable characters */
    public Class<Z> m2810() {
        return this.f4405.m2842();
    }

    @Override // ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1027
    /* renamed from: K  reason: contains not printable characters */
    public int m2811() {
        return this.f4405.m2843();
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public synchronized void m2812() {
        if (!this.f4406) {
            this.f4403++;
        } else {
            throw new IllegalStateException("Cannot acquire a recycled resource");
        }
    }
}
