package p063u1;

import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.CancellationException;
import p012d1.InterfaceC0633f;
import p039m1.C1468e;
import p039m1.C1470g;
import p060t1.C1680h0;
import p060t1.C1731y0;

/* renamed from: u1.a */
/* loaded from: classes.dex */
public final class C1747a extends AbstractC1748b {
    private volatile C1747a _immediate;

    /* renamed from: e */
    public final Handler f4422e;

    /* renamed from: f */
    public final String f4423f;

    /* renamed from: g */
    public final boolean f4424g;

    /* renamed from: h */
    public final C1747a f4425h;

    public C1747a(Handler handler, String str) {
        this(handler, str, false);
    }

    public /* synthetic */ C1747a(Handler handler, String str, int i, C1468e c1468e) {
        this(handler, (i & 2) != 0 ? null : str);
    }

    public C1747a(Handler handler, String str, boolean z) {
        super(null);
        this.f4422e = handler;
        this.f4423f = str;
        this.f4424g = z;
        this._immediate = z ? this : null;
        C1747a c1747a = this._immediate;
        if (c1747a == null) {
            c1747a = new C1747a(handler, str, true);
            this._immediate = c1747a;
        }
        this.f4425h = c1747a;
    }

    @Override // p060t1.AbstractC1717u
    /* renamed from: d */
    public void mo478d(InterfaceC0633f interfaceC0633f, Runnable runnable) {
        if (this.f4422e.post(runnable)) {
            return;
        }
        m475p(interfaceC0633f, runnable);
    }

    public boolean equals(Object obj) {
        return (obj instanceof C1747a) && ((C1747a) obj).f4422e == this.f4422e;
    }

    @Override // p060t1.AbstractC1717u
    /* renamed from: f */
    public boolean mo477f(InterfaceC0633f interfaceC0633f) {
        return (this.f4424g && C1470g.m1296a(Looper.myLooper(), this.f4422e.getLooper())) ? false : true;
    }

    public int hashCode() {
        return System.identityHashCode(this.f4422e);
    }

    /* renamed from: p */
    public final void m475p(InterfaceC0633f interfaceC0633f, Runnable runnable) {
        C1731y0.m497a(interfaceC0633f, new CancellationException("The task was rejected, the handler underlying the dispatcher '" + this + "' was closed"));
        C1680h0.m601a().mo478d(interfaceC0633f, runnable);
    }

    @Override // p060t1.AbstractC1669d1
    /* renamed from: q */
    public C1747a mo476n() {
        return this.f4425h;
    }

    @Override // p060t1.AbstractC1669d1, p060t1.AbstractC1717u
    public String toString() {
        String m612o = m612o();
        if (m612o == null) {
            String str = this.f4423f;
            if (str == null) {
                str = this.f4422e.toString();
            }
            return this.f4424g ? C1470g.m1287j(str, ".immediate") : str;
        }
        return m612o;
    }
}