RealCall$AsyncCall.smali 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. .class final Lokhttp3/RealCall$AsyncCall;
  2. .super Lokhttp3/internal/NamedRunnable;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/RealCall;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x10
  10. name = "AsyncCall"
  11. .end annotation
  12. # instance fields
  13. .field private final responseCallback:Lokhttp3/Callback;
  14. .field final synthetic this$0:Lokhttp3/RealCall;
  15. # direct methods
  16. .method constructor <init>(Lokhttp3/RealCall;Lokhttp3/Callback;)V
  17. .locals 2
  18. iput-object p1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  19. const/4 v0, 0x1
  20. new-array v0, v0, [Ljava/lang/Object;
  21. invoke-virtual {p1}, Lokhttp3/RealCall;->redactedUrl()Ljava/lang/String;
  22. move-result-object p1
  23. const/4 v1, 0x0
  24. aput-object p1, v0, v1
  25. const-string p1, "OkHttp %s"
  26. invoke-direct {p0, p1, v0}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
  27. iput-object p2, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;
  28. return-void
  29. .end method
  30. # virtual methods
  31. .method protected execute()V
  32. .locals 5
  33. const/4 v0, 0x1
  34. const/4 v1, 0x0
  35. :try_start_0
  36. iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  37. invoke-virtual {v2}, Lokhttp3/RealCall;->getResponseWithInterceptorChain()Lokhttp3/Response;
  38. move-result-object v2
  39. iget-object v3, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  40. iget-object v3, v3, Lokhttp3/RealCall;->retryAndFollowUpInterceptor:Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
  41. invoke-virtual {v3}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->isCanceled()Z
  42. move-result v1
  43. :try_end_0
  44. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
  45. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  46. if-eqz v1, :cond_0
  47. :try_start_1
  48. iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;
  49. iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  50. new-instance v3, Ljava/io/IOException;
  51. const-string v4, "Canceled"
  52. invoke-direct {v3, v4}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  53. invoke-interface {v1, v2, v3}, Lokhttp3/Callback;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
  54. goto :goto_0
  55. :cond_0
  56. iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;
  57. iget-object v3, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  58. invoke-interface {v1, v3, v2}, Lokhttp3/Callback;->onResponse(Lokhttp3/Call;Lokhttp3/Response;)V
  59. :try_end_1
  60. .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
  61. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  62. :goto_0
  63. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  64. iget-object v0, v0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  65. invoke-virtual {v0}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  66. move-result-object v0
  67. invoke-virtual {v0, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V
  68. goto :goto_2
  69. :catch_0
  70. move-exception v1
  71. goto :goto_1
  72. :catchall_0
  73. move-exception v0
  74. goto :goto_3
  75. :catch_1
  76. move-exception v0
  77. move-object v1, v0
  78. const/4 v0, 0x0
  79. :goto_1
  80. if-eqz v0, :cond_1
  81. :try_start_2
  82. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  83. move-result-object v0
  84. const/4 v2, 0x4
  85. new-instance v3, Ljava/lang/StringBuilder;
  86. invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
  87. const-string v4, "Callback failure for "
  88. invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  89. iget-object v4, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  90. invoke-virtual {v4}, Lokhttp3/RealCall;->toLoggableString()Ljava/lang/String;
  91. move-result-object v4
  92. invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  93. invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  94. move-result-object v3
  95. invoke-virtual {v0, v2, v3, v1}, Lokhttp3/internal/platform/Platform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V
  96. goto :goto_0
  97. :cond_1
  98. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  99. invoke-static {v0}, Lokhttp3/RealCall;->access$000(Lokhttp3/RealCall;)Lokhttp3/EventListener;
  100. move-result-object v0
  101. iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  102. invoke-virtual {v0, v2, v1}, Lokhttp3/EventListener;->callFailed(Lokhttp3/Call;Ljava/io/IOException;)V
  103. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;
  104. iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  105. invoke-interface {v0, v2, v1}, Lokhttp3/Callback;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
  106. :try_end_2
  107. .catchall {:try_start_2 .. :try_end_2} :catchall_0
  108. goto :goto_0
  109. :goto_2
  110. return-void
  111. :goto_3
  112. iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  113. iget-object v1, v1, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;
  114. invoke-virtual {v1}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;
  115. move-result-object v1
  116. invoke-virtual {v1, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V
  117. goto :goto_5
  118. :goto_4
  119. throw v0
  120. :goto_5
  121. goto :goto_4
  122. .end method
  123. .method get()Lokhttp3/RealCall;
  124. .locals 1
  125. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  126. return-object v0
  127. .end method
  128. .method host()Ljava/lang/String;
  129. .locals 1
  130. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  131. iget-object v0, v0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  132. invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
  133. move-result-object v0
  134. invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
  135. move-result-object v0
  136. return-object v0
  137. .end method
  138. .method request()Lokhttp3/Request;
  139. .locals 1
  140. iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;
  141. iget-object v0, v0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;
  142. return-object v0
  143. .end method