Rabbit-R1/switch port/smali/smali_classes3/org/webrtc/ThreadUtils$ThreadChecker.smali
2024-05-21 17:08:36 -04:00

85 lines
1.8 KiB
Smali

.class public Lorg/webrtc/ThreadUtils$ThreadChecker;
.super Ljava/lang/Object;
.source "ThreadUtils.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lorg/webrtc/ThreadUtils;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "ThreadChecker"
.end annotation
# instance fields
.field private thread:Ljava/lang/Thread;
# direct methods
.method public constructor <init>()V
.locals 1
.line 25
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 26
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
iput-object v0, p0, Lorg/webrtc/ThreadUtils$ThreadChecker;->thread:Ljava/lang/Thread;
return-void
.end method
# virtual methods
.method public checkIsOnValidThread()V
.locals 1
iget-object v0, p0, Lorg/webrtc/ThreadUtils$ThreadChecker;->thread:Ljava/lang/Thread;
if-nez v0, :cond_0
.line 30
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
iput-object v0, p0, Lorg/webrtc/ThreadUtils$ThreadChecker;->thread:Ljava/lang/Thread;
.line 32
:cond_0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
iget-object p0, p0, Lorg/webrtc/ThreadUtils$ThreadChecker;->thread:Ljava/lang/Thread;
if-ne v0, p0, :cond_1
return-void
.line 33
:cond_1
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "Wrong thread"
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public detachThread()V
.locals 1
const/4 v0, 0x0
iput-object v0, p0, Lorg/webrtc/ThreadUtils$ThreadChecker;->thread:Ljava/lang/Thread;
return-void
.end method