package P1;

import java.util.concurrent.Executor;
import s2.RunnableC1013a;

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

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

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

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

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

    public m(F1.d dVar, b bVar) {
        this.f2513k = 0;
        this.f2514l = new Object();
        this.f2515m = dVar;
        this.f2516n = bVar;
    }

    private final void d(h hVar) {
        if (hVar.h()) {
            synchronized (this.f2514l) {
                try {
                    if (((e) this.f2516n) == null) {
                        return;
                    }
                    this.f2515m.execute(new RunnableC1013a(this, hVar, 24, false));
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
    }

    @Override // P1.n
    public final void a(h hVar) {
        switch (this.f2513k) {
            case 0:
                if (((o) hVar).f2520d) {
                    synchronized (this.f2514l) {
                        try {
                            if (((b) this.f2516n) != null) {
                                ((F1.d) this.f2515m).getClass();
                                synchronized (this.f2514l) {
                                    try {
                                        b bVar = (b) this.f2516n;
                                        if (bVar != null) {
                                            bVar.b();
                                        }
                                    } finally {
                                    }
                                    break;
                                }
                            }
                        } finally {
                        }
                    }
                    return;
                }
                return;
            case 1:
                synchronized (this.f2514l) {
                    break;
                }
                this.f2515m.execute(new RunnableC1013a(this, hVar, 22, false));
                return;
            case 2:
                if (hVar.h() || ((o) hVar).f2520d) {
                    return;
                }
                synchronized (this.f2514l) {
                    try {
                        if (((d) this.f2516n) != null) {
                            this.f2515m.execute(new RunnableC1013a(this, hVar, 23, false));
                        }
                    } finally {
                    }
                }
                return;
            case 3:
                d(hVar);
                return;
            default:
                this.f2515m.execute(new RunnableC1013a(this, hVar, 25, false));
                return;
        }
    }

    @Override // P1.b
    public void b() {
        ((o) this.f2516n).n();
    }

    @Override // P1.e
    public void c(Object obj) {
        ((o) this.f2516n).m(obj);
    }

    @Override // P1.d
    public void h(Exception exc) {
        ((o) this.f2516n).l(exc);
    }

    public m(Executor executor, c cVar) {
        this.f2513k = 1;
        this.f2514l = new Object();
        this.f2515m = executor;
        this.f2516n = cVar;
    }

    public m(Executor executor, d dVar) {
        this.f2513k = 2;
        this.f2514l = new Object();
        this.f2515m = executor;
        this.f2516n = dVar;
    }

    public m(Executor executor, e eVar) {
        this.f2513k = 3;
        this.f2514l = new Object();
        this.f2515m = executor;
        this.f2516n = eVar;
    }

    public m(Executor executor, g gVar, o oVar) {
        this.f2513k = 4;
        this.f2515m = executor;
        this.f2514l = gVar;
        this.f2516n = oVar;
    }
}
