528 lines
15 KiB
Smali
528 lines
15 KiB
Smali
.class public final Lkotlinx/coroutines/android/b;
|
|
.super Ljava/lang/Object;
|
|
.source "HandlerDispatcher.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/SourceDebugExtension;
|
|
value = "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,194:1\n308#2,11:195\n308#2,9:206\n317#2,2:216\n17#3:215\n1#4:218\n*E\n*S KotlinDebug\n*F\n+ 1 HandlerDispatcher.kt\nkotlinx/coroutines/android/HandlerDispatcherKt\n*L\n171#1,11:195\n176#1,9:206\n176#1,2:216\n177#1:215\n*E\n"
|
|
.end annotation
|
|
|
|
.annotation runtime Lkotlin/Metadata;
|
|
bv = {}
|
|
d1 = {
|
|
"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\u0008\u0002\n\u0002\u0010\t\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u000c\u001a\u001f\u0010\u0004\u001a\u00020\u0003*\u00020\u00002\n\u0008\u0002\u0010\u0002\u001a\u0004\u0018\u00010\u0001H\u0007\u00a2\u0006\u0004\u0008\u0004\u0010\u0005\u001a\u0014\u0010\t\u001a\u00020\u0000*\u00020\u00062\u0006\u0010\u0008\u001a\u00020\u0007H\u0001\u001a\u0013\u0010\u000b\u001a\u00020\nH\u0086@\u00f8\u0001\u0000\u00a2\u0006\u0004\u0008\u000b\u0010\u000c\u001a\u0016\u0010\u0010\u001a\u00020\u000f2\u000c\u0010\u000e\u001a\u0008\u0012\u0004\u0012\u00020\n0\rH\u0002\u001a\u001e\u0010\u0013\u001a\u00020\u000f2\u0006\u0010\u0012\u001a\u00020\u00112\u000c\u0010\u000e\u001a\u0008\u0012\u0004\u0012\u00020\n0\rH\u0002\"\u0014\u0010\u0016\u001a\u00020\n8\u0002X\u0082T\u00a2\u0006\u0006\n\u0004\u0008\u0014\u0010\u0015\"\u001c\u0010\u001b\u001a\u0004\u0018\u00010\u00038\u0000X\u0081\u0004\u00a2\u0006\u000c\n\u0004\u0008\u0017\u0010\u0018\u0012\u0004\u0008\u0019\u0010\u001a\"\u0018\u0010\u0012\u001a\u0004\u0018\u00010\u00118\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008\u0012\u0010\u001c\u0082\u0002\u0004\n\u0002\u0008\u0019\u00a8\u0006\u001d"
|
|
}
|
|
d2 = {
|
|
"Landroid/os/Handler;",
|
|
"",
|
|
"name",
|
|
"Lkotlinx/coroutines/android/a;",
|
|
"f",
|
|
"(Landroid/os/Handler;Ljava/lang/String;)Lkotlinx/coroutines/android/a;",
|
|
"Landroid/os/Looper;",
|
|
"",
|
|
"async",
|
|
"c",
|
|
"",
|
|
"d",
|
|
"(Lkotlin/coroutines/c;)Ljava/lang/Object;",
|
|
"Lkotlinx/coroutines/n;",
|
|
"cont",
|
|
"Lkotlin/d1;",
|
|
"j",
|
|
"Landroid/view/Choreographer;",
|
|
"choreographer",
|
|
"i",
|
|
"a",
|
|
"J",
|
|
"MAX_DELAY",
|
|
"b",
|
|
"Lkotlinx/coroutines/android/a;",
|
|
"getMain$annotations",
|
|
"()V",
|
|
"Main",
|
|
"Landroid/view/Choreographer;",
|
|
"kotlinx-coroutines-android"
|
|
}
|
|
k = 0x2
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final a:J = 0x3fffffffffffffffL
|
|
|
|
.field public static final b:Lkotlinx/coroutines/android/a;
|
|
.annotation build Lkotlin/jvm/JvmField;
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static volatile choreographer:Landroid/view/Choreographer;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
sget-object v1, Lkotlin/Result;->Companion:Lkotlin/Result$a;
|
|
|
|
new-instance v1, Lkotlinx/coroutines/android/HandlerContext;
|
|
|
|
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-static {v2, v3}, Lkotlinx/coroutines/android/b;->c(Landroid/os/Looper;Z)Landroid/os/Handler;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
invoke-direct {v1, v2, v0, v3, v0}, Lkotlinx/coroutines/android/HandlerContext;-><init>(Landroid/os/Handler;Ljava/lang/String;ILkotlin/jvm/internal/u;)V
|
|
|
|
invoke-static {v1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
sget-object v2, Lkotlin/Result;->Companion:Lkotlin/Result$a;
|
|
|
|
invoke-static {v1}, Lkotlin/d0;->a(Ljava/lang/Throwable;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
invoke-static {v1}, Lkotlin/Result;->isFailure-impl(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
move-object v0, v1
|
|
|
|
:goto_1
|
|
check-cast v0, Lkotlinx/coroutines/android/a;
|
|
|
|
sput-object v0, Lkotlinx/coroutines/android/b;->b:Lkotlinx/coroutines/android/a;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic a(Landroid/view/Choreographer;Lkotlinx/coroutines/n;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-static {p0, p1}, Lkotlinx/coroutines/android/b;->i(Landroid/view/Choreographer;Lkotlinx/coroutines/n;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic b(Lkotlinx/coroutines/n;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-static {p0}, Lkotlinx/coroutines/android/b;->j(Lkotlinx/coroutines/n;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final c(Landroid/os/Looper;Z)Landroid/os/Handler;
|
|
.locals 7
|
|
.param p0 # Landroid/os/Looper;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v0, 0x1c
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-lt p1, v0, :cond_0
|
|
|
|
.line 2
|
|
const-class p1, Landroid/os/Handler;
|
|
|
|
const-string v0, "createAsync"
|
|
|
|
new-array v4, v3, [Ljava/lang/Class;
|
|
|
|
const-class v5, Landroid/os/Looper;
|
|
|
|
aput-object v5, v4, v2
|
|
|
|
invoke-virtual {p1, v0, v4}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object p1
|
|
|
|
new-array v0, v3, [Ljava/lang/Object;
|
|
|
|
aput-object p0, v0, v2
|
|
|
|
.line 3
|
|
invoke-virtual {p1, v1, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "null cannot be cast to non-null type android.os.Handler"
|
|
|
|
invoke-static {p0, p1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
check-cast p0, Landroid/os/Handler;
|
|
|
|
return-object p0
|
|
|
|
.line 4
|
|
:cond_0
|
|
:try_start_0
|
|
const-class p1, Landroid/os/Handler;
|
|
|
|
const/4 v0, 0x3
|
|
|
|
new-array v4, v0, [Ljava/lang/Class;
|
|
|
|
const-class v5, Landroid/os/Looper;
|
|
|
|
aput-object v5, v4, v2
|
|
|
|
.line 5
|
|
const-class v5, Landroid/os/Handler$Callback;
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
sget-object v5, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
|
|
|
|
const/4 v6, 0x2
|
|
|
|
aput-object v5, v4, v6
|
|
|
|
.line 6
|
|
invoke-virtual {p1, v4}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
aput-object p0, v0, v2
|
|
|
|
aput-object v1, v0, v3
|
|
|
|
.line 7
|
|
sget-object p0, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
|
|
|
|
aput-object p0, v0, v6
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/os/Handler;
|
|
|
|
return-object p0
|
|
|
|
.line 8
|
|
:catch_0
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
invoke-direct {p1, p0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
|
|
|
return-object p1
|
|
|
|
.line 9
|
|
:cond_1
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
invoke-direct {p1, p0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static final d(Lkotlin/coroutines/c;)Ljava/lang/Object;
|
|
.locals 4
|
|
.param p0 # Lkotlin/coroutines/c;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/coroutines/c<",
|
|
"-",
|
|
"Ljava/lang/Long;",
|
|
">;)",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget-object v0, Lkotlinx/coroutines/android/b;->choreographer:Landroid/view/Choreographer;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 2
|
|
new-instance v2, Lkotlinx/coroutines/o;
|
|
|
|
invoke-static {p0}, Lkotlin/coroutines/intrinsics/IntrinsicsKt__IntrinsicsJvmKt;->d(Lkotlin/coroutines/c;)Lkotlin/coroutines/c;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v2, v3, v1}, Lkotlinx/coroutines/o;-><init>(Lkotlin/coroutines/c;I)V
|
|
|
|
.line 3
|
|
invoke-virtual {v2}, Lkotlinx/coroutines/o;->y()V
|
|
|
|
.line 4
|
|
invoke-static {v0, v2}, Lkotlinx/coroutines/android/b;->a(Landroid/view/Choreographer;Lkotlinx/coroutines/n;)V
|
|
|
|
.line 5
|
|
invoke-virtual {v2}, Lkotlinx/coroutines/o;->D()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
.line 6
|
|
invoke-static {}, Lvi/b;->h()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
invoke-static {p0}, Lwi/e;->c(Lkotlin/coroutines/c;)V
|
|
|
|
:cond_0
|
|
return-object v0
|
|
|
|
.line 7
|
|
:cond_1
|
|
new-instance v0, Lkotlinx/coroutines/o;
|
|
|
|
invoke-static {p0}, Lkotlin/coroutines/intrinsics/IntrinsicsKt__IntrinsicsJvmKt;->d(Lkotlin/coroutines/c;)Lkotlin/coroutines/c;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v0, v2, v1}, Lkotlinx/coroutines/o;-><init>(Lkotlin/coroutines/c;I)V
|
|
|
|
.line 8
|
|
invoke-virtual {v0}, Lkotlinx/coroutines/o;->y()V
|
|
|
|
.line 9
|
|
invoke-static {}, Lkotlinx/coroutines/b1;->e()Lkotlinx/coroutines/i2;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lkotlin/coroutines/EmptyCoroutineContext;->INSTANCE:Lkotlin/coroutines/EmptyCoroutineContext;
|
|
|
|
.line 10
|
|
new-instance v3, Lkotlinx/coroutines/android/b$a;
|
|
|
|
invoke-direct {v3, v0}, Lkotlinx/coroutines/android/b$a;-><init>(Lkotlinx/coroutines/n;)V
|
|
|
|
.line 11
|
|
invoke-virtual {v1, v2, v3}, Lkotlinx/coroutines/CoroutineDispatcher;->dispatch(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V
|
|
|
|
.line 12
|
|
invoke-virtual {v0}, Lkotlinx/coroutines/o;->D()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
.line 13
|
|
invoke-static {}, Lvi/b;->h()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
if-ne v0, v1, :cond_2
|
|
|
|
invoke-static {p0}, Lwi/e;->c(Lkotlin/coroutines/c;)V
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final e(Landroid/os/Handler;)Lkotlinx/coroutines/android/a;
|
|
.locals 2
|
|
.param p0 # Landroid/os/Handler;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lkotlin/jvm/JvmName;
|
|
name = "from"
|
|
.end annotation
|
|
|
|
.annotation build Lkotlin/jvm/JvmOverloads;
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-static {p0, v0, v1, v0}, Lkotlinx/coroutines/android/b;->g(Landroid/os/Handler;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/android/a;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final f(Landroid/os/Handler;Ljava/lang/String;)Lkotlinx/coroutines/android/a;
|
|
.locals 1
|
|
.param p0 # Landroid/os/Handler;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Lorg/jetbrains/annotations/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lkotlin/jvm/JvmName;
|
|
name = "from"
|
|
.end annotation
|
|
|
|
.annotation build Lkotlin/jvm/JvmOverloads;
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Lkotlinx/coroutines/android/HandlerContext;
|
|
|
|
invoke-direct {v0, p0, p1}, Lkotlinx/coroutines/android/HandlerContext;-><init>(Landroid/os/Handler;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static synthetic g(Landroid/os/Handler;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/android/a;
|
|
.locals 0
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 1
|
|
:cond_0
|
|
invoke-static {p0, p1}, Lkotlinx/coroutines/android/b;->f(Landroid/os/Handler;Ljava/lang/String;)Lkotlinx/coroutines/android/a;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static synthetic h()V
|
|
.locals 0
|
|
.annotation runtime Lkotlin/Deprecated;
|
|
level = .enum Lkotlin/DeprecationLevel;->HIDDEN:Lkotlin/DeprecationLevel;
|
|
message = "Use Dispatchers.Main instead"
|
|
.end annotation
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final i(Landroid/view/Choreographer;Lkotlinx/coroutines/n;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/view/Choreographer;",
|
|
"Lkotlinx/coroutines/n<",
|
|
"-",
|
|
"Ljava/lang/Long;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Lkotlinx/coroutines/android/b$b;
|
|
|
|
invoke-direct {v0, p1}, Lkotlinx/coroutines/android/b$b;-><init>(Lkotlinx/coroutines/n;)V
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/Choreographer;->postFrameCallback(Landroid/view/Choreographer$FrameCallback;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final j(Lkotlinx/coroutines/n;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlinx/coroutines/n<",
|
|
"-",
|
|
"Ljava/lang/Long;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget-object v0, Lkotlinx/coroutines/android/b;->choreographer:Landroid/view/Choreographer;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-static {}, Landroid/view/Choreographer;->getInstance()Landroid/view/Choreographer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V
|
|
|
|
sput-object v0, Lkotlinx/coroutines/android/b;->choreographer:Landroid/view/Choreographer;
|
|
|
|
.line 3
|
|
:goto_0
|
|
invoke-static {v0, p0}, Lkotlinx/coroutines/android/b;->i(Landroid/view/Choreographer;Lkotlinx/coroutines/n;)V
|
|
|
|
return-void
|
|
.end method
|