package p138.p176.p177.p242.p270;

import com.google.android.gms.tasks.RuntimeExecutionException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;
import javax.annotation.concurrent.GuardedBy;
import p000.p001.p002.p003.p004.C0567;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.އ.ޚ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C5085<TResult> extends AbstractC5062<TResult> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final Object f15256 = new Object();

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C5083<TResult> f15257 = new C5083<>();

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    @GuardedBy("mLock")
    public boolean f15258;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public volatile boolean f15259;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    @GuardedBy("mLock")
    public TResult f15260;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    @GuardedBy("mLock")
    public Exception f15261;

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final Exception mo8543() {
        Exception exc;
        synchronized (this.f15256) {
            exc = this.f15261;
        }
        return exc;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final <X extends Throwable> TResult mo8544(Class<X> cls) {
        TResult tresult;
        synchronized (this.f15256) {
            C0567.m1921(this.f15258, "Task is not yet complete");
            if (this.f15259) {
                throw new CancellationException("Task is already canceled.");
            }
            if (cls.isInstance(this.f15261)) {
                throw cls.cast(this.f15261);
            }
            if (this.f15261 != null) {
                throw new RuntimeExecutionException(this.f15261);
            }
            tresult = this.f15260;
        }
        return tresult;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final <TContinuationResult> AbstractC5062<TContinuationResult> mo8545(Executor executor, InterfaceC5056<TResult, TContinuationResult> interfaceC5056) {
        C5085 c5085 = new C5085();
        this.f15257.m8560(new C5068(executor, interfaceC5056, c5085));
        m8566();
        return c5085;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final AbstractC5062<TResult> mo8546(Executor executor, InterfaceC5057 interfaceC5057) {
        this.f15257.m8560(new C5072(executor, interfaceC5057));
        m8566();
        return this;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final AbstractC5062<TResult> mo8547(Executor executor, InterfaceC5058<TResult> interfaceC5058) {
        this.f15257.m8560(new C5074(executor, interfaceC5058));
        m8566();
        return this;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final AbstractC5062<TResult> mo8548(Executor executor, InterfaceC5059 interfaceC5059) {
        this.f15257.m8560(new C5076(executor, interfaceC5059));
        m8566();
        return this;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final AbstractC5062<TResult> mo8549(Executor executor, InterfaceC5060<? super TResult> interfaceC5060) {
        this.f15257.m8560(new C5078(executor, interfaceC5060));
        m8566();
        return this;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final <TContinuationResult> AbstractC5062<TContinuationResult> mo8550(Executor executor, InterfaceC5061<TResult, TContinuationResult> interfaceC5061) {
        C5085 c5085 = new C5085();
        this.f15257.m8560(new C5080(executor, interfaceC5061, c5085));
        m8566();
        return c5085;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ֏ */
    public final <TContinuationResult> AbstractC5062<TContinuationResult> mo8551(InterfaceC5056<TResult, TContinuationResult> interfaceC5056) {
        return mo8545(C5064.f15215, interfaceC5056);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8561(Exception exc) {
        C0567.m1857(exc, (Object) "Exception must not be null");
        synchronized (this.f15256) {
            C0567.m1921(!this.f15258, "Task is already complete");
            this.f15258 = true;
            this.f15261 = exc;
        }
        this.f15257.m8559(this);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m8562(TResult tresult) {
        synchronized (this.f15256) {
            C0567.m1921(!this.f15258, "Task is already complete");
            this.f15258 = true;
            this.f15260 = tresult;
        }
        this.f15257.m8559(this);
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ؠ */
    public final TResult mo8552() {
        TResult tresult;
        synchronized (this.f15256) {
            C0567.m1921(this.f15258, "Task is not yet complete");
            if (this.f15259) {
                throw new CancellationException("Task is already canceled.");
            }
            if (this.f15261 != null) {
                throw new RuntimeExecutionException(this.f15261);
            }
            tresult = this.f15260;
        }
        return tresult;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ؠ */
    public final <TContinuationResult> AbstractC5062<TContinuationResult> mo8553(Executor executor, InterfaceC5056<TResult, AbstractC5062<TContinuationResult>> interfaceC5056) {
        C5085 c5085 = new C5085();
        this.f15257.m8560(new C5070(executor, interfaceC5056, c5085));
        m8566();
        return c5085;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final boolean m8563(Exception exc) {
        C0567.m1857(exc, (Object) "Exception must not be null");
        synchronized (this.f15256) {
            if (this.f15258) {
                return false;
            }
            this.f15258 = true;
            this.f15261 = exc;
            this.f15257.m8559(this);
            return true;
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final boolean m8564(TResult tresult) {
        synchronized (this.f15256) {
            if (this.f15258) {
                return false;
            }
            this.f15258 = true;
            this.f15260 = tresult;
            this.f15257.m8559(this);
            return true;
        }
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ހ */
    public final boolean mo8554() {
        boolean z;
        synchronized (this.f15256) {
            z = this.f15258;
        }
        return z;
    }

    @Override // p138.p176.p177.p242.p270.AbstractC5062
    /* JADX INFO: renamed from: ށ */
    public final boolean mo8555() {
        boolean z;
        synchronized (this.f15256) {
            z = this.f15258 && !this.f15259 && this.f15261 == null;
        }
        return z;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final boolean m8565() {
        synchronized (this.f15256) {
            if (this.f15258) {
                return false;
            }
            this.f15258 = true;
            this.f15259 = true;
            this.f15257.m8559(this);
            return true;
        }
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final void m8566() {
        synchronized (this.f15256) {
            if (this.f15258) {
                this.f15257.m8559(this);
            }
        }
    }
}
