package g3;

import java.util.concurrent.Executor;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class m implements n, e, d, InterfaceC0984b {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f12939q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final Executor f12940r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final Object f12941s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final Object f12942t;

    public m(Executor executor, InterfaceC0984b interfaceC0984b) {
        this.f12939q = 0;
        this.f12941s = new Object();
        this.f12940r = executor;
        this.f12942t = interfaceC0984b;
    }

    private final void c(o oVar) {
        synchronized (this.f12941s) {
        }
        this.f12940r.execute(new G3.b(this, oVar, 26, false));
    }

    private final void e(o oVar) {
        if (oVar.i() || oVar.f12946d) {
            return;
        }
        synchronized (this.f12941s) {
            try {
                if (((d) this.f12942t) == null) {
                    return;
                }
                this.f12940r.execute(new G3.b(this, oVar, 27, false));
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private final void f(o oVar) {
        if (oVar.i()) {
            synchronized (this.f12941s) {
                try {
                    if (((e) this.f12942t) == null) {
                        return;
                    }
                    this.f12940r.execute(new G3.b(this, oVar, 28, false));
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
    }

    @Override // g3.n
    public final void a(o oVar) {
        switch (this.f12939q) {
            case u0.f15495q /* 0 */:
                if (oVar.f12946d) {
                    synchronized (this.f12941s) {
                        try {
                            if (((InterfaceC0984b) this.f12942t) != null) {
                                this.f12940r.execute(new M4.k(21, this));
                            }
                        } finally {
                        }
                    }
                    return;
                }
                return;
            case 1:
                c(oVar);
                return;
            case 2:
                e(oVar);
                return;
            case 3:
                f(oVar);
                return;
            default:
                this.f12940r.execute(new G3.b(this, oVar, 29, false));
                return;
        }
    }

    @Override // g3.InterfaceC0984b
    public void b() {
        ((o) this.f12942t).m();
    }

    @Override // g3.e
    public void d(Object obj) {
        ((o) this.f12942t).l(obj);
    }

    @Override // g3.d
    public void l(Exception exc) {
        ((o) this.f12942t).k(exc);
    }

    public m(Executor executor, InterfaceC0985c interfaceC0985c) {
        this.f12939q = 1;
        this.f12941s = new Object();
        this.f12940r = executor;
        this.f12942t = interfaceC0985c;
    }

    public m(Executor executor, d dVar) {
        this.f12939q = 2;
        this.f12941s = new Object();
        this.f12940r = executor;
        this.f12942t = dVar;
    }

    public m(Executor executor, e eVar) {
        this.f12939q = 3;
        this.f12941s = new Object();
        this.f12940r = executor;
        this.f12942t = eVar;
    }

    public m(Executor executor, g gVar, o oVar) {
        this.f12939q = 4;
        this.f12940r = executor;
        this.f12941s = gVar;
        this.f12942t = oVar;
    }
}
