package F7;

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

/* JADX INFO: renamed from: F7.a, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class ExecutorC0117a implements Executor {

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

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

    public ExecutorC0117a(int i) {
        this.f2693q = i;
        switch (i) {
            case 2:
                this.f2694r = new Handler(Looper.getMainLooper());
                break;
            default:
                this.f2694r = new Handler(Looper.getMainLooper());
                break;
        }
    }

    @Override // java.util.concurrent.Executor
    public final void execute(Runnable runnable) {
        switch (this.f2693q) {
            case u0.f15495q /* 0 */:
                this.f2694r.post(runnable);
                return;
            case 1:
                runnable.getClass();
                Handler handler = this.f2694r;
                if (handler.post(runnable)) {
                    return;
                }
                throw new RejectedExecutionException(handler + " is shutting down");
            default:
                this.f2694r.post(runnable);
                return;
        }
    }

    public ExecutorC0117a(Handler handler) {
        this.f2693q = 1;
        this.f2694r = handler;
    }
}
