package w8;

import com.google.android.gms.common.api.internal.v0;
import e.v;
import java.util.concurrent.Executor;

/* JADX INFO: loaded from: classes2.dex */
public final class q implements r, f, e, c {

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

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

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

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

    public q(v vVar, c cVar) {
        this.f34245a = 0;
        this.f34247c = new Object();
        this.f34246b = vVar;
        this.f34248d = cVar;
    }

    @Override // w8.c
    public final void a() {
        ((t) this.f34248d).l();
    }

    @Override // w8.r
    public final void b(h hVar) {
        switch (this.f34245a) {
            case 0:
                if (((t) hVar).f34253d) {
                    synchronized (this.f34247c) {
                        try {
                            if (((c) this.f34248d) != null) {
                                this.f34246b.execute(new p(this, 0));
                            }
                        } finally {
                        }
                    }
                    return;
                }
                return;
            case 1:
                synchronized (this.f34247c) {
                    try {
                        if (((d) this.f34248d) == null) {
                            return;
                        }
                        this.f34246b.execute(new v0(this, hVar, 4));
                        return;
                    } finally {
                    }
                }
            case 2:
                if (hVar.j() || ((t) hVar).f34253d) {
                    return;
                }
                synchronized (this.f34247c) {
                    try {
                        if (((e) this.f34248d) != null) {
                            this.f34246b.execute(new v0(this, hVar, 5));
                        }
                    } finally {
                    }
                }
                return;
            case 3:
                if (hVar.j()) {
                    synchronized (this.f34247c) {
                        try {
                            if (((f) this.f34248d) != null) {
                                this.f34246b.execute(new v0(this, hVar, 6));
                            }
                        } finally {
                        }
                    }
                    return;
                }
                return;
            default:
                this.f34246b.execute(new v0(this, hVar, 7));
                return;
        }
    }

    @Override // w8.e
    public final void onFailure(Exception exc) {
        ((t) this.f34248d).k(exc);
    }

    @Override // w8.f
    public final void onSuccess(Object obj) {
        ((t) this.f34248d).zzb(obj);
    }

    public q(Executor executor, d dVar) {
        this.f34245a = 1;
        this.f34247c = new Object();
        this.f34246b = executor;
        this.f34248d = dVar;
    }

    public q(Executor executor, e eVar) {
        this.f34245a = 2;
        this.f34247c = new Object();
        this.f34246b = executor;
        this.f34248d = eVar;
    }

    public q(Executor executor, f fVar) {
        this.f34245a = 3;
        this.f34247c = new Object();
        this.f34246b = executor;
        this.f34248d = fVar;
    }

    public q(Executor executor, g gVar, t tVar) {
        this.f34245a = 4;
        this.f34246b = executor;
        this.f34247c = gVar;
        this.f34248d = tVar;
    }
}
