280 lines
7.5 KiB
Smali
280 lines
7.5 KiB
Smali
.class public Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;
|
|
.super Lcom/moji/tool/thread/task/MJAsyncTask;
|
|
.source "PostCardCompressAsyncTask.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/moji/tool/thread/task/MJAsyncTask<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Integer;",
|
|
"Landroid/graphics/Bitmap;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private a:Landroid/content/ContentResolver;
|
|
|
|
.field private b:Lcom/moji/camera/model/Image;
|
|
|
|
.field private c:Lcom/moji/crop/CropView;
|
|
|
|
.field private d:I
|
|
|
|
.field private e:Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/ContentResolver;Lcom/moji/camera/model/Image;Lcom/moji/crop/CropView;I)V
|
|
.locals 1
|
|
|
|
.line 37
|
|
sget-object v0, Lcom/moji/tool/thread/ThreadPriority;->HIGH:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
invoke-direct {p0, v0}, Lcom/moji/tool/thread/task/MJAsyncTask;-><init>(Lcom/moji/tool/thread/ThreadPriority;)V
|
|
|
|
.line 38
|
|
iput-object p1, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->a:Landroid/content/ContentResolver;
|
|
|
|
.line 39
|
|
iput-object p2, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->b:Lcom/moji/camera/model/Image;
|
|
|
|
.line 40
|
|
iput-object p3, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->c:Lcom/moji/crop/CropView;
|
|
|
|
.line 41
|
|
iput p4, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->d:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;)Lcom/moji/crop/CropView;
|
|
.locals 0
|
|
|
|
.line 27
|
|
iget-object p0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->c:Lcom/moji/crop/CropView;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic b(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;)Lcom/moji/camera/model/Image;
|
|
.locals 0
|
|
|
|
.line 27
|
|
iget-object p0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->b:Lcom/moji/camera/model/Image;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic c(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;)Landroid/content/ContentResolver;
|
|
.locals 0
|
|
|
|
.line 27
|
|
iget-object p0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->a:Landroid/content/ContentResolver;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic d(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;)Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;
|
|
.locals 0
|
|
|
|
.line 27
|
|
iget-object p0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->e:Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected varargs a([Ljava/lang/String;)Landroid/graphics/Bitmap;
|
|
.locals 4
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 49
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->a:Landroid/content/ContentResolver;
|
|
|
|
iget-object v1, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->b:Lcom/moji/camera/model/Image;
|
|
|
|
iget-object v1, v1, Lcom/moji/camera/model/Image;->contentUri:Landroid/net/Uri;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/ContentResolver;->openInputStream(Landroid/net/Uri;)Ljava/io/InputStream;
|
|
|
|
move-result-object v0
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 50
|
|
:try_start_1
|
|
invoke-static {v0, p1, p1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object v1
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
|
|
.catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
.line 56
|
|
invoke-static {v0}, Lcom/moji/crop/CropUtil;->a(Ljava/io/Closeable;)V
|
|
|
|
move-object p1, v1
|
|
|
|
goto :goto_3
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception v1
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
move-object v3, v0
|
|
|
|
move-object v0, p1
|
|
|
|
move-object p1, v3
|
|
|
|
goto :goto_4
|
|
|
|
:catch_2
|
|
move-exception v1
|
|
|
|
move-object v0, p1
|
|
|
|
:goto_0
|
|
:try_start_2
|
|
const-string v2, "CompressAsyncTask"
|
|
|
|
.line 54
|
|
invoke-virtual {v1}, Ljava/lang/OutOfMemoryError;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_2
|
|
|
|
:catch_3
|
|
move-exception v1
|
|
|
|
move-object v0, p1
|
|
|
|
:goto_1
|
|
const-string v2, "CompressAsyncTask"
|
|
|
|
.line 52
|
|
invoke-virtual {v1}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
.line 56
|
|
:goto_2
|
|
invoke-static {v0}, Lcom/moji/crop/CropUtil;->a(Ljava/io/Closeable;)V
|
|
|
|
:goto_3
|
|
return-object p1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
:goto_4
|
|
invoke-static {v0}, Lcom/moji/crop/CropUtil;->a(Ljava/io/Closeable;)V
|
|
|
|
.line 57
|
|
throw p1
|
|
.end method
|
|
|
|
.method protected bridge synthetic a([Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 0
|
|
|
|
.line 27
|
|
check-cast p1, [Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, p1}, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->a([Ljava/lang/String;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method protected a(Landroid/graphics/Bitmap;)V
|
|
.locals 3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 66
|
|
:cond_0
|
|
iget v0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->d:I
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget v0, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->d:I
|
|
|
|
div-int/2addr v0, v1
|
|
|
|
mul-int/lit8 v0, v0, 0x2
|
|
|
|
.line 67
|
|
:goto_0
|
|
iget-object v1, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->c:Lcom/moji/crop/CropView;
|
|
|
|
new-instance v2, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$1;
|
|
|
|
invoke-direct {v2, p0}, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$1;-><init>(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;)V
|
|
|
|
invoke-virtual {v1, p1, v0, v2}, Lcom/moji/crop/CropView;->a(Landroid/graphics/Bitmap;ILjava/lang/Runnable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;)V
|
|
.locals 0
|
|
|
|
.line 109
|
|
iput-object p1, p0, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->e:Lcom/moji/postcard/presenter/PostCardCompressAsyncTask$CompressAsyncTaskCallback;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected bridge synthetic a(Ljava/lang/Object;)V
|
|
.locals 0
|
|
|
|
.line 27
|
|
check-cast p1, Landroid/graphics/Bitmap;
|
|
|
|
invoke-virtual {p0, p1}, Lcom/moji/postcard/presenter/PostCardCompressAsyncTask;->a(Landroid/graphics/Bitmap;)V
|
|
|
|
return-void
|
|
.end method
|