package m0;

import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;

/* JADX INFO: loaded from: classes.dex */
public final class f implements Executor {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Handler f30284b;

    public f(Looper looper) {
        this.f30283a = 3;
        this.f30284b = new o8.e(looper, 2);
    }

    @Override // java.util.concurrent.Executor
    public final void execute(Runnable runnable) {
        int i10 = this.f30283a;
        Handler handler = this.f30284b;
        switch (i10) {
            case 0:
                if (handler.post((Runnable) p0.g.checkNotNull(runnable))) {
                    return;
                }
                throw new RejectedExecutionException(handler + " is shutting down");
            case 1:
                if (handler.post((Runnable) p0.g.checkNotNull(runnable))) {
                    return;
                }
                throw new RejectedExecutionException(handler + " is shutting down");
            case 2:
                handler.post(runnable);
                return;
            default:
                handler.post(runnable);
                return;
        }
    }

    public f(int i10, Handler handler) {
        this.f30283a = i10;
        if (i10 == 1) {
            this.f30284b = (Handler) p0.g.checkNotNull(handler);
        } else if (i10 != 2) {
            this.f30284b = (Handler) p0.g.checkNotNull(handler);
        } else {
            this.f30284b = handler;
        }
    }
}
