- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
44 lines
1.7 KiB
Java
44 lines
1.7 KiB
Java
package kotlinx.coroutines.android;
|
|
|
|
import android.os.Build;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.view.Choreographer;
|
|
import kotlin.Result;
|
|
import kotlin.ResultKt;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class HandlerDispatcherKt {
|
|
public static final HandlerDispatcher Main;
|
|
private static volatile Choreographer choreographer;
|
|
|
|
public static final Handler asHandler(Looper looper, boolean z) {
|
|
if (!z) {
|
|
return new Handler(looper);
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
Object invoke = Handler.class.getDeclaredMethod("createAsync", Looper.class).invoke(null, looper);
|
|
Intrinsics.checkNotNull(invoke, "null cannot be cast to non-null type android.os.Handler");
|
|
return (Handler) invoke;
|
|
}
|
|
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 m4060constructorimpl;
|
|
try {
|
|
Result.Companion companion = Result.Companion;
|
|
m4060constructorimpl = Result.m4060constructorimpl(new HandlerContext(asHandler(Looper.getMainLooper(), true), null, 2, null));
|
|
} catch (Throwable th) {
|
|
Result.Companion companion2 = Result.Companion;
|
|
m4060constructorimpl = Result.m4060constructorimpl(ResultKt.createFailure(th));
|
|
}
|
|
Main = (HandlerDispatcher) (Result.m4064isFailureimpl(m4060constructorimpl) ? null : m4060constructorimpl);
|
|
}
|
|
}
|