package com.google.android.gms.measurement.internal;

import android.os.RemoteException;

/* JADX INFO: loaded from: classes2.dex */
public final class d3 implements Runnable {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ d4 f21527b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ a3 f21528c;

    public /* synthetic */ d3(a3 a3Var, d4 d4Var, int i10) {
        this.f21526a = i10;
        this.f21527b = d4Var;
        this.f21528c = a3Var;
    }

    @Override // java.lang.Runnable
    public final void run() throws Throwable {
        int i10 = this.f21526a;
        a3 a3Var = this.f21528c;
        d4 d4Var = this.f21527b;
        switch (i10) {
            case 0:
                h0 h0Var = a3Var.f21472d;
                if (h0Var != null) {
                    try {
                        com.google.android.gms.common.internal.w.checkNotNull(d4Var);
                        h0Var.i0(d4Var);
                    } catch (RemoteException e10) {
                        a3Var.zzj().f21834f.b(e10, "Failed to reset data on the service: remote exception");
                    }
                    a3Var.R();
                } else {
                    a3Var.zzj().f21834f.c("Failed to reset data on the service: not connected to service");
                }
                break;
            case 1:
                h0 h0Var2 = a3Var.f21472d;
                if (h0Var2 == null) {
                    a3Var.zzj().f21834f.c("Discarding data. Failed to send app launch");
                } else {
                    try {
                        com.google.android.gms.common.internal.w.checkNotNull(d4Var);
                        h0Var2.R(d4Var);
                        a3Var.y().J();
                        a3Var.H(h0Var2, null, d4Var);
                        a3Var.R();
                    } catch (RemoteException e11) {
                        a3Var.zzj().f21834f.b(e11, "Failed to send app launch to the service");
                        return;
                    }
                }
                break;
            case 2:
                h0 h0Var3 = a3Var.f21472d;
                if (h0Var3 == null) {
                    a3Var.zzj().f21837i.c("Failed to send app backgrounded");
                } else {
                    try {
                        com.google.android.gms.common.internal.w.checkNotNull(d4Var);
                        h0Var3.c1(d4Var);
                        a3Var.R();
                    } catch (RemoteException e12) {
                        a3Var.zzj().f21834f.b(e12, "Failed to send app backgrounded to the service");
                        return;
                    }
                }
                break;
            case 3:
                h0 h0Var4 = a3Var.f21472d;
                if (h0Var4 == null) {
                    a3Var.zzj().f21834f.c("Failed to send measurementEnabled to service");
                } else {
                    try {
                        com.google.android.gms.common.internal.w.checkNotNull(d4Var);
                        h0Var4.H2(d4Var);
                        a3Var.R();
                    } catch (RemoteException e13) {
                        a3Var.zzj().f21834f.b(e13, "Failed to send measurementEnabled to the service");
                        return;
                    }
                }
                break;
            default:
                h0 h0Var5 = a3Var.f21472d;
                if (h0Var5 == null) {
                    a3Var.zzj().f21834f.c("Failed to send consent settings to service");
                } else {
                    try {
                        com.google.android.gms.common.internal.w.checkNotNull(d4Var);
                        h0Var5.l0(d4Var);
                        a3Var.R();
                    } catch (RemoteException e14) {
                        a3Var.zzj().f21834f.b(e14, "Failed to send consent settings to the service");
                    }
                }
                break;
        }
    }
}
