package 㴹.K.ᕣ.K;

import android.os.Handler;
import android.os.Message;
import io.reactivex.internal.disposables.EmptyDisposable;
import java.util.concurrent.TimeUnit;
import ඓ.ⁱ.K.ඓ.C1252;
import 㴹.K.AbstractC2508;
import 㴹.K.㑃.AbstractC2514;

/* renamed from: 㴹.K.ᕣ.K.ῲ  reason: contains not printable characters */
/* compiled from: HandlerScheduler */
public final class C2502 extends AbstractC2508 {

    /* renamed from: K  reason: contains not printable characters */
    public final Handler f8503;

    /* renamed from: 㴹.K.ᕣ.K.ῲ$ῲ  reason: contains not printable characters */
    /* compiled from: HandlerScheduler */
    public static final class RunnableC2503 implements Runnable, AbstractC2514 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final Runnable f8504;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final Handler f8505;

        /* renamed from: 㸾  reason: contains not printable characters */
        public volatile boolean f8506;

        public RunnableC2503(Handler handler, Runnable runnable) {
            this.f8505 = handler;
            this.f8504 = runnable;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public void dispose() {
            this.f8506 = true;
            this.f8505.removeCallbacks(this);
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public boolean isDisposed() {
            return this.f8506;
        }

        public void run() {
            try {
                this.f8504.run();
            } catch (Throwable th) {
                IllegalStateException illegalStateException = new IllegalStateException("Fatal Exception thrown on Scheduler.", th);
                C1252.m3349(illegalStateException);
                Thread currentThread = Thread.currentThread();
                currentThread.getUncaughtExceptionHandler().uncaughtException(currentThread, illegalStateException);
            }
        }
    }

    /* renamed from: 㴹.K.ᕣ.K.ῲ$K  reason: contains not printable characters */
    /* compiled from: HandlerScheduler */
    public static final class C2504 extends AbstractC2508.AbstractC2509 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public volatile boolean f8507;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final Handler f8508;

        public C2504(Handler handler) {
            this.f8508 = handler;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public void dispose() {
            this.f8507 = true;
            this.f8508.removeCallbacksAndMessages(this);
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public boolean isDisposed() {
            return this.f8507;
        }

        @Override // 㴹.K.AbstractC2508.AbstractC2509
        /* renamed from: K  reason: contains not printable characters */
        public AbstractC2514 m6548(Runnable runnable, long j, TimeUnit timeUnit) {
            if (runnable == null) {
                throw new NullPointerException("run == null");
            } else if (timeUnit == null) {
                throw new NullPointerException("unit == null");
            } else if (this.f8507) {
                return EmptyDisposable.INSTANCE;
            } else {
                RunnableC2503 r0 = new RunnableC2503(this.f8508, C1252.m3339(runnable));
                Message obtain = Message.obtain(this.f8508, r0);
                obtain.obj = this;
                this.f8508.sendMessageDelayed(obtain, Math.max(0L, timeUnit.toMillis(j)));
                if (!this.f8507) {
                    return r0;
                }
                this.f8508.removeCallbacks(r0);
                return EmptyDisposable.INSTANCE;
            }
        }
    }

    public C2502(Handler handler) {
        this.f8503 = handler;
    }

    @Override // 㴹.K.AbstractC2508
    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2514 m6547(Runnable runnable, long j, TimeUnit timeUnit) {
        if (runnable == null) {
            throw new NullPointerException("run == null");
        } else if (timeUnit != null) {
            RunnableC2503 r0 = new RunnableC2503(this.f8503, C1252.m3339(runnable));
            this.f8503.postDelayed(r0, Math.max(0L, timeUnit.toMillis(j)));
            return r0;
        } else {
            throw new NullPointerException("unit == null");
        }
    }

    @Override // 㴹.K.AbstractC2508
    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2508.AbstractC2509 m6546() {
        return new C2504(this.f8503);
    }
}
