Okio$4.smali 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. .class final Lokio/Okio$4;
  2. .super Lokio/AsyncTimeout;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingMethod;
  6. value = Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x0
  10. name = null
  11. .end annotation
  12. # instance fields
  13. .field final synthetic val$socket:Ljava/net/Socket;
  14. # direct methods
  15. .method constructor <init>(Ljava/net/Socket;)V
  16. .locals 0
  17. iput-object p1, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
  18. invoke-direct {p0}, Lokio/AsyncTimeout;-><init>()V
  19. return-void
  20. .end method
  21. # virtual methods
  22. .method protected newTimeoutException(Ljava/io/IOException;)Ljava/io/IOException;
  23. .locals 2
  24. new-instance v0, Ljava/net/SocketTimeoutException;
  25. const-string v1, "timeout"
  26. invoke-direct {v0, v1}, Ljava/net/SocketTimeoutException;-><init>(Ljava/lang/String;)V
  27. if-eqz p1, :cond_0
  28. invoke-virtual {v0, p1}, Ljava/io/InterruptedIOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
  29. :cond_0
  30. return-object v0
  31. .end method
  32. .method protected timedOut()V
  33. .locals 5
  34. const-string v0, "Failed to close timed out socket "
  35. :try_start_0
  36. iget-object v1, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
  37. invoke-virtual {v1}, Ljava/net/Socket;->close()V
  38. :try_end_0
  39. .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
  40. .catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_0
  41. goto :goto_1
  42. :catch_0
  43. move-exception v1
  44. invoke-static {v1}, Lokio/Okio;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
  45. move-result v2
  46. if-eqz v2, :cond_0
  47. sget-object v2, Lokio/Okio;->logger:Ljava/util/logging/Logger;
  48. sget-object v3, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
  49. new-instance v4, Ljava/lang/StringBuilder;
  50. invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
  51. goto :goto_0
  52. :cond_0
  53. throw v1
  54. :catch_1
  55. move-exception v1
  56. sget-object v2, Lokio/Okio;->logger:Ljava/util/logging/Logger;
  57. sget-object v3, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
  58. new-instance v4, Ljava/lang/StringBuilder;
  59. invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
  60. :goto_0
  61. invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  62. iget-object v0, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
  63. invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  64. invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  65. move-result-object v0
  66. invoke-virtual {v2, v3, v0, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
  67. :goto_1
  68. return-void
  69. .end method