package o;

import android.os.Bundle;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import org.json.JSONException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Hs0 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ AtomicReference m;
    public final /* synthetic */ Xs0 n;

    public /* synthetic */ Hs0(Xs0 xs0, AtomicReference atomicReference, int i, boolean z) {
        this.l = i;
        this.n = xs0;
        this.m = atomicReference;
    }

    private final void a() {
        AtomicReference atomicReference = this.m;
        synchronized (atomicReference) {
            try {
                try {
                    Kr0 kr0 = (Kr0) this.n.a;
                    atomicReference.set(Double.valueOf(kr0.d.B(kr0.q().y(), AbstractC1900mq0.e0)));
                } finally {
                    this.m.notify();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // java.lang.Runnable
    public final void run() throws JSONException {
        switch (this.l) {
            case 0:
                AtomicReference atomicReference = this.m;
                synchronized (atomicReference) {
                    try {
                        try {
                            Kr0 kr0 = (Kr0) this.n.a;
                            atomicReference.set(Boolean.valueOf(kr0.d.C(kr0.q().y(), AbstractC1900mq0.a0)));
                        } finally {
                        }
                    } finally {
                    }
                }
                return;
            case 1:
                AtomicReference atomicReference2 = this.m;
                synchronized (atomicReference2) {
                    try {
                        try {
                            Kr0 kr02 = (Kr0) this.n.a;
                            atomicReference2.set(kr02.d.y(kr02.q().y(), AbstractC1900mq0.b0));
                        } finally {
                        }
                    } finally {
                    }
                }
                return;
            case 2:
                AtomicReference atomicReference3 = this.m;
                synchronized (atomicReference3) {
                    try {
                        try {
                            Kr0 kr03 = (Kr0) this.n.a;
                            atomicReference3.set(Long.valueOf(kr03.d.z(kr03.q().y(), AbstractC1900mq0.c0)));
                        } finally {
                        }
                    } finally {
                    }
                }
                return;
            case 3:
                AtomicReference atomicReference4 = this.m;
                synchronized (atomicReference4) {
                    try {
                        try {
                            Kr0 kr04 = (Kr0) this.n.a;
                            atomicReference4.set(Integer.valueOf(kr04.d.A(kr04.q().y(), AbstractC1900mq0.d0)));
                        } finally {
                        }
                    } finally {
                    }
                }
                return;
            case 4:
                a();
                return;
            case 5:
                Xs0 xs0 = this.n;
                C1617jr0 c1617jr0 = ((Kr0) xs0.a).e;
                Kr0.j(c1617jr0);
                Bundle bundleP = c1617jr0.n.p();
                Vt0 vt0O = ((Kr0) xs0.a).o();
                AtomicReference atomicReference5 = this.m;
                vt0O.r();
                vt0O.t();
                vt0O.G(new RunnableC0266Kg(vt0O, atomicReference5, vt0O.I(false), bundleP, 8, false));
                return;
            default:
                Vt0 vt0O2 = ((Kr0) this.n.a).o();
                Du0 du0B = Du0.b(EnumC1335gt0.p);
                AtomicReference atomicReference6 = this.m;
                vt0O2.r();
                vt0O2.t();
                vt0O2.G(new RunnableC0266Kg(vt0O2, atomicReference6, vt0O2.I(false), du0B, 9, false));
                return;
        }
    }

    public Hs0(Xs0 xs0, AtomicReference atomicReference, int i) {
        this.l = i;
        switch (i) {
            case 1:
                this.m = atomicReference;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
            case 2:
                this.m = atomicReference;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
            case 3:
                this.m = atomicReference;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
            case 4:
                this.m = atomicReference;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
            default:
                this.m = atomicReference;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
        }
    }
}
