package defpackage;

import java.util.concurrent.ExecutorService;

/* JADX INFO: loaded from: classes2.dex */
public final /* synthetic */ class c42 implements Runnable {
    public final /* synthetic */ int a;
    public final /* synthetic */ e42 b;
    public final /* synthetic */ Runnable c;
    public final /* synthetic */ f42 d;

    public /* synthetic */ c42(e42 e42Var, Runnable runnable, f42 f42Var, int i) {
        this.a = i;
        this.b = e42Var;
        this.c = runnable;
        this.d = f42Var;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.a) {
            case 0:
                ExecutorService executorService = this.b.a;
                final int i = 0;
                final Runnable runnable = this.c;
                final f42 f42Var = this.d;
                executorService.execute(new Runnable() { // from class: a42
                    @Override // java.lang.Runnable
                    public final void run() throws Exception {
                        switch (i) {
                            case 0:
                                try {
                                    runnable.run();
                                    return;
                                } catch (Exception e) {
                                    f42Var.b(e);
                                    throw e;
                                }
                            case 1:
                                try {
                                    runnable.run();
                                    return;
                                } catch (Exception e2) {
                                    f42Var.b(e2);
                                    return;
                                }
                            default:
                                Runnable runnable2 = runnable;
                                f42 f42Var2 = f42Var;
                                try {
                                    runnable2.run();
                                    f42Var2.a(null);
                                    return;
                                } catch (Exception e3) {
                                    f42Var2.b(e3);
                                    return;
                                }
                        }
                    }
                });
                break;
            case 1:
                ExecutorService executorService2 = this.b.a;
                final int i2 = 2;
                final Runnable runnable2 = this.c;
                final f42 f42Var2 = this.d;
                executorService2.execute(new Runnable() { // from class: a42
                    @Override // java.lang.Runnable
                    public final void run() throws Exception {
                        switch (i2) {
                            case 0:
                                try {
                                    runnable2.run();
                                    return;
                                } catch (Exception e) {
                                    f42Var2.b(e);
                                    throw e;
                                }
                            case 1:
                                try {
                                    runnable2.run();
                                    return;
                                } catch (Exception e2) {
                                    f42Var2.b(e2);
                                    return;
                                }
                            default:
                                Runnable runnable22 = runnable2;
                                f42 f42Var22 = f42Var2;
                                try {
                                    runnable22.run();
                                    f42Var22.a(null);
                                    return;
                                } catch (Exception e3) {
                                    f42Var22.b(e3);
                                    return;
                                }
                        }
                    }
                });
                break;
            default:
                ExecutorService executorService3 = this.b.a;
                final int i3 = 1;
                final Runnable runnable3 = this.c;
                final f42 f42Var3 = this.d;
                executorService3.execute(new Runnable() { // from class: a42
                    @Override // java.lang.Runnable
                    public final void run() throws Exception {
                        switch (i3) {
                            case 0:
                                try {
                                    runnable3.run();
                                    return;
                                } catch (Exception e) {
                                    f42Var3.b(e);
                                    throw e;
                                }
                            case 1:
                                try {
                                    runnable3.run();
                                    return;
                                } catch (Exception e2) {
                                    f42Var3.b(e2);
                                    return;
                                }
                            default:
                                Runnable runnable22 = runnable3;
                                f42 f42Var22 = f42Var3;
                                try {
                                    runnable22.run();
                                    f42Var22.a(null);
                                    return;
                                } catch (Exception e3) {
                                    f42Var22.b(e3);
                                    return;
                                }
                        }
                    }
                });
                break;
        }
    }
}
