package o;

import android.os.RemoteException;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Objects;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.xt0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class RunnableC2950xt0 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ C1531iw0 m;
    public final /* synthetic */ Vt0 n;

    public /* synthetic */ RunnableC2950xt0(Vt0 vt0, C1531iw0 c1531iw0, int i) {
        this.l = i;
        this.m = c1531iw0;
        this.n = vt0;
    }

    @Override // java.lang.Runnable
    public final void run() throws Throwable {
        switch (this.l) {
            case 0:
                Vt0 vt0 = this.n;
                InterfaceC2185pq0 interfaceC2185pq0 = vt0.d;
                Kr0 kr0 = (Kr0) vt0.a;
                if (interfaceC2185pq0 != null) {
                    try {
                        C1531iw0 c1531iw0 = this.m;
                        Preconditions.checkNotNull(c1531iw0);
                        interfaceC2185pq0.t(c1531iw0);
                    } catch (RemoteException e) {
                        Nq0 nq0 = kr0.f;
                        Kr0.l(nq0);
                        nq0.f.c(e, "Failed to reset data on the service: remote exception");
                    }
                    vt0.F();
                    break;
                } else {
                    Nq0 nq02 = kr0.f;
                    Kr0.l(nq02);
                    nq02.f.b("Failed to reset data on the service: not connected to service");
                    break;
                }
            case 1:
                Vt0 vt02 = this.n;
                InterfaceC2185pq0 interfaceC2185pq02 = vt02.d;
                Kr0 kr02 = (Kr0) vt02.a;
                if (interfaceC2185pq02 == null) {
                    Nq0 nq03 = kr02.f;
                    Kr0.l(nq03);
                    nq03.f.b("Discarding data. Failed to send app launch");
                    break;
                } else {
                    try {
                        C1531iw0 c1531iw02 = this.m;
                        Preconditions.checkNotNull(c1531iw02);
                        C1421ho0 c1421ho0 = kr02.d;
                        C1805lq0 c1805lq0 = AbstractC1900mq0.b1;
                        if (c1421ho0.C(null, c1805lq0)) {
                            vt02.K(interfaceC2185pq02, null, c1531iw02);
                        }
                        interfaceC2185pq02.w(c1531iw02);
                        kr02.n().x();
                        kr02.d.C(null, c1805lq0);
                        vt02.K(interfaceC2185pq02, null, c1531iw02);
                        vt02.F();
                        break;
                    } catch (RemoteException e2) {
                        Nq0 nq04 = kr02.f;
                        Kr0.l(nq04);
                        nq04.f.c(e2, "Failed to send app launch to the service");
                        return;
                    }
                }
            case 2:
                Vt0 vt03 = this.n;
                InterfaceC2185pq0 interfaceC2185pq03 = vt03.d;
                Kr0 kr03 = (Kr0) vt03.a;
                if (interfaceC2185pq03 == null) {
                    Nq0 nq05 = kr03.f;
                    Kr0.l(nq05);
                    nq05.i.b("Failed to send app backgrounded");
                    break;
                } else {
                    try {
                        C1531iw0 c1531iw03 = this.m;
                        Preconditions.checkNotNull(c1531iw03);
                        interfaceC2185pq03.u(c1531iw03);
                        vt03.F();
                        break;
                    } catch (RemoteException e3) {
                        Nq0 nq06 = kr03.f;
                        Kr0.l(nq06);
                        nq06.f.c(e3, "Failed to send app backgrounded to the service");
                        return;
                    }
                }
            case 3:
                Vt0 vt04 = this.n;
                InterfaceC2185pq0 interfaceC2185pq04 = vt04.d;
                Kr0 kr04 = (Kr0) vt04.a;
                if (interfaceC2185pq04 == null) {
                    Nq0 nq07 = kr04.f;
                    Kr0.l(nq07);
                    nq07.f.b("Failed to send measurementEnabled to service");
                    break;
                } else {
                    try {
                        C1531iw0 c1531iw04 = this.m;
                        Preconditions.checkNotNull(c1531iw04);
                        interfaceC2185pq04.g(c1531iw04);
                        vt04.F();
                        break;
                    } catch (RemoteException e4) {
                        Nq0 nq08 = kr04.f;
                        Kr0.l(nq08);
                        nq08.f.c(e4, "Failed to send measurementEnabled to the service");
                        return;
                    }
                }
            default:
                Vt0 vt05 = this.n;
                InterfaceC2185pq0 interfaceC2185pq05 = vt05.d;
                Kr0 kr05 = (Kr0) vt05.a;
                if (interfaceC2185pq05 == null) {
                    Nq0 nq09 = kr05.f;
                    Kr0.l(nq09);
                    nq09.f.b("Failed to send consent settings to service");
                    break;
                } else {
                    try {
                        C1531iw0 c1531iw05 = this.m;
                        Preconditions.checkNotNull(c1531iw05);
                        interfaceC2185pq05.h(c1531iw05);
                        vt05.F();
                        break;
                    } catch (RemoteException e5) {
                        Nq0 nq010 = kr05.f;
                        Kr0.l(nq010);
                        nq010.f.c(e5, "Failed to send consent settings to the service");
                    }
                }
        }
    }

    public RunnableC2950xt0(Vt0 vt0, C1531iw0 c1531iw0) {
        this.l = 4;
        this.m = c1531iw0;
        Objects.requireNonNull(vt0);
        this.n = vt0;
    }
}
