package o;

import android.text.TextUtils;
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 Cs0 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ long m;
    public final /* synthetic */ Xs0 n;

    public Cs0(Xs0 xs0, long j, int i) {
        this.l = i;
        switch (i) {
            case 1:
                this.m = j;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
            default:
                this.m = j;
                Objects.requireNonNull(xs0);
                this.n = xs0;
                break;
        }
    }

    @Override // java.lang.Runnable
    public final void run() throws JSONException {
        switch (this.l) {
            case 0:
                Kr0 kr0 = (Kr0) this.n.a;
                C1617jr0 c1617jr0 = kr0.e;
                Kr0.j(c1617jr0);
                C1235fr0 c1235fr0 = c1617jr0.k;
                long j = this.m;
                c1235fr0.b(j);
                Nq0 nq0 = kr0.f;
                Kr0.l(nq0);
                nq0.m.c(Long.valueOf(j), "Session timeout duration set");
                break;
            default:
                Xs0 xs0 = this.n;
                xs0.r();
                xs0.t();
                Kr0 kr02 = (Kr0) xs0.a;
                Nq0 nq02 = kr02.f;
                Kr0.l(nq02);
                nq02.m.b("Resetting analytics data (FE)");
                C2382ru0 c2382ru0 = kr02.h;
                Kr0.k(c2382ru0);
                c2382ru0.r();
                C2098ou0 c2098ou0 = c2382ru0.f;
                c2098ou0.c.c();
                long jElapsedRealtime = ((Kr0) c2098ou0.d.a).k.elapsedRealtime();
                c2098ou0.a = jElapsedRealtime;
                c2098ou0.b = jElapsedRealtime;
                kr02.q().x();
                boolean z = !kr02.a();
                C1617jr0 c1617jr02 = kr02.e;
                Kr0.j(c1617jr02);
                c1617jr02.f.b(this.m);
                Kr0 kr03 = (Kr0) c1617jr02.a;
                C1617jr0 c1617jr03 = kr03.e;
                Kr0.j(c1617jr03);
                if (!TextUtils.isEmpty(c1617jr03.v.g())) {
                    c1617jr02.v.h(null);
                }
                c1617jr02.p.b(0L);
                c1617jr02.q.b(0L);
                if (!kr03.d.F()) {
                    c1617jr02.B(z);
                }
                c1617jr02.w.h(null);
                c1617jr02.x.b(0L);
                c1617jr02.y.s(null);
                Vt0 vt0O = kr02.o();
                vt0O.r();
                vt0O.t();
                C1531iw0 c1531iw0I = vt0O.I(false);
                vt0O.E();
                ((Kr0) vt0O.a).n().w();
                vt0O.G(new RunnableC2950xt0(vt0O, c1531iw0I, 0));
                Kr0.k(c2382ru0);
                c2382ru0.e.n();
                xs0.s = z;
                kr02.o().w(new AtomicReference());
                break;
        }
    }
}
