package l9; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.view.Choreographer; import s8.n; import s8.o; /* loaded from: classes2.dex */ public abstract class d { /* renamed from: a, reason: collision with root package name */ public static final c f11747a; private static volatile Choreographer choreographer; static { Object b10; try { n.a aVar = n.f14096b; b10 = n.b(new b(a(Looper.getMainLooper(), true), null, 2, null)); } catch (Throwable th) { n.a aVar2 = n.f14096b; b10 = n.b(o.a(th)); } f11747a = (c) (n.f(b10) ? null : b10); } public static final Handler a(Looper looper, boolean z10) { if (!z10) { return new Handler(looper); } 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"); } }