.class public Lcom/moji/location/options/AmapOptionsParser;
.super Ljava/lang/Object;
.source "AmapOptionsParser.java"

# interfaces
.implements Lcom/moji/location/options/IOptionsParser;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lcom/moji/location/options/IOptionsParser<",
        "Lcom/amap/api/location/AMapLocationClientOption;",
        ">;"
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Lcom/moji/location/options/MJLocationOptions;)Lcom/amap/api/location/AMapLocationClientOption;
    .locals 9

    .line 18
    invoke-static {}, Lcom/moji/tool/preferences/CtaPrefer;->c()Lcom/moji/tool/preferences/CtaPrefer;

    move-result-object v0

    invoke-virtual {v0}, Lcom/moji/tool/preferences/CtaPrefer;->e()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 p1, 0x0

    return-object p1

    .line 22
    :cond_0
    new-instance v0, Lcom/amap/api/location/AMapLocationClientOption;

    invoke-direct {v0}, Lcom/amap/api/location/AMapLocationClientOption;-><init>()V

    if-eqz p1, :cond_7

    .line 25
    :try_start_0
    invoke-static {}, Lcom/moji/location/util/LocationUtil;->a()Z

    move-result v1

    .line 26
    iget-boolean v2, p1, Lcom/moji/location/options/MJLocationOptions;->i:Z

    const/4 v3, 0x1

    if-eqz v2, :cond_1

    invoke-static {}, Lcom/moji/tool/DeviceTool;->n()Z

    move-result v2

    if-eqz v2, :cond_1

    const/4 v2, 0x1

    goto :goto_0

    :cond_1
    const/4 v2, 0x0

    :goto_0
    if-nez v1, :cond_2

    .line 28
    sget-object v4, Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;->Battery_Saving:Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;

    invoke-virtual {v0, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setLocationMode(Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;)Lcom/amap/api/location/AMapLocationClientOption;

    goto :goto_1

    .line 30
    :cond_2
    sget-object v4, Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;->Device_Sensors:Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;

    invoke-virtual {v0, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setLocationMode(Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;)Lcom/amap/api/location/AMapLocationClientOption;

    .line 33
    :goto_1
    iget-boolean v4, p1, Lcom/moji/location/options/MJLocationOptions;->c:Z

    invoke-virtual {v0, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setNeedAddress(Z)Lcom/amap/api/location/AMapLocationClientOption;

    xor-int/lit8 v4, v2, 0x1

    .line 35
    invoke-virtual {v0, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setOnceLocation(Z)Lcom/amap/api/location/AMapLocationClientOption;

    .line 37
    iget-boolean v4, p1, Lcom/moji/location/options/MJLocationOptions;->d:Z

    invoke-virtual {v0, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setWifiActiveScan(Z)Lcom/amap/api/location/AMapLocationClientOption;

    if-nez v1, :cond_3

    .line 40
    iget-boolean v1, p1, Lcom/moji/location/options/MJLocationOptions;->e:Z

    invoke-virtual {v0, v1}, Lcom/amap/api/location/AMapLocationClientOption;->setMockEnable(Z)Lcom/amap/api/location/AMapLocationClientOption;

    goto :goto_2

    .line 42
    :cond_3
    invoke-virtual {v0, v3}, Lcom/amap/api/location/AMapLocationClientOption;->setMockEnable(Z)Lcom/amap/api/location/AMapLocationClientOption;

    :goto_2
    const-wide/16 v3, 0x0

    const-wide/16 v5, 0x7d0

    if-eqz v2, :cond_4

    goto :goto_3

    .line 44
    :cond_4
    iget-wide v7, p1, Lcom/moji/location/options/MJLocationOptions;->g:J

    cmp-long v1, v7, v3

    if-lez v1, :cond_5

    iget-wide v5, p1, Lcom/moji/location/options/MJLocationOptions;->g:J

    :cond_5
    :goto_3
    invoke-virtual {v0, v5, v6}, Lcom/amap/api/location/AMapLocationClientOption;->setInterval(J)Lcom/amap/api/location/AMapLocationClientOption;

    .line 45
    iget-wide v5, p1, Lcom/moji/location/options/MJLocationOptions;->f:J

    cmp-long v1, v5, v3

    if-lez v1, :cond_6

    iget-wide v3, p1, Lcom/moji/location/options/MJLocationOptions;->f:J

    goto :goto_4

    :cond_6
    const-wide/16 v3, 0x3a98

    :goto_4
    invoke-virtual {v0, v3, v4}, Lcom/amap/api/location/AMapLocationClientOption;->setHttpTimeOut(J)Lcom/amap/api/location/AMapLocationClientOption;

    .line 46
    iget-boolean p1, p1, Lcom/moji/location/options/MJLocationOptions;->h:Z

    invoke-virtual {v0, p1}, Lcom/amap/api/location/AMapLocationClientOption;->setKillProcess(Z)Lcom/amap/api/location/AMapLocationClientOption;

    .line 47
    invoke-virtual {v0, v2}, Lcom/amap/api/location/AMapLocationClientOption;->setSensorEnable(Z)Lcom/amap/api/location/AMapLocationClientOption;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_5

    :catch_0
    move-exception p1

    const-string v1, "AmapOptionsParser"

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

    :cond_7
    :goto_5
    return-object v0
.end method

.method public synthetic b(Lcom/moji/location/options/MJLocationOptions;)Ljava/lang/Object;
    .locals 0

    .line 13
    invoke-virtual {p0, p1}, Lcom/moji/location/options/AmapOptionsParser;->a(Lcom/moji/location/options/MJLocationOptions;)Lcom/amap/api/location/AMapLocationClientOption;

    move-result-object p1

    return-object p1
.end method
