package up;

import android.os.Handler;
import android.os.Looper;
import android.view.Choreographer;
import kotlin.jvm.internal.t;
import rm.x;
import rm.y;

/* loaded from: classes3.dex */
public abstract class e {

    /* renamed from: a, reason: collision with root package name */
    public static final d f37369a;
    private static volatile Choreographer choreographer;

    /* JADX WARN: Multi-variable type inference failed */
    static {
        Object a10;
        Object[] objArr = 0;
        Object[] objArr2 = 0;
        try {
            x.a aVar = x.f34910p;
            a10 = x.a(new c(a(Looper.getMainLooper(), true), objArr2 == true ? 1 : 0, 2, objArr == true ? 1 : 0));
        } catch (Throwable th2) {
            x.a aVar2 = x.f34910p;
            a10 = x.a(y.a(th2));
        }
        f37369a = (d) (x.d(a10) ? null : a10);
    }

    public static final Handler a(Looper looper, boolean z10) {
        if (!z10) {
            return new Handler(looper);
        }
        Object invoke = Handler.class.getDeclaredMethod("createAsync", Looper.class).invoke(null, looper);
        t.e(invoke, "null cannot be cast to non-null type android.os.Handler");
        return (Handler) invoke;
    }

    public static final d b(Handler handler, String str) {
        return new c(handler, str);
    }
}
