package defpackage;

import com.google.android.gms.tasks.RuntimeExecutionException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;

/* renamed from: ᵫʘᵯ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3921 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public Object f14805;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public Exception f14806;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public boolean f14807;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final Object f14808 = new Object();

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4118 f14809 = new C4118(10);

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public volatile boolean f14810;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C3921 m8703(Executor executor, InterfaceC3610 interfaceC3610) {
        C3921 c3921 = new C3921();
        this.f14809.m9030(new C4304(executor, interfaceC3610, c3921, 1));
        m8704();
        return c3921;
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final void m8704() {
        synchronized (this.f14808) {
            try {
                if (this.f14807) {
                    this.f14809.m9029(this);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final boolean m8705(Object obj) {
        synchronized (this.f14808) {
            try {
                if (this.f14807) {
                    return false;
                }
                this.f14807 = true;
                this.f14805 = obj;
                this.f14809.m9029(this);
                return true;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final Object m8706() {
        Object obj;
        synchronized (this.f14808) {
            try {
                ᵩʛʽ.ˌᵜᵹᵩ("Task is not yet complete", this.f14807);
                if (this.f14810) {
                    throw new CancellationException("Task is already canceled.");
                }
                Exception exc = this.f14806;
                if (exc != null) {
                    throw new RuntimeExecutionException(exc);
                }
                obj = this.f14805;
            } catch (Throwable th) {
                throw th;
            }
        }
        return obj;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final Exception m8707() {
        Exception exc;
        synchronized (this.f14808) {
            exc = this.f14806;
        }
        return exc;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m8708(Executor executor, InterfaceC2070 interfaceC2070) {
        this.f14809.m9030(new C2786(executor, interfaceC2070));
        m8704();
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final boolean m8709() {
        boolean z;
        synchronized (this.f14808) {
            try {
                z = false;
                if (this.f14807 && !this.f14810 && this.f14806 == null) {
                    z = true;
                }
            } finally {
            }
        }
        return z;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m8710(Executor executor, InterfaceC2605 interfaceC2605) {
        this.f14809.m9030(new C2786(executor, interfaceC2605));
        m8704();
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void m8711() {
        synchronized (this.f14808) {
            try {
                if (this.f14807) {
                    return;
                }
                this.f14807 = true;
                this.f14810 = true;
                this.f14809.m9029(this);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void m8712(Exception exc) {
        ᵩʛʽ.ᵶᵷᵕ(exc, "Exception must not be null");
        synchronized (this.f14808) {
            m8713();
            this.f14807 = true;
            this.f14806 = exc;
        }
        this.f14809.m9029(this);
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final void m8713() {
        if (this.f14807) {
            if (!m8717()) {
                throw new IllegalStateException("DuplicateTaskCompletionException can only be created from completed Task.");
            }
            Exception excM8707 = m8707();
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m8714(Executor executor, InterfaceC3964 interfaceC3964) {
        this.f14809.m9030(new C2786(executor, interfaceC3964));
        m8704();
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final C3921 m8715(Executor executor, InterfaceC4612 interfaceC4612) {
        C3921 c3921 = new C3921();
        this.f14809.m9030(new C2786(executor, interfaceC4612, c3921));
        m8704();
        return c3921;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final void m8716(Object obj) {
        synchronized (this.f14808) {
            m8713();
            this.f14807 = true;
            this.f14805 = obj;
        }
        this.f14809.m9029(this);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final boolean m8717() {
        boolean z;
        synchronized (this.f14808) {
            z = this.f14807;
        }
        return z;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C3921 m8718(Executor executor, InterfaceC3610 interfaceC3610) {
        C3921 c3921 = new C3921();
        this.f14809.m9030(new C4304(executor, interfaceC3610, c3921, 0));
        m8704();
        return c3921;
    }
}
