.class public Lcom/moji/mjweather/assshop/task/LoadSettingsTask;
.super Lcom/moji/tool/thread/task/MJAsyncTask;
.source "LoadSettingsTask.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/assshop/task/LoadSettingsTask$QueryListener;,
        Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/tool/thread/task/MJAsyncTask<",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        "Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;",
        ">;"
    }
.end annotation


# instance fields
.field private a:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference<",
            "Lcom/moji/mjweather/assshop/task/LoadSettingsTask$QueryListener;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/assshop/task/LoadSettingsTask$QueryListener;)V
    .locals 1

    .line 37
    sget-object v0, Lcom/moji/tool/thread/ThreadPriority;->NORMAL:Lcom/moji/tool/thread/ThreadPriority;

    invoke-direct {p0, v0}, Lcom/moji/tool/thread/task/MJAsyncTask;-><init>(Lcom/moji/tool/thread/ThreadPriority;)V

    .line 38
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/moji/mjweather/assshop/task/LoadSettingsTask;->a:Ljava/lang/ref/WeakReference;

    return-void
.end method


# virtual methods
.method protected varargs a([Ljava/lang/Void;)Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;
    .locals 6

    .line 44
    new-instance p1, Lcom/moji/mjweather/assshop/db/AvatarDBManager;

    invoke-direct {p1}, Lcom/moji/mjweather/assshop/db/AvatarDBManager;-><init>()V

    .line 45
    new-instance v0, Lcom/moji/preferences/DefaultPrefer;

    invoke-direct {v0}, Lcom/moji/preferences/DefaultPrefer;-><init>()V

    invoke-virtual {v0}, Lcom/moji/preferences/DefaultPrefer;->e()I

    move-result v0

    invoke-virtual {p1, v0}, Lcom/moji/mjweather/assshop/db/AvatarDBManager;->b(I)Lcom/moji/mjad/avatar/data/AvatarInfo;

    move-result-object p1

    if-nez p1, :cond_1

    .line 49
    new-instance p1, Lcom/moji/preferences/DefaultPrefer;

    invoke-direct {p1}, Lcom/moji/preferences/DefaultPrefer;-><init>()V

    invoke-virtual {p1}, Lcom/moji/preferences/DefaultPrefer;->e()I

    move-result p1

    const/4 v0, 0x2

    if-ne p1, v0, :cond_0

    .line 50
    sget-object p1, Lcom/moji/mjweather/MJApplication;->sContext:Landroid/content/Context;

    const v0, 0x7f0e0110

    invoke-virtual {p1, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_0

    .line 52
    :cond_0
    sget-object p1, Lcom/moji/mjweather/MJApplication;->sContext:Landroid/content/Context;

    const v0, 0x7f0e0114

    invoke-virtual {p1, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_0

    .line 55
    :cond_1
    iget-object p1, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->name:Ljava/lang/String;

    .line 57
    :goto_0
    new-instance v0, Lcom/moji/mjad/common/db/AdSuitAvatrDBManager;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/moji/mjad/common/db/AdSuitAvatrDBManager;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0}, Lcom/moji/mjad/common/db/AdSuitAvatrDBManager;->a()Lcom/moji/mjad/avatar/data/AvatarSuitAdInfo;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 58
    iget-object v1, v0, Lcom/moji/mjad/avatar/data/AvatarSuitAdInfo;->avatarInfo:Lcom/moji/mjad/avatar/data/AvatarInfo;

    if-eqz v1, :cond_2

    invoke-static {}, Lcom/moji/mjweather/weather/avatar/AvatarImageUtil;->d()I

    move-result v1

    const/4 v2, -0x1

    if-eq v1, v2, :cond_2

    .line 59
    iget-object p1, v0, Lcom/moji/mjad/avatar/data/AvatarSuitAdInfo;->avatarInfo:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget-object p1, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->avatarName:Ljava/lang/String;

    :cond_2
    const-string v0, ""

    .line 64
    sget-object v1, Lcom/moji/mjweather/MJApplication;->sContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/moji/alarm/clock/AlarmClockManager;->b(Landroid/content/Context;)Lcom/moji/alarm/clock/AlarmClockData;

    move-result-object v1

    if-eqz v1, :cond_3

    .line 66
    invoke-static {v1}, Lcom/moji/alarm/clock/AlarmClockManager;->a(Lcom/moji/alarm/clock/AlarmClockData;)J

    move-result-wide v2

    .line 67
    iget-boolean v1, v1, Lcom/moji/alarm/clock/AlarmClockData;->enabled:Z

    if-eqz v1, :cond_3

    .line 68
    sget-object v0, Lcom/moji/mjweather/MJApplication;->sContext:Landroid/content/Context;

    invoke-static {v0, v2, v3}, Lcom/moji/alarm/clock/AlarmClockManager;->a(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v0

    .line 72
    :cond_3
    invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;

    move-result-object v1

    invoke-virtual {v1}, Lcom/moji/preferences/units/SettingCenter;->c()Lcom/moji/preferences/units/VOICE_LANGUAGE;

    move-result-object v1

    invoke-virtual {v1}, Lcom/moji/preferences/units/VOICE_LANGUAGE;->name()Ljava/lang/String;

    move-result-object v1

    .line 74
    :try_start_0
    invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;

    move-result-object v2

    invoke-virtual {v2}, Lcom/moji/preferences/units/SettingCenter;->c()Lcom/moji/preferences/units/VOICE_LANGUAGE;

    move-result-object v2

    .line 75
    new-instance v3, Lcom/moji/preferences/ProcessPrefer;

    invoke-direct {v3}, Lcom/moji/preferences/ProcessPrefer;-><init>()V

    sget-object v4, Lcom/moji/preferences/ProcessPrefer$KeyConstant;->KEY_SETTING_VOICE_LANGUAGE:Lcom/moji/preferences/ProcessPrefer$KeyConstant;

    const-string v5, "DEFAULT_VOICE"

    invoke-virtual {v3, v4, v5}, Lcom/moji/preferences/ProcessPrefer;->a(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "DEFAULT_VOICE"

    .line 76
    invoke-virtual {v4, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_4

    invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;

    move-result-object v3

    invoke-virtual {v3}, Lcom/moji/preferences/units/SettingCenter;->b()Lcom/moji/preferences/units/ELanguage;

    move-result-object v3

    sget-object v4, Lcom/moji/preferences/units/ELanguage;->CN:Lcom/moji/preferences/units/ELanguage;

    if-ne v3, v4, :cond_4

    .line 77
    sget-object v2, Lcom/moji/preferences/units/VOICE_LANGUAGE;->DEFAULT_VOICE:Lcom/moji/preferences/units/VOICE_LANGUAGE;

    .line 80
    :cond_4
    invoke-virtual {v2}, Lcom/moji/preferences/units/VOICE_LANGUAGE;->getDescId()I

    move-result v2

    .line 81
    invoke-static {v2}, Lcom/moji/tool/DeviceTool;->f(I)Ljava/lang/String;

    move-result-object v2
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-object v1, v2

    goto :goto_1

    :catch_0
    move-exception v2

    const-string v3, "LoadSettingsTask"

    .line 83
    invoke-static {v3, v2}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 86
    :goto_1
    new-instance v2, Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;

    invoke-direct {v2, p1, v0, v1}, Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    return-object v2
.end method

.method protected bridge synthetic a([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 0

    .line 32
    check-cast p1, [Ljava/lang/Void;

    invoke-virtual {p0, p1}, Lcom/moji/mjweather/assshop/task/LoadSettingsTask;->a([Ljava/lang/Void;)Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;

    move-result-object p1

    return-object p1
.end method

.method protected a(Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;)V
    .locals 1

    .line 91
    invoke-super {p0, p1}, Lcom/moji/tool/thread/task/MJAsyncTask;->a(Ljava/lang/Object;)V

    .line 92
    iget-object v0, p0, Lcom/moji/mjweather/assshop/task/LoadSettingsTask;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/mjweather/assshop/task/LoadSettingsTask$QueryListener;

    if-eqz v0, :cond_0

    .line 94
    invoke-interface {v0, p1}, Lcom/moji/mjweather/assshop/task/LoadSettingsTask$QueryListener;->a(Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;)V

    :cond_0
    return-void
.end method

.method protected bridge synthetic a(Ljava/lang/Object;)V
    .locals 0

    .line 32
    check-cast p1, Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;

    invoke-virtual {p0, p1}, Lcom/moji/mjweather/assshop/task/LoadSettingsTask;->a(Lcom/moji/mjweather/assshop/task/LoadSettingsTask$Settings;)V

    return-void
.end method
