CancellationSignal.smali 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. .class public final Landroid/support/v4/os/CancellationSignal;
  2. .super Ljava/lang/Object;
  3. .source "CancellationSignal.java"
  4. # annotations
  5. .annotation system Ldalvik/annotation/MemberClasses;
  6. value = {
  7. Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  8. }
  9. .end annotation
  10. # instance fields
  11. .field private mCancelInProgress:Z
  12. .field private mCancellationSignalObj:Ljava/lang/Object;
  13. .field private mIsCanceled:Z
  14. .field private mOnCancelListener:Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  15. # direct methods
  16. .method public constructor <init>()V
  17. .locals 0
  18. .prologue
  19. .line 35
  20. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  21. .line 36
  22. return-void
  23. .end method
  24. .method private waitForCancelFinishedLocked()V
  25. .locals 1
  26. .prologue
  27. .line 150
  28. :goto_0
  29. iget-boolean v0, p0, Landroid/support/v4/os/CancellationSignal;->mCancelInProgress:Z
  30. if-eqz v0, :cond_0
  31. .line 152
  32. :try_start_0
  33. invoke-virtual {p0}, Ljava/lang/Object;->wait()V
  34. :try_end_0
  35. .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
  36. goto :goto_0
  37. .line 153
  38. :catch_0
  39. move-exception v0
  40. goto :goto_0
  41. .line 156
  42. :cond_0
  43. return-void
  44. .end method
  45. # virtual methods
  46. .method public cancel()V
  47. .locals 4
  48. .prologue
  49. .line 67
  50. monitor-enter p0
  51. .line 68
  52. :try_start_0
  53. iget-boolean v2, p0, Landroid/support/v4/os/CancellationSignal;->mIsCanceled:Z
  54. if-eqz v2, :cond_0
  55. .line 69
  56. monitor-exit p0
  57. .line 90
  58. :goto_0
  59. return-void
  60. .line 71
  61. :cond_0
  62. const/4 v2, 0x1
  63. iput-boolean v2, p0, Landroid/support/v4/os/CancellationSignal;->mIsCanceled:Z
  64. .line 72
  65. const/4 v2, 0x1
  66. iput-boolean v2, p0, Landroid/support/v4/os/CancellationSignal;->mCancelInProgress:Z
  67. .line 73
  68. iget-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mOnCancelListener:Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  69. .line 74
  70. .local v0, "listener":Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  71. iget-object v1, p0, Landroid/support/v4/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
  72. .line 75
  73. .local v1, "obj":Ljava/lang/Object;
  74. monitor-exit p0
  75. :try_end_0
  76. .catchall {:try_start_0 .. :try_end_0} :catchall_1
  77. .line 78
  78. if-eqz v0, :cond_1
  79. .line 79
  80. :try_start_1
  81. invoke-interface {v0}, Landroid/support/v4/os/CancellationSignal$OnCancelListener;->onCancel()V
  82. .line 81
  83. :cond_1
  84. if-eqz v1, :cond_2
  85. .line 82
  86. invoke-static {v1}, Landroid/support/v4/os/CancellationSignalCompatJellybean;->cancel(Ljava/lang/Object;)V
  87. :try_end_1
  88. .catchall {:try_start_1 .. :try_end_1} :catchall_2
  89. .line 85
  90. :cond_2
  91. monitor-enter p0
  92. .line 86
  93. const/4 v2, 0x0
  94. :try_start_2
  95. iput-boolean v2, p0, Landroid/support/v4/os/CancellationSignal;->mCancelInProgress:Z
  96. .line 87
  97. invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
  98. .line 88
  99. monitor-exit p0
  100. goto :goto_0
  101. :catchall_0
  102. move-exception v2
  103. monitor-exit p0
  104. :try_end_2
  105. .catchall {:try_start_2 .. :try_end_2} :catchall_0
  106. throw v2
  107. .line 75
  108. .end local v0 # "listener":Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  109. .end local v1 # "obj":Ljava/lang/Object;
  110. :catchall_1
  111. move-exception v2
  112. :try_start_3
  113. monitor-exit p0
  114. :try_end_3
  115. .catchall {:try_start_3 .. :try_end_3} :catchall_1
  116. throw v2
  117. .line 85
  118. .restart local v0 # "listener":Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  119. .restart local v1 # "obj":Ljava/lang/Object;
  120. :catchall_2
  121. move-exception v2
  122. monitor-enter p0
  123. .line 86
  124. const/4 v3, 0x0
  125. :try_start_4
  126. iput-boolean v3, p0, Landroid/support/v4/os/CancellationSignal;->mCancelInProgress:Z
  127. .line 87
  128. invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
  129. .line 88
  130. monitor-exit p0
  131. :try_end_4
  132. .catchall {:try_start_4 .. :try_end_4} :catchall_3
  133. throw v2
  134. :catchall_3
  135. move-exception v2
  136. :try_start_5
  137. monitor-exit p0
  138. :try_end_5
  139. .catchall {:try_start_5 .. :try_end_5} :catchall_3
  140. throw v2
  141. .end method
  142. .method public getCancellationSignalObject()Ljava/lang/Object;
  143. .locals 2
  144. .prologue
  145. .line 135
  146. sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
  147. const/16 v1, 0x10
  148. if-ge v0, v1, :cond_0
  149. .line 136
  150. const/4 v0, 0x0
  151. .line 145
  152. :goto_0
  153. return-object v0
  154. .line 138
  155. :cond_0
  156. monitor-enter p0
  157. .line 139
  158. :try_start_0
  159. iget-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
  160. if-nez v0, :cond_1
  161. .line 140
  162. invoke-static {}, Landroid/support/v4/os/CancellationSignalCompatJellybean;->create()Ljava/lang/Object;
  163. move-result-object v0
  164. iput-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
  165. .line 141
  166. iget-boolean v0, p0, Landroid/support/v4/os/CancellationSignal;->mIsCanceled:Z
  167. if-eqz v0, :cond_1
  168. .line 142
  169. iget-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
  170. invoke-static {v0}, Landroid/support/v4/os/CancellationSignalCompatJellybean;->cancel(Ljava/lang/Object;)V
  171. .line 145
  172. :cond_1
  173. iget-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mCancellationSignalObj:Ljava/lang/Object;
  174. monitor-exit p0
  175. goto :goto_0
  176. .line 146
  177. :catchall_0
  178. move-exception v0
  179. monitor-exit p0
  180. :try_end_0
  181. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  182. throw v0
  183. .end method
  184. .method public isCanceled()Z
  185. .locals 1
  186. .prologue
  187. .line 44
  188. monitor-enter p0
  189. .line 45
  190. :try_start_0
  191. iget-boolean v0, p0, Landroid/support/v4/os/CancellationSignal;->mIsCanceled:Z
  192. monitor-exit p0
  193. return v0
  194. .line 46
  195. :catchall_0
  196. move-exception v0
  197. monitor-exit p0
  198. :try_end_0
  199. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  200. throw v0
  201. .end method
  202. .method public setOnCancelListener(Landroid/support/v4/os/CancellationSignal$OnCancelListener;)V
  203. .locals 1
  204. .param p1, "listener" # Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  205. .prologue
  206. .line 109
  207. monitor-enter p0
  208. .line 110
  209. :try_start_0
  210. invoke-direct {p0}, Landroid/support/v4/os/CancellationSignal;->waitForCancelFinishedLocked()V
  211. .line 112
  212. iget-object v0, p0, Landroid/support/v4/os/CancellationSignal;->mOnCancelListener:Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  213. if-ne v0, p1, :cond_0
  214. .line 113
  215. monitor-exit p0
  216. .line 121
  217. :goto_0
  218. return-void
  219. .line 115
  220. :cond_0
  221. iput-object p1, p0, Landroid/support/v4/os/CancellationSignal;->mOnCancelListener:Landroid/support/v4/os/CancellationSignal$OnCancelListener;
  222. .line 116
  223. iget-boolean v0, p0, Landroid/support/v4/os/CancellationSignal;->mIsCanceled:Z
  224. if-eqz v0, :cond_1
  225. if-nez p1, :cond_2
  226. .line 117
  227. :cond_1
  228. monitor-exit p0
  229. goto :goto_0
  230. .line 119
  231. :catchall_0
  232. move-exception v0
  233. monitor-exit p0
  234. :try_end_0
  235. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  236. throw v0
  237. :cond_2
  238. :try_start_1
  239. monitor-exit p0
  240. :try_end_1
  241. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  242. .line 120
  243. invoke-interface {p1}, Landroid/support/v4/os/CancellationSignal$OnCancelListener;->onCancel()V
  244. goto :goto_0
  245. .end method
  246. .method public throwIfCanceled()V
  247. .locals 1
  248. .prologue
  249. .line 55
  250. invoke-virtual {p0}, Landroid/support/v4/os/CancellationSignal;->isCanceled()Z
  251. move-result v0
  252. if-eqz v0, :cond_0
  253. .line 56
  254. new-instance v0, Landroid/support/v4/os/OperationCanceledException;
  255. invoke-direct {v0}, Landroid/support/v4/os/OperationCanceledException;-><init>()V
  256. throw v0
  257. .line 58
  258. :cond_0
  259. return-void
  260. .end method