Scheduler$Worker$PeriodicTask.smali
5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
.class final Lio/reactivex/Scheduler$Worker$PeriodicTask;
.super Ljava/lang/Object;
.source "Scheduler.java"
# interfaces
.implements Ljava/lang/Runnable;
.implements Lio/reactivex/schedulers/SchedulerRunnableIntrospection;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lio/reactivex/Scheduler$Worker;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x10
name = "PeriodicTask"
.end annotation
# instance fields
.field count:J
.field final decoratedRun:Ljava/lang/Runnable;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end field
.field lastNowNanoseconds:J
.field final periodInNanoseconds:J
.field final sd:Lio/reactivex/internal/disposables/SequentialDisposable;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end field
.field startInNanoseconds:J
.field final synthetic this$0:Lio/reactivex/Scheduler$Worker;
# direct methods
.method constructor <init>(Lio/reactivex/Scheduler$Worker;JLjava/lang/Runnable;JLio/reactivex/internal/disposables/SequentialDisposable;J)V
.locals 0
.param p2 # J
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.param p5 # J
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.line 470
iput-object p1, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->this$0:Lio/reactivex/Scheduler$Worker;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 471
iput-object p4, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->decoratedRun:Ljava/lang/Runnable;
.line 472
iput-object p7, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->sd:Lio/reactivex/internal/disposables/SequentialDisposable;
.line 473
iput-wide p8, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->periodInNanoseconds:J
.line 474
iput-wide p5, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->lastNowNanoseconds:J
.line 475
iput-wide p2, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->startInNanoseconds:J
return-void
.end method
# virtual methods
.method public getWrappedRunnable()Ljava/lang/Runnable;
.locals 1
.line 508
iget-object v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->decoratedRun:Ljava/lang/Runnable;
return-object v0
.end method
.method public run()V
.locals 10
.line 480
iget-object v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->decoratedRun:Ljava/lang/Runnable;
invoke-interface {v0}, Ljava/lang/Runnable;->run()V
.line 482
iget-object v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->sd:Lio/reactivex/internal/disposables/SequentialDisposable;
invoke-virtual {v0}, Lio/reactivex/internal/disposables/SequentialDisposable;->isDisposed()Z
move-result v0
if-nez v0, :cond_2
.line 486
iget-object v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->this$0:Lio/reactivex/Scheduler$Worker;
sget-object v1, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {v0, v1}, Lio/reactivex/Scheduler$Worker;->now(Ljava/util/concurrent/TimeUnit;)J
move-result-wide v0
.line 488
sget-wide v2, Lio/reactivex/Scheduler;->CLOCK_DRIFT_TOLERANCE_NANOSECONDS:J
add-long/2addr v2, v0
iget-wide v4, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->lastNowNanoseconds:J
cmp-long v2, v2, v4
const-wide/16 v6, 0x1
if-ltz v2, :cond_1
iget-wide v2, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->periodInNanoseconds:J
add-long/2addr v4, v2
sget-wide v2, Lio/reactivex/Scheduler;->CLOCK_DRIFT_TOLERANCE_NANOSECONDS:J
add-long/2addr v4, v2
cmp-long v2, v0, v4
if-ltz v2, :cond_0
goto :goto_0
.line 497
:cond_0
iget-wide v2, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->startInNanoseconds:J
iget-wide v4, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->count:J
add-long/2addr v4, v6
iput-wide v4, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->count:J
iget-wide v6, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->periodInNanoseconds:J
mul-long/2addr v4, v6
add-long/2addr v2, v4
goto :goto_1
.line 490
:cond_1
:goto_0
iget-wide v2, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->periodInNanoseconds:J
add-long v4, v0, v2
.line 495
iget-wide v8, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->count:J
add-long/2addr v8, v6
iput-wide v8, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->count:J
mul-long/2addr v2, v8
sub-long v2, v4, v2
iput-wide v2, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->startInNanoseconds:J
move-wide v2, v4
.line 499
:goto_1
iput-wide v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->lastNowNanoseconds:J
sub-long/2addr v2, v0
.line 502
iget-object v0, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->sd:Lio/reactivex/internal/disposables/SequentialDisposable;
iget-object v1, p0, Lio/reactivex/Scheduler$Worker$PeriodicTask;->this$0:Lio/reactivex/Scheduler$Worker;
sget-object v4, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {v1, p0, v2, v3, v4}, Lio/reactivex/Scheduler$Worker;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Lio/reactivex/disposables/Disposable;
move-result-object v1
invoke-virtual {v0, v1}, Lio/reactivex/internal/disposables/SequentialDisposable;->replace(Lio/reactivex/disposables/Disposable;)Z
:cond_2
return-void
.end method