package o; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.view.Choreographer; import o.C13395fZS; /* loaded from: classes.dex */ public final class gfX { private static volatile Choreographer choreographer; public static final Handler aDc_(Looper looper) { if (Build.VERSION.SDK_INT >= 28) { 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"); } 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); } } static { Object a; try { C13395fZS.IeS ieS = C13395fZS.b; a = C13395fZS.a(new gfY(aDc_(Looper.getMainLooper()))); } catch (Throwable th) { C13395fZS.IeS ieS2 = C13395fZS.b; C14957gcv.e(th, ""); a = C13395fZS.a(new C13395fZS.LWm(th)); } if (C13395fZS.e(a)) { a = null; } } }