granularity level: instruction
.class public final Lh1/s;
.super Ljava/lang/Object;
.source "SourceFile"
.implements Ljava/io/Closeable;
.field public final a:Ljava/net/URL;
.field public volatile b:Ljava/util/concurrent/Future;
.field public c:Lo0/o;
.method public constructor <init>(Ljava/net/URL;)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lh1/s;->a:Ljava/net/URL;
return-void
.end method
.method public final a()Landroid/graphics/Bitmap;
.locals 5
const-string v0, "FirebaseMessaging"
const/4 v1, 0x4
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v1
if-eqz v1, :cond_0
const-string v1, "Starting download of: "
invoke-static {v1}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Lh1/s;->a:Ljava/net/URL;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
iget-object v1, p0, Lh1/s;->a:Ljava/net/URL;
invoke-virtual {v1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
move-result-object v1
invoke-virtual {v1}, Ljava/net/URLConnection;->getContentLength()I
move-result v2
const/high16 v3, 0x100000
if-gt v2, v3, :cond_7
invoke-virtual {v1}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;
move-result-object v1
:try_start_0
new-instance v2, Lh1/d;
invoke-direct {v2, v1}, Lh1/d;-><init>(Ljava/io/InputStream;)V
invoke-static {v2}, Lp0/a;->E(Lh1/d;)[B
move-result-object v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v1, :cond_1
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:cond_1
const/4 v1, 0x2
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v1
if-eqz v1, :cond_2
const-string v1, "Downloaded "
invoke-static {v1}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
array-length v4, v2
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v4, " bytes from "
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v4, p0, Lh1/s;->a:Ljava/net/URL;
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_2
array-length v1, v2
if-gt v1, v3, :cond_5
const/4 v1, 0x0
array-length v3, v2
invoke-static {v2, v1, v3}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;
move-result-object v1
if-eqz v1, :cond_4
const/4 v2, 0x3
invoke-static {v0, v2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v2
if-eqz v2, :cond_3
const-string v2, "Successfully downloaded image: "
invoke-static {v2}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p0, Lh1/s;->a:Ljava/net/URL;
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
return-object v1
:cond_4
new-instance v0, Ljava/io/IOException;
const-string v1, "Failed to decode image: "
invoke-static {v1}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Lh1/s;->a:Ljava/net/URL;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_5
new-instance v0, Ljava/io/IOException;
const-string v1, "Image exceeds max size of 1048576"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:catchall_0
move-exception v0
if-eqz v1, :cond_6
:try_start_1
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_0
:catchall_1
move-exception v1
invoke-virtual {v0, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_0
:cond_6
throw v0
:cond_7
new-instance v0, Ljava/io/IOException;
const-string v1, "Content-Length exceeds max size of 1048576"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final close()V
.locals 2
iget-object v0, p0, Lh1/s;->b:Ljava/util/concurrent/Future;
const/4 v1, 0x1
invoke-interface {v0, v1}, Ljava/util/concurrent/Future;->cancel(Z)Z
return-void
.end method