Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import android.os.Looper;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
import kotlinx.coroutines.internal.LockFreeTaskQueueCore;
|
||||
import kotlinx.coroutines.internal.MainDispatcherFactory;
|
||||
|
||||
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0007\u001a\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u00010\nH\u0016J\b\u0010\u000b\u001a\u00020\fH\u0016R\u0014\u0010\u0003\u001a\u00020\u00048VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\r"}, d2 = {"Lkotlinx/coroutines/android/AndroidDispatcherFactory;", "Lkotlinx/coroutines/internal/MainDispatcherFactory;", "()V", "loadPriority", "", "getLoadPriority", "()I", "createDispatcher", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "allFactories", "", "hintOnError", "", "kotlinx-coroutines-android"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class AndroidDispatcherFactory implements MainDispatcherFactory {
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public MainCoroutineDispatcher createDispatcher(List<? extends MainDispatcherFactory> allFactories) {
|
||||
Looper mainLooper = Looper.getMainLooper();
|
||||
if (mainLooper != null) {
|
||||
return new HandlerContext(HandlerDispatcherKt.asHandler(mainLooper, true), null, 2, null);
|
||||
}
|
||||
throw new IllegalStateException("The main looper is not available");
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public int getLoadPriority() {
|
||||
return LockFreeTaskQueueCore.MAX_CAPACITY_MASK;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.internal.MainDispatcherFactory
|
||||
public String hintOnError() {
|
||||
return "For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.AbstractCoroutineContextElement;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler;
|
||||
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\u0005¢\u0006\u0002\u0010\u0003J\u0018\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH\u0016J\n\u0010\f\u001a\u0004\u0018\u00010\rH\u0002R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lkotlinx/coroutines/android/AndroidExceptionPreHandler;", "Lkotlin/coroutines/AbstractCoroutineContextElement;", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "()V", "_preHandler", "", "handleException", "", "context", "Lkotlin/coroutines/CoroutineContext;", "exception", "", "preHandler", "Ljava/lang/reflect/Method;", "kotlinx-coroutines-android"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public final class AndroidExceptionPreHandler extends AbstractCoroutineContextElement implements CoroutineExceptionHandler {
|
||||
private volatile Object _preHandler;
|
||||
|
||||
public AndroidExceptionPreHandler() {
|
||||
super(CoroutineExceptionHandler.INSTANCE);
|
||||
this._preHandler = this;
|
||||
}
|
||||
|
||||
private final Method preHandler() {
|
||||
Object obj = this._preHandler;
|
||||
if (obj != this) {
|
||||
return (Method) obj;
|
||||
}
|
||||
Method method = null;
|
||||
try {
|
||||
Method declaredMethod = Thread.class.getDeclaredMethod("getUncaughtExceptionPreHandler", new Class[0]);
|
||||
if (Modifier.isPublic(declaredMethod.getModifiers())) {
|
||||
if (Modifier.isStatic(declaredMethod.getModifiers())) {
|
||||
method = declaredMethod;
|
||||
}
|
||||
}
|
||||
} catch (Throwable unused) {
|
||||
}
|
||||
this._preHandler = method;
|
||||
return method;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineExceptionHandler
|
||||
public void handleException(CoroutineContext context, Throwable exception) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import C.w;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlin.ranges.RangesKt;
|
||||
import kotlin.time.DurationKt;
|
||||
import kotlinx.coroutines.CancellableContinuation;
|
||||
import kotlinx.coroutines.Delay;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
import kotlinx.coroutines.JobKt;
|
||||
import kotlinx.coroutines.NonDisposableHandle;
|
||||
|
||||
@Metadata(d1 = {"\u0000^\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\u001b\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007B!\b\u0002\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006\u0012\u0006\u0010\b\u001a\u00020\t¢\u0006\u0002\u0010\nJ\u001c\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\n\u0010\u0012\u001a\u00060\u0013j\u0002`\u0014H\u0002J\u001c\u0010\u0015\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\n\u0010\u0012\u001a\u00060\u0013j\u0002`\u0014H\u0016J\u0013\u0010\u0016\u001a\u00020\t2\b\u0010\u0017\u001a\u0004\u0018\u00010\u0018H\u0096\u0002J\b\u0010\u0019\u001a\u00020\u001aH\u0016J$\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001e2\n\u0010\u0012\u001a\u00060\u0013j\u0002`\u00142\u0006\u0010\u0010\u001a\u00020\u0011H\u0016J\u0010\u0010\u001f\u001a\u00020\t2\u0006\u0010\u0010\u001a\u00020\u0011H\u0016J\u001e\u0010 \u001a\u00020\u000f2\u0006\u0010\u001d\u001a\u00020\u001e2\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u000f0\"H\u0016J\b\u0010#\u001a\u00020\u0006H\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u000b\u001a\u00020\u0000X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u000e\u0010\b\u001a\u00020\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006$"}, d2 = {"Lkotlinx/coroutines/android/HandlerContext;", "Lkotlinx/coroutines/android/HandlerDispatcher;", "Lkotlinx/coroutines/Delay;", "handler", "Landroid/os/Handler;", AppMeasurementSdk.ConditionalUserProperty.NAME, "", "(Landroid/os/Handler;Ljava/lang/String;)V", "invokeImmediately", "", "(Landroid/os/Handler;Ljava/lang/String;Z)V", "immediate", "getImmediate", "()Lkotlinx/coroutines/android/HandlerContext;", "cancelOnRejection", "", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "dispatch", "equals", "other", "", "hashCode", "", "invokeOnTimeout", "Lkotlinx/coroutines/DisposableHandle;", "timeMillis", "", "isDispatchNeeded", "scheduleResumeAfterDelay", "continuation", "Lkotlinx/coroutines/CancellableContinuation;", "toString", "kotlinx-coroutines-android"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nHandlerDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 HandlerDispatcher.kt\nkotlinx/coroutines/android/HandlerContext\n+ 2 Runnable.kt\nkotlinx/coroutines/RunnableKt\n*L\n1#1,216:1\n17#2:217\n*S KotlinDebug\n*F\n+ 1 HandlerDispatcher.kt\nkotlinx/coroutines/android/HandlerContext\n*L\n144#1:217\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HandlerContext extends HandlerDispatcher implements Delay {
|
||||
private final Handler handler;
|
||||
private final HandlerContext immediate;
|
||||
private final boolean invokeImmediately;
|
||||
private final String name;
|
||||
|
||||
private HandlerContext(Handler handler, String str, boolean z3) {
|
||||
super(null);
|
||||
this.handler = handler;
|
||||
this.name = str;
|
||||
this.invokeImmediately = z3;
|
||||
this.immediate = z3 ? this : new HandlerContext(handler, str, true);
|
||||
}
|
||||
|
||||
private final void cancelOnRejection(CoroutineContext context, Runnable block) {
|
||||
JobKt.cancel(context, new CancellationException("The task was rejected, the handler underlying the dispatcher '" + this + "' was closed"));
|
||||
Dispatchers.getIO().mo1685dispatch(context, block);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void invokeOnTimeout$lambda$2(HandlerContext handlerContext, Runnable runnable) {
|
||||
handlerContext.handler.removeCallbacks(runnable);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
/* renamed from: dispatch */
|
||||
public void mo1685dispatch(CoroutineContext context, Runnable block) {
|
||||
if (this.handler.post(block)) {
|
||||
return;
|
||||
}
|
||||
cancelOnRejection(context, block);
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof HandlerContext)) {
|
||||
return false;
|
||||
}
|
||||
HandlerContext handlerContext = (HandlerContext) other;
|
||||
return handlerContext.handler == this.handler && handlerContext.invokeImmediately == this.invokeImmediately;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (this.invokeImmediately ? 1231 : 1237) ^ System.identityHashCode(this.handler);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.android.HandlerDispatcher, kotlinx.coroutines.Delay
|
||||
public DisposableHandle invokeOnTimeout(long timeMillis, final Runnable block, CoroutineContext context) {
|
||||
if (this.handler.postDelayed(block, RangesKt.coerceAtMost(timeMillis, DurationKt.MAX_MILLIS))) {
|
||||
return new DisposableHandle() { // from class: kotlinx.coroutines.android.a
|
||||
@Override // kotlinx.coroutines.DisposableHandle
|
||||
public final void dispose() {
|
||||
HandlerContext.invokeOnTimeout$lambda$2(HandlerContext.this, block);
|
||||
}
|
||||
};
|
||||
}
|
||||
cancelOnRejection(context, block);
|
||||
return NonDisposableHandle.INSTANCE;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
public boolean isDispatchNeeded(CoroutineContext context) {
|
||||
return (this.invokeImmediately && Intrinsics.areEqual(Looper.myLooper(), this.handler.getLooper())) ? false : true;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
/* renamed from: scheduleResumeAfterDelay */
|
||||
public void mo1686scheduleResumeAfterDelay(long timeMillis, final CancellableContinuation<? super Unit> continuation) {
|
||||
final Runnable runnable = new Runnable() { // from class: kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
CancellableContinuation.this.resumeUndispatched(this, Unit.INSTANCE);
|
||||
}
|
||||
};
|
||||
if (this.handler.postDelayed(runnable, RangesKt.coerceAtMost(timeMillis, DurationKt.MAX_MILLIS))) {
|
||||
continuation.invokeOnCancellation(new Function1<Throwable, Unit>() { // from class: kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Throwable th) {
|
||||
invoke2(th);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(Throwable th) {
|
||||
Handler handler;
|
||||
handler = HandlerContext.this.handler;
|
||||
handler.removeCallbacks(runnable);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cancelOnRejection(continuation.getContext(), runnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.MainCoroutineDispatcher, kotlinx.coroutines.CoroutineDispatcher
|
||||
public String toString() {
|
||||
String stringInternalImpl = toStringInternalImpl();
|
||||
if (stringInternalImpl == null) {
|
||||
stringInternalImpl = this.name;
|
||||
if (stringInternalImpl == null) {
|
||||
stringInternalImpl = this.handler.toString();
|
||||
}
|
||||
if (this.invokeImmediately) {
|
||||
return w.n(stringInternalImpl, ".immediate");
|
||||
}
|
||||
}
|
||||
return stringInternalImpl;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.android.HandlerDispatcher, kotlinx.coroutines.MainCoroutineDispatcher
|
||||
public HandlerContext getImmediate() {
|
||||
return this.immediate;
|
||||
}
|
||||
|
||||
public /* synthetic */ HandlerContext(Handler handler, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(handler, (i & 2) != 0 ? null : str);
|
||||
}
|
||||
|
||||
public HandlerContext(Handler handler, String str) {
|
||||
this(handler, str, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlinx.coroutines.Delay;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\b6\u0018\u00002\u00020\u00012\u00020\u0002B\u0007\b\u0004¢\u0006\u0002\u0010\u0003R\u0012\u0010\u0004\u001a\u00020\u0000X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006\u0082\u0001\u0001\u0007¨\u0006\b"}, d2 = {"Lkotlinx/coroutines/android/HandlerDispatcher;", "Lkotlinx/coroutines/MainCoroutineDispatcher;", "Lkotlinx/coroutines/Delay;", "()V", "immediate", "getImmediate", "()Lkotlinx/coroutines/android/HandlerDispatcher;", "Lkotlinx/coroutines/android/HandlerContext;", "kotlinx-coroutines-android"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class HandlerDispatcher extends MainCoroutineDispatcher implements Delay {
|
||||
public /* synthetic */ HandlerDispatcher(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.Delay
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "Deprecated without replacement as an internal method never intended for public use")
|
||||
public Object delay(long j4, Continuation<? super Unit> continuation) {
|
||||
return Delay.DefaultImpls.delay(this, j4, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.MainCoroutineDispatcher
|
||||
public abstract HandlerDispatcher getImmediate();
|
||||
|
||||
public DisposableHandle invokeOnTimeout(long j4, Runnable runnable, CoroutineContext coroutineContext) {
|
||||
return Delay.DefaultImpls.invokeOnTimeout(this, j4, runnable, coroutineContext);
|
||||
}
|
||||
|
||||
private HandlerDispatcher() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Choreographer;
|
||||
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
||||
import com.google.firebase.messaging.Constants;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugProbesKt;
|
||||
import kotlin.jvm.JvmField;
|
||||
import kotlin.jvm.JvmName;
|
||||
import kotlin.jvm.JvmOverloads;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SourceDebugExtension;
|
||||
import kotlinx.coroutines.CancellableContinuation;
|
||||
import kotlinx.coroutines.CancellableContinuationImpl;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
|
||||
@Metadata(d1 = {"\u0000@\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\u001a\u000e\u0010\b\u001a\u00020\u0001H\u0086@¢\u0006\u0002\u0010\t\u001a\u000e\u0010\n\u001a\u00020\u0001H\u0082@¢\u0006\u0002\u0010\t\u001a\u001e\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0006\u001a\u00020\u00072\f\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00010\u000eH\u0002\u001a\u0016\u0010\u000f\u001a\u00020\f2\f\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00010\u000eH\u0002\u001a\u001d\u0010\u0010\u001a\u00020\u0003*\u00020\u00112\n\b\u0002\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0007¢\u0006\u0002\b\u0014\u001a\u0014\u0010\u0015\u001a\u00020\u0011*\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u0018H\u0001\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u0018\u0010\u0002\u001a\u0004\u0018\u00010\u00038\u0000X\u0081\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0004\u0010\u0005\"\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0019"}, d2 = {"MAX_DELAY", "", "Main", "Lkotlinx/coroutines/android/HandlerDispatcher;", "getMain$annotations", "()V", "choreographer", "Landroid/view/Choreographer;", "awaitFrame", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "awaitFrameSlowPath", "postFrameCallback", "", "cont", "Lkotlinx/coroutines/CancellableContinuation;", "updateChoreographerAndPostFrameCallback", "asCoroutineDispatcher", "Landroid/os/Handler;", AppMeasurementSdk.ConditionalUserProperty.NAME, "", Constants.MessagePayloadKeys.FROM, "asHandler", "Landroid/os/Looper;", "async", "", "kotlinx-coroutines-android"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
@SourceDebugExtension({"SMAP\nHandlerDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 HandlerDispatcher.kt\nkotlinx/coroutines/android/HandlerDispatcherKt\n+ 2 CancellableContinuation.kt\nkotlinx/coroutines/CancellableContinuationKt\n+ 3 Runnable.kt\nkotlinx/coroutines/RunnableKt\n+ 4 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,216:1\n314#2,11:217\n314#2,9:228\n323#2,2:238\n17#3:237\n1#4:240\n*S KotlinDebug\n*F\n+ 1 HandlerDispatcher.kt\nkotlinx/coroutines/android/HandlerDispatcherKt\n*L\n188#1:217,11\n196#1:228,9\n196#1:238,2\n200#1:237\n*E\n"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HandlerDispatcherKt {
|
||||
private static final long MAX_DELAY = 4611686018427387903L;
|
||||
|
||||
@JvmField
|
||||
public static final HandlerDispatcher Main;
|
||||
private static volatile Choreographer choreographer;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
static {
|
||||
Object m116constructorimpl;
|
||||
Object[] objArr = 0;
|
||||
Object[] objArr2 = 0;
|
||||
try {
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(new HandlerContext(asHandler(Looper.getMainLooper(), true), objArr2 == true ? 1 : 0, 2, objArr == true ? 1 : 0));
|
||||
} catch (Throwable th) {
|
||||
Result.Companion companion2 = Result.INSTANCE;
|
||||
m116constructorimpl = Result.m116constructorimpl(ResultKt.createFailure(th));
|
||||
}
|
||||
Main = (HandlerDispatcher) (Result.m122isFailureimpl(m116constructorimpl) ? null : m116constructorimpl);
|
||||
}
|
||||
|
||||
public static final Handler asHandler(Looper looper, boolean z3) {
|
||||
if (!z3) {
|
||||
return new Handler(looper);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
public static final Object awaitFrame(Continuation<? super Long> continuation) {
|
||||
Choreographer choreographer2 = choreographer;
|
||||
if (choreographer2 == null) {
|
||||
return awaitFrameSlowPath(continuation);
|
||||
}
|
||||
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
|
||||
cancellableContinuationImpl.initCancellability();
|
||||
postFrameCallback(choreographer2, cancellableContinuationImpl);
|
||||
Object result = cancellableContinuationImpl.getResult();
|
||||
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
|
||||
DebugProbesKt.probeCoroutineSuspended(continuation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final Object awaitFrameSlowPath(Continuation<? super Long> continuation) {
|
||||
final CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted(continuation), 1);
|
||||
cancellableContinuationImpl.initCancellability();
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
updateChoreographerAndPostFrameCallback(cancellableContinuationImpl);
|
||||
} else {
|
||||
Dispatchers.getMain().mo1685dispatch(cancellableContinuationImpl.getContext(), new Runnable() { // from class: kotlinx.coroutines.android.HandlerDispatcherKt$awaitFrameSlowPath$lambda$3$$inlined$Runnable$1
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
HandlerDispatcherKt.updateChoreographerAndPostFrameCallback(CancellableContinuation.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
Object result = cancellableContinuationImpl.getResult();
|
||||
if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
|
||||
DebugProbesKt.probeCoroutineSuspended(continuation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
@JvmName(name = Constants.MessagePayloadKeys.FROM)
|
||||
public static final HandlerDispatcher from(Handler handler) {
|
||||
return from$default(handler, null, 1, null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ HandlerDispatcher from$default(Handler handler, String str, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
str = null;
|
||||
}
|
||||
return from(handler, str);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Use Dispatchers.Main instead")
|
||||
public static /* synthetic */ void getMain$annotations() {
|
||||
}
|
||||
|
||||
public static final void postFrameCallback(Choreographer choreographer2, CancellableContinuation<? super Long> cancellableContinuation) {
|
||||
choreographer2.postFrameCallback(new b(cancellableContinuation, 0));
|
||||
}
|
||||
|
||||
public static final void postFrameCallback$lambda$6(CancellableContinuation cancellableContinuation, long j4) {
|
||||
cancellableContinuation.resumeUndispatched(Dispatchers.getMain(), Long.valueOf(j4));
|
||||
}
|
||||
|
||||
public static final void updateChoreographerAndPostFrameCallback(CancellableContinuation<? super Long> cancellableContinuation) {
|
||||
Choreographer choreographer2 = choreographer;
|
||||
if (choreographer2 == null) {
|
||||
choreographer2 = Choreographer.getInstance();
|
||||
Intrinsics.checkNotNull(choreographer2);
|
||||
choreographer = choreographer2;
|
||||
}
|
||||
postFrameCallback(choreographer2, cancellableContinuation);
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
@JvmName(name = Constants.MessagePayloadKeys.FROM)
|
||||
public static final HandlerDispatcher from(Handler handler, String str) {
|
||||
return new HandlerContext(handler, str);
|
||||
}
|
||||
}
|
||||
31
apk_decompiled/sources/kotlinx/coroutines/android/b.java
Normal file
31
apk_decompiled/sources/kotlinx/coroutines/android/b.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package kotlinx.coroutines.android;
|
||||
|
||||
import android.view.Choreographer;
|
||||
import kotlinx.coroutines.CancellableContinuation;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class b implements Choreographer.FrameCallback {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f7151a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f7152b;
|
||||
|
||||
public /* synthetic */ b(Object obj, int i) {
|
||||
this.f7151a = i;
|
||||
this.f7152b = obj;
|
||||
}
|
||||
|
||||
@Override // android.view.Choreographer.FrameCallback
|
||||
public final void doFrame(long j4) {
|
||||
switch (this.f7151a) {
|
||||
case 0:
|
||||
HandlerDispatcherKt.a((CancellableContinuation) this.f7152b, j4);
|
||||
return;
|
||||
default:
|
||||
((Runnable) this.f7152b).run();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user