granularity level: instruction
.class public Lcom/google/android/gms/common/data/BitmapTeleporter;
.super Lcom/google/android/gms/common/internal/safeparcel/AbstractSafeParcelable;
.source "com.google.android.gms:play-services-base@@18.0.1"
.implements Lcom/google/android/gms/common/internal/ReflectedParcelable;
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/os/Parcelable$Creator<",
"Lcom/google/android/gms/common/data/BitmapTeleporter;",
">;"
}
.end annotation
.end field
.field final zaa:I
.field zab:Landroid/os/ParcelFileDescriptor;
.field final zac:I
.field private zad:Landroid/graphics/Bitmap;
.field private zae:Z
.field private zaf:Ljava/io/File;
.method static constructor <clinit>()V
.locals 1
new-instance v0, Lcom/google/android/gms/common/data/zaa;
invoke-direct {v0}, Lcom/google/android/gms/common/data/zaa;-><init>()V
sput-object v0, Lcom/google/android/gms/common/data/BitmapTeleporter;->CREATOR:Landroid/os/Parcelable$Creator;
return-void
.end method
.method constructor <init>(ILandroid/os/ParcelFileDescriptor;I)V
.locals 0
invoke-direct {p0}, Lcom/google/android/gms/common/internal/safeparcel/AbstractSafeParcelable;-><init>()V
iput p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa:I
iput-object p2, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
iput p3, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zac:I
const/4 p1, 0x0
iput-object p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zad:Landroid/graphics/Bitmap;
const/4 p1, 0x0
iput-boolean p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zae:Z
return-void
.end method
.method public constructor <init>(Landroid/graphics/Bitmap;)V
.locals 2
invoke-direct {p0}, Lcom/google/android/gms/common/internal/safeparcel/AbstractSafeParcelable;-><init>()V
const/4 v0, 0x1
iput v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa:I
const/4 v1, 0x0
iput-object v1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
const/4 v1, 0x0
iput v1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zac:I
iput-object p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zad:Landroid/graphics/Bitmap;
iput-boolean v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zae:Z
return-void
.end method
.method private static final zaa(Ljava/io/Closeable;)V
.locals 2
:try_start_0
invoke-interface {p0}, Ljava/io/Closeable;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception p0
const-string v0, "BitmapTeleporter"
const-string v1, "Could not close stream"
invoke-static {v0, v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-void
.end method
.method public get()Landroid/graphics/Bitmap;
.locals 5
iget-boolean v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zae:Z
if-nez v0, :cond_0
new-instance v0, Ljava/io/DataInputStream;
new-instance v1, Landroid/os/ParcelFileDescriptor$AutoCloseInputStream;
iget-object v2, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
invoke-static {v2}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/os/ParcelFileDescriptor;
invoke-direct {v1, v2}, Landroid/os/ParcelFileDescriptor$AutoCloseInputStream;-><init>(Landroid/os/ParcelFileDescriptor;)V
invoke-direct {v0, v1}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V
:try_start_0
invoke-virtual {v0}, Ljava/io/DataInputStream;->readInt()I
move-result v1
new-array v1, v1, [B
invoke-virtual {v0}, Ljava/io/DataInputStream;->readInt()I
move-result v2
invoke-virtual {v0}, Ljava/io/DataInputStream;->readInt()I
move-result v3
invoke-virtual {v0}, Ljava/io/DataInputStream;->readUTF()Ljava/lang/String;
move-result-object v4
invoke-static {v4}, Landroid/graphics/Bitmap$Config;->valueOf(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;
move-result-object v4
invoke-virtual {v0, v1}, Ljava/io/DataInputStream;->read([B)I
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
invoke-static {v0}, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa(Ljava/io/Closeable;)V
invoke-static {v1}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
move-result-object v0
invoke-static {v2, v3, v4}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/graphics/Bitmap;->copyPixelsFromBuffer(Ljava/nio/Buffer;)V
iput-object v1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zad:Landroid/graphics/Bitmap;
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zae:Z
goto :goto_1
:catchall_0
move-exception v1
goto :goto_0
:catch_0
move-exception v1
:try_start_1
new-instance v2, Ljava/lang/IllegalStateException;
const-string v3, "Could not read from parcel file descriptor"
invoke-direct {v2, v3, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v2
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_0
invoke-static {v0}, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa(Ljava/io/Closeable;)V
throw v1
:goto_1
:cond_0
iget-object v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zad:Landroid/graphics/Bitmap;
return-object v0
.end method
.method public release()V
.locals 3
iget-boolean v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zae:Z
if-nez v0, :cond_0
:try_start_0
iget-object v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/ParcelFileDescriptor;
invoke-virtual {v0}, Landroid/os/ParcelFileDescriptor;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception v0
const-string v1, "BitmapTeleporter"
const-string v2, "Could not close PFD"
invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:cond_0
return-void
.end method
.method public setTempDir(Ljava/io/File;)V
.locals 1
if-eqz p1, :cond_0
iput-object p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaf:Ljava/io/File;
return-void
:cond_0
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "Cannot set null temp directory"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final writeToParcel(Landroid/os/Parcel;I)V
.locals 6
iget-object v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
if-nez v0, :cond_1
iget-object v0, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zad:Landroid/graphics/Bitmap;
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/graphics/Bitmap;
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getRowBytes()I
move-result v1
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
mul-int v1, v1, v2
invoke-static {v1}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/Bitmap;->copyPixelsToBuffer(Ljava/nio/Buffer;)V
invoke-virtual {v1}, Ljava/nio/ByteBuffer;->array()[B
move-result-object v1
new-instance v2, Ljava/io/BufferedOutputStream;
iget-object v3, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaf:Ljava/io/File;
if-eqz v3, :cond_0
:try_start_0
const-string v4, "teleporter"
const-string v5, ".tmp"
invoke-static {v4, v5, v3}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
move-result-object v3
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
:try_start_1
new-instance v4, Ljava/io/FileOutputStream;
invoke-direct {v4, v3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
const/high16 v5, 0x10000000
invoke-static {v3, v5}, Landroid/os/ParcelFileDescriptor;->open(Ljava/io/File;I)Landroid/os/ParcelFileDescriptor;
move-result-object v5
iput-object v5, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
:try_end_1
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_1
invoke-virtual {v3}, Ljava/io/File;->delete()Z
invoke-direct {v2, v4}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
new-instance v3, Ljava/io/DataOutputStream;
invoke-direct {v3, v2}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V
:try_start_2
array-length v2, v1
invoke-virtual {v3, v2}, Ljava/io/DataOutputStream;->writeInt(I)V
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I
move-result v2
invoke-virtual {v3, v2}, Ljava/io/DataOutputStream;->writeInt(I)V
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
invoke-virtual {v3, v2}, Ljava/io/DataOutputStream;->writeInt(I)V
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;
move-result-object v0
invoke-virtual {v0}, Landroid/graphics/Bitmap$Config;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Ljava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V
invoke-virtual {v3, v1}, Ljava/io/DataOutputStream;->write([B)V
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
.catchall {:try_start_2 .. :try_end_2} :catchall_0
invoke-static {v3}, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa(Ljava/io/Closeable;)V
goto :goto_1
:catchall_0
move-exception p1
goto :goto_0
:catch_0
move-exception p1
:try_start_3
new-instance p2, Ljava/lang/IllegalStateException;
const-string v0, "Could not write into unlinked file"
invoke-direct {p2, v0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p2
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:goto_0
invoke-static {v3}, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa(Ljava/io/Closeable;)V
throw p1
:catch_1
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Temporary file is somehow already deleted"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:catch_2
move-exception p1
new-instance p2, Ljava/lang/IllegalStateException;
const-string v0, "Could not create temporary file"
invoke-direct {p2, v0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p2
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "setTempDir() must be called before writing this object to a parcel"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:goto_1
:cond_1
invoke-static {p1}, Lcom/google/android/gms/common/internal/safeparcel/SafeParcelWriter;->beginObjectHeader(Landroid/os/Parcel;)I
move-result v0
iget v1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zaa:I
const/4 v2, 0x1
invoke-static {p1, v2, v1}, Lcom/google/android/gms/common/internal/safeparcel/SafeParcelWriter;->writeInt(Landroid/os/Parcel;II)V
const/4 v1, 0x2
iget-object v3, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
or-int/2addr p2, v2
const/4 v2, 0x0
invoke-static {p1, v1, v3, p2, v2}, Lcom/google/android/gms/common/internal/safeparcel/SafeParcelWriter;->writeParcelable(Landroid/os/Parcel;ILandroid/os/Parcelable;IZ)V
const/4 p2, 0x3
iget v1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zac:I
invoke-static {p1, p2, v1}, Lcom/google/android/gms/common/internal/safeparcel/SafeParcelWriter;->writeInt(Landroid/os/Parcel;II)V
invoke-static {p1, v0}, Lcom/google/android/gms/common/internal/safeparcel/SafeParcelWriter;->finishObjectHeader(Landroid/os/Parcel;I)V
const/4 p1, 0x0
iput-object p1, p0, Lcom/google/android/gms/common/data/BitmapTeleporter;->zab:Landroid/os/ParcelFileDescriptor;
return-void
.end method