2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/utilities/video/VideoPlayerIdleDetector;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "VideoPlayerIdleDetector.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final backgroundThreadScheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
.field public final idleDetectionMs:J
|
|
|
|
|
|
|
|
.field public final idleDetectionScheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
.field public idleDetectionSubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
.field public isIdle:Z
|
|
|
|
|
|
|
|
.field public final onIdleStateChanged:Lkotlin/jvm/functions/Function1;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"Ljava/lang/Boolean;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(JLrx/Scheduler;Lrx/Scheduler;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(J",
|
|
|
|
"Lrx/Scheduler;",
|
|
|
|
"Lrx/Scheduler;",
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"-",
|
|
|
|
"Ljava/lang/Boolean;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-wide p1, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionMs:J
|
|
|
|
|
|
|
|
iput-object p3, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionScheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
iput-object p4, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->backgroundThreadScheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
iput-object p5, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->onIdleStateChanged:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p1, "onIdleStateChanged"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p1, "backgroundThreadScheduler"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "idleDetectionScheduler"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public synthetic constructor <init>(JLrx/Scheduler;Lrx/Scheduler;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
and-int/lit8 p7, p6, 0x1
|
|
|
|
|
|
|
|
if-eqz p7, :cond_0
|
|
|
|
|
|
|
|
const-wide/16 p1, 0xbb8
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-wide v1, p1
|
|
|
|
|
|
|
|
and-int/lit8 p1, p6, 0x2
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
invoke-static {}, Lr0/j/b/a;->a()Lrx/Scheduler;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
const-string p1, "AndroidSchedulers.mainThread()"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p3, p1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
move-object v3, p3
|
|
|
|
|
|
|
|
and-int/lit8 p1, p6, 0x4
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
invoke-static {}, Lr0/p/a;->a()Lrx/Scheduler;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p4
|
|
|
|
|
|
|
|
const-string p1, "Schedulers.computation()"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p4, p1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
move-object v4, p4
|
|
|
|
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
move-object v5, p5
|
|
|
|
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;-><init>(JLrx/Scheduler;Lrx/Scheduler;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$setIdle(Lcom/discord/utilities/video/VideoPlayerIdleDetector;Z)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final beginIdleDetectionTimer()V
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->cancelIdleDetectionTimer()V
|
|
|
|
|
|
|
|
iget-wide v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionMs:J
|
|
|
|
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
|
|
|
|
iget-object v3, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->backgroundThreadScheduler:Lrx/Scheduler;
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-static {v0, v1, v2, v3}, Lrx/Observable;->a0(JLjava/util/concurrent/TimeUnit;Lrx/Scheduler;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionScheduler:Lrx/Scheduler;
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->H(Lrx/Scheduler;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/utilities/video/VideoPlayerIdleDetector$beginIdleDetectionTimer$1;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector$beginIdleDetectionTimer$1;-><init>(Lcom/discord/utilities/video/VideoPlayerIdleDetector;)V
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->R(Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionSubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final cancelIdleDetectionTimer()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionSubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionSubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final setIdle(Z)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->isIdle:Z
|
|
|
|
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->isIdle:Z
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->onIdleStateChanged:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {v0, p1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final beginIdleDetection()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->idleDetectionSubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->beginIdleDetectionTimer()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final dispose()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->cancelIdleDetectionTimer()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final endIdleDetection()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->cancelIdleDetectionTimer()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final onInteraction()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->isIdle:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->beginIdleDetectionTimer()V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->cancelIdleDetectionTimer()V
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/video/VideoPlayerIdleDetector;->setIdle(Z)V
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-void
|
|
|
|
.end method
|