.class final Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;
.super Ljava/lang/Thread;
.source "Downloader.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x10
    name = "UpdateThread"
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;


# direct methods
.method constructor <init>(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)V
    .locals 0

    .line 321
    iput-object p1, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 5

    .line 325
    iget-object v0, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v0}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->c(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Ljava/util/concurrent/atomic/AtomicInteger;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v0

    :goto_0
    const/16 v1, 0x64

    if-gt v0, v1, :cond_0

    .line 327
    iget-object v2, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v2}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->d(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Landroid/app/Notification;

    move-result-object v2

    iget-object v2, v2, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;

    sget v3, Lcom/moji/mjappstore/R$id;->rc_progress_bar:I

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v1, v0, v4}, Landroid/widget/RemoteViews;->setProgressBar(IIIZ)V

    .line 328
    iget-object v1, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v1}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->d(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Landroid/app/Notification;

    move-result-object v1

    iget-object v1, v1, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;

    sget v2, Lcom/moji/mjappstore/R$id;->rc_progress_text:I

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, "%"

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v2, v0}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

    .line 329
    iget-object v0, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v0}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->f(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Landroid/app/NotificationManager;

    move-result-object v0

    iget-object v1, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v1}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->e(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)I

    move-result v1

    iget-object v2, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v2}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->d(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Landroid/app/Notification;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    const-wide/16 v0, 0x1f4

    .line 331
    :try_start_0
    invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 340
    iget-object v0, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v0}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->c(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Ljava/util/concurrent/atomic/AtomicInteger;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 333
    invoke-static {}, Lcom/moji/mjappstore/engine/Downloader;->b()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 334
    sget-object v0, Lcom/moji/mjappstore/engine/AppUtil;->a:Ljava/util/HashMap;

    iget-object v1, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v1}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->a(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 336
    iget-object v0, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {}, Lcom/moji/mjappstore/engine/Downloader;->a()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v2}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->a(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v1, v2}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->a(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;Landroid/content/Context;Ljava/lang/String;)V

    .line 337
    iget-object v0, p0, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask$UpdateThread;->a:Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;

    invoke-static {v0}, Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;->g(Lcom/moji/mjappstore/engine/Downloader$DownloadAsyncTask;)V

    :cond_0
    return-void
.end method
