SerializedSubject.smali 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. .class final Lio/reactivex/subjects/SerializedSubject;
  2. .super Lio/reactivex/subjects/Subject;
  3. .source "SerializedSubject.java"
  4. # interfaces
  5. .implements Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate;
  6. # annotations
  7. .annotation system Ldalvik/annotation/Signature;
  8. value = {
  9. "<T:",
  10. "Ljava/lang/Object;",
  11. ">",
  12. "Lio/reactivex/subjects/Subject<",
  13. "TT;>;",
  14. "Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate<",
  15. "Ljava/lang/Object;",
  16. ">;"
  17. }
  18. .end annotation
  19. # instance fields
  20. .field final actual:Lio/reactivex/subjects/Subject;
  21. .annotation system Ldalvik/annotation/Signature;
  22. value = {
  23. "Lio/reactivex/subjects/Subject<",
  24. "TT;>;"
  25. }
  26. .end annotation
  27. .end field
  28. .field volatile done:Z
  29. .field emitting:Z
  30. .field queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  31. .annotation system Ldalvik/annotation/Signature;
  32. value = {
  33. "Lio/reactivex/internal/util/AppendOnlyLinkedArrayList<",
  34. "Ljava/lang/Object;",
  35. ">;"
  36. }
  37. .end annotation
  38. .end field
  39. # direct methods
  40. .method constructor <init>(Lio/reactivex/subjects/Subject;)V
  41. .locals 0
  42. .annotation system Ldalvik/annotation/Signature;
  43. value = {
  44. "(",
  45. "Lio/reactivex/subjects/Subject<",
  46. "TT;>;)V"
  47. }
  48. .end annotation
  49. .line 42
  50. invoke-direct {p0}, Lio/reactivex/subjects/Subject;-><init>()V
  51. .line 43
  52. iput-object p1, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  53. return-void
  54. .end method
  55. # virtual methods
  56. .method emitLoop()V
  57. .locals 2
  58. .line 168
  59. :goto_0
  60. monitor-enter p0
  61. .line 169
  62. :try_start_0
  63. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  64. if-nez v0, :cond_0
  65. const/4 v0, 0x0
  66. .line 171
  67. iput-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  68. .line 172
  69. monitor-exit p0
  70. return-void
  71. :cond_0
  72. const/4 v1, 0x0
  73. .line 174
  74. iput-object v1, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  75. .line 175
  76. monitor-exit p0
  77. :try_end_0
  78. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  79. .line 176
  80. invoke-virtual {v0, p0}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->forEachWhile(Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate;)V
  81. goto :goto_0
  82. :catchall_0
  83. move-exception v0
  84. .line 175
  85. :try_start_1
  86. monitor-exit p0
  87. :try_end_1
  88. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  89. goto :goto_2
  90. :goto_1
  91. throw v0
  92. :goto_2
  93. goto :goto_1
  94. .end method
  95. .method public getThrowable()Ljava/lang/Throwable;
  96. .locals 1
  97. .line 197
  98. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  99. invoke-virtual {v0}, Lio/reactivex/subjects/Subject;->getThrowable()Ljava/lang/Throwable;
  100. move-result-object v0
  101. return-object v0
  102. .end method
  103. .method public hasComplete()Z
  104. .locals 1
  105. .line 202
  106. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  107. invoke-virtual {v0}, Lio/reactivex/subjects/Subject;->hasComplete()Z
  108. move-result v0
  109. return v0
  110. .end method
  111. .method public hasObservers()Z
  112. .locals 1
  113. .line 187
  114. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  115. invoke-virtual {v0}, Lio/reactivex/subjects/Subject;->hasObservers()Z
  116. move-result v0
  117. return v0
  118. .end method
  119. .method public hasThrowable()Z
  120. .locals 1
  121. .line 192
  122. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  123. invoke-virtual {v0}, Lio/reactivex/subjects/Subject;->hasThrowable()Z
  124. move-result v0
  125. return v0
  126. .end method
  127. .method public onComplete()V
  128. .locals 2
  129. .line 142
  130. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  131. if-eqz v0, :cond_0
  132. return-void
  133. .line 145
  134. :cond_0
  135. monitor-enter p0
  136. .line 146
  137. :try_start_0
  138. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  139. if-eqz v0, :cond_1
  140. .line 147
  141. monitor-exit p0
  142. return-void
  143. :cond_1
  144. const/4 v0, 0x1
  145. .line 149
  146. iput-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  147. .line 150
  148. iget-boolean v1, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  149. if-eqz v1, :cond_3
  150. .line 151
  151. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  152. if-nez v0, :cond_2
  153. .line 153
  154. new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  155. const/4 v1, 0x4
  156. invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;-><init>(I)V
  157. .line 154
  158. iput-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  159. .line 156
  160. :cond_2
  161. invoke-static {}, Lio/reactivex/internal/util/NotificationLite;->complete()Ljava/lang/Object;
  162. move-result-object v1
  163. invoke-virtual {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V
  164. .line 157
  165. monitor-exit p0
  166. return-void
  167. .line 159
  168. :cond_3
  169. iput-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  170. .line 160
  171. monitor-exit p0
  172. :try_end_0
  173. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  174. .line 161
  175. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  176. invoke-virtual {v0}, Lio/reactivex/subjects/Subject;->onComplete()V
  177. return-void
  178. :catchall_0
  179. move-exception v0
  180. .line 160
  181. :try_start_1
  182. monitor-exit p0
  183. :try_end_1
  184. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  185. throw v0
  186. .end method
  187. .method public onError(Ljava/lang/Throwable;)V
  188. .locals 2
  189. .line 110
  190. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  191. if-eqz v0, :cond_0
  192. .line 111
  193. invoke-static {p1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
  194. return-void
  195. .line 115
  196. :cond_0
  197. monitor-enter p0
  198. .line 116
  199. :try_start_0
  200. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  201. const/4 v1, 0x1
  202. if-eqz v0, :cond_1
  203. const/4 v0, 0x1
  204. goto :goto_0
  205. .line 119
  206. :cond_1
  207. iput-boolean v1, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  208. .line 120
  209. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  210. if-eqz v0, :cond_3
  211. .line 121
  212. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  213. if-nez v0, :cond_2
  214. .line 123
  215. new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  216. const/4 v1, 0x4
  217. invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;-><init>(I)V
  218. .line 124
  219. iput-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  220. .line 126
  221. :cond_2
  222. invoke-static {p1}, Lio/reactivex/internal/util/NotificationLite;->error(Ljava/lang/Throwable;)Ljava/lang/Object;
  223. move-result-object p1
  224. invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->setFirst(Ljava/lang/Object;)V
  225. .line 127
  226. monitor-exit p0
  227. return-void
  228. :cond_3
  229. const/4 v0, 0x0
  230. .line 130
  231. iput-boolean v1, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  232. .line 132
  233. :goto_0
  234. monitor-exit p0
  235. :try_end_0
  236. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  237. if-eqz v0, :cond_4
  238. .line 134
  239. invoke-static {p1}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
  240. return-void
  241. .line 137
  242. :cond_4
  243. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  244. invoke-virtual {v0, p1}, Lio/reactivex/subjects/Subject;->onError(Ljava/lang/Throwable;)V
  245. return-void
  246. :catchall_0
  247. move-exception p1
  248. .line 132
  249. :try_start_1
  250. monitor-exit p0
  251. :try_end_1
  252. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  253. throw p1
  254. .end method
  255. .method public onNext(Ljava/lang/Object;)V
  256. .locals 2
  257. .annotation system Ldalvik/annotation/Signature;
  258. value = {
  259. "(TT;)V"
  260. }
  261. .end annotation
  262. .line 86
  263. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  264. if-eqz v0, :cond_0
  265. return-void
  266. .line 89
  267. :cond_0
  268. monitor-enter p0
  269. .line 90
  270. :try_start_0
  271. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  272. if-eqz v0, :cond_1
  273. .line 91
  274. monitor-exit p0
  275. return-void
  276. .line 93
  277. :cond_1
  278. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  279. if-eqz v0, :cond_3
  280. .line 94
  281. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  282. if-nez v0, :cond_2
  283. .line 96
  284. new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  285. const/4 v1, 0x4
  286. invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;-><init>(I)V
  287. .line 97
  288. iput-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  289. .line 99
  290. :cond_2
  291. invoke-static {p1}, Lio/reactivex/internal/util/NotificationLite;->next(Ljava/lang/Object;)Ljava/lang/Object;
  292. move-result-object p1
  293. invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V
  294. .line 100
  295. monitor-exit p0
  296. return-void
  297. :cond_3
  298. const/4 v0, 0x1
  299. .line 102
  300. iput-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  301. .line 103
  302. monitor-exit p0
  303. :try_end_0
  304. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  305. .line 104
  306. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  307. invoke-virtual {v0, p1}, Lio/reactivex/subjects/Subject;->onNext(Ljava/lang/Object;)V
  308. .line 105
  309. invoke-virtual {p0}, Lio/reactivex/subjects/SerializedSubject;->emitLoop()V
  310. return-void
  311. :catchall_0
  312. move-exception p1
  313. .line 103
  314. :try_start_1
  315. monitor-exit p0
  316. :try_end_1
  317. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  318. throw p1
  319. .end method
  320. .method public onSubscribe(Lio/reactivex/disposables/Disposable;)V
  321. .locals 2
  322. .line 55
  323. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  324. const/4 v1, 0x1
  325. if-nez v0, :cond_3
  326. .line 56
  327. monitor-enter p0
  328. .line 57
  329. :try_start_0
  330. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->done:Z
  331. if-eqz v0, :cond_0
  332. goto :goto_0
  333. .line 60
  334. :cond_0
  335. iget-boolean v0, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  336. if-eqz v0, :cond_2
  337. .line 61
  338. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  339. if-nez v0, :cond_1
  340. .line 63
  341. new-instance v0, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  342. const/4 v1, 0x4
  343. invoke-direct {v0, v1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;-><init>(I)V
  344. .line 64
  345. iput-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
  346. .line 66
  347. :cond_1
  348. invoke-static {p1}, Lio/reactivex/internal/util/NotificationLite;->disposable(Lio/reactivex/disposables/Disposable;)Ljava/lang/Object;
  349. move-result-object p1
  350. invoke-virtual {v0, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V
  351. .line 67
  352. monitor-exit p0
  353. return-void
  354. .line 69
  355. :cond_2
  356. iput-boolean v1, p0, Lio/reactivex/subjects/SerializedSubject;->emitting:Z
  357. const/4 v0, 0x0
  358. const/4 v1, 0x0
  359. .line 72
  360. :goto_0
  361. monitor-exit p0
  362. goto :goto_1
  363. :catchall_0
  364. move-exception p1
  365. monitor-exit p0
  366. :try_end_0
  367. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  368. throw p1
  369. :cond_3
  370. :goto_1
  371. if-eqz v1, :cond_4
  372. .line 77
  373. invoke-interface {p1}, Lio/reactivex/disposables/Disposable;->dispose()V
  374. goto :goto_2
  375. .line 79
  376. :cond_4
  377. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  378. invoke-virtual {v0, p1}, Lio/reactivex/subjects/Subject;->onSubscribe(Lio/reactivex/disposables/Disposable;)V
  379. .line 80
  380. invoke-virtual {p0}, Lio/reactivex/subjects/SerializedSubject;->emitLoop()V
  381. :goto_2
  382. return-void
  383. .end method
  384. .method protected subscribeActual(Lio/reactivex/Observer;)V
  385. .locals 1
  386. .annotation system Ldalvik/annotation/Signature;
  387. value = {
  388. "(",
  389. "Lio/reactivex/Observer<",
  390. "-TT;>;)V"
  391. }
  392. .end annotation
  393. .line 48
  394. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  395. invoke-virtual {v0, p1}, Lio/reactivex/subjects/Subject;->subscribe(Lio/reactivex/Observer;)V
  396. return-void
  397. .end method
  398. .method public test(Ljava/lang/Object;)Z
  399. .locals 1
  400. .line 182
  401. iget-object v0, p0, Lio/reactivex/subjects/SerializedSubject;->actual:Lio/reactivex/subjects/Subject;
  402. invoke-static {p1, v0}, Lio/reactivex/internal/util/NotificationLite;->acceptFull(Ljava/lang/Object;Lio/reactivex/Observer;)Z
  403. move-result p1
  404. return p1
  405. .end method