package p063u1;

import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.Choreographer;
import p006b1.C0476f;
import p006b1.C0479g;

/* renamed from: u1.c */
/* loaded from: classes.dex */
public final class C1749c {

    /* renamed from: a */
    public static final AbstractC1748b f4426a;
    private static volatile Choreographer choreographer;

    static {
        Object m3626a;
        try {
            C0476f.C0477a c0477a = C0476f.f1684d;
            m3626a = C0476f.m3626a(new C1747a(m473a(Looper.getMainLooper(), true), null, 2, null));
        } catch (Throwable th) {
            C0476f.C0477a c0477a2 = C0476f.f1684d;
            m3626a = C0476f.m3626a(C0479g.m3622a(th));
        }
        f4426a = C0476f.m3624c(m3626a) ? null : m3626a;
    }

    /* renamed from: a */
    public static final Handler m473a(Looper looper, boolean z) {
        if (z) {
            if (Build.VERSION.SDK_INT < 28) {
                try {
                    return (Handler) Handler.class.getDeclaredConstructor(Looper.class, Handler.Callback.class, Boolean.TYPE).newInstance(looper, null, Boolean.TRUE);
                } catch (NoSuchMethodException unused) {
                    return new Handler(looper);
                }
            }
            Object invoke = Handler.class.getDeclaredMethod("createAsync", Looper.class).invoke(null, looper);
            if (invoke != null) {
                return (Handler) invoke;
            }
            throw new NullPointerException("null cannot be cast to non-null type android.os.Handler");
        }
        return new Handler(looper);
    }
}