.class final Lcom/moji/location/provider/HistoryLocationHelper$1;
.super Ljava/lang/Object;
.source "HistoryLocationHelper.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/moji/location/provider/HistoryLocationHelper;->a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/entity/MJLocation;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic a:Landroid/content/Context;

.field final synthetic b:Lcom/moji/location/MJLocationSource;

.field final synthetic c:Lcom/moji/location/entity/MJLocation;


# direct methods
.method constructor <init>(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/entity/MJLocation;)V
    .locals 0

    .line 41
    iput-object p1, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->a:Landroid/content/Context;

    iput-object p2, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    iput-object p3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->c:Lcom/moji/location/entity/MJLocation;

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

    return-void
.end method


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

    .line 45
    :try_start_0
    invoke-static {}, Lcom/moji/location/provider/HistoryLocationHelper;->a()Ljava/lang/Object;

    move-result-object v0

    monitor-enter v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 46
    :try_start_1
    new-instance v1, Lcom/moji/location/provider/LocationPreference;

    iget-object v2, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->a:Landroid/content/Context;

    invoke-direct {v1, v2}, Lcom/moji/location/provider/LocationPreference;-><init>(Landroid/content/Context;)V

    .line 47
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->AMAP_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    .line 48
    sget-object v3, Lcom/moji/location/provider/HistoryLocationHelper$2;->a:[I

    iget-object v4, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    invoke-virtual {v4}, Lcom/moji/location/MJLocationSource;->ordinal()I

    move-result v4

    aget v3, v3, v4

    packed-switch v3, :pswitch_data_0

    goto :goto_0

    .line 68
    :pswitch_0
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->MJ_V3_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 65
    :pswitch_1
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->IP_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 62
    :pswitch_2
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->TV_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 59
    :pswitch_3
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->CDMA_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 56
    :pswitch_4
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->GSM_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 53
    :pswitch_5
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->MJ_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    goto :goto_0

    .line 50
    :pswitch_6
    sget-object v2, Lcom/moji/location/provider/LocationPreference$KeyConstant;->AMAP_TIME:Lcom/moji/location/provider/LocationPreference$KeyConstant;

    .line 71
    :goto_0
    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->a:Landroid/content/Context;

    iget-object v4, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    invoke-virtual {v4}, Lcom/moji/location/MJLocationSource;->ordinal()I

    move-result v4

    invoke-static {v3, v4}, Lcom/moji/location/provider/HistoryLocationHelper;->a(Landroid/content/Context;I)Lcom/moji/location/entity/MJLocation;

    move-result-object v3

    if-eqz v3, :cond_0

    .line 73
    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->a:Landroid/content/Context;

    iget-object v4, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    invoke-virtual {v4}, Lcom/moji/location/MJLocationSource;->ordinal()I

    move-result v4

    invoke-static {v3, v4}, Lcom/moji/location/provider/HistoryLocationHelper;->b(Landroid/content/Context;I)I

    .line 75
    :cond_0
    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->a:Landroid/content/Context;

    iget-object v4, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->c:Lcom/moji/location/entity/MJLocation;

    iget-object v5, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    invoke-static {v3, v4, v5}, Lcom/moji/location/provider/HistoryLocationHelper;->a(Landroid/content/Context;Lcom/moji/location/entity/MJLocation;Lcom/moji/location/MJLocationSource;)Z

    .line 78
    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    sget-object v4, Lcom/moji/location/MJLocationSource;->AMAP_LOCATION:Lcom/moji/location/MJLocationSource;

    if-ne v3, v4, :cond_2

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

    move-result v3

    if-eqz v3, :cond_2

    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->c:Lcom/moji/location/entity/MJLocation;

    if-eqz v3, :cond_1

    iget-object v3, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->c:Lcom/moji/location/entity/MJLocation;

    invoke-virtual {v3}, Lcom/moji/location/entity/MJLocation;->getAltitude()D

    move-result-wide v3

    const-wide/16 v5, 0x0

    cmpl-double v7, v3, v5

    if-eqz v7, :cond_1

    goto :goto_1

    .line 82
    :cond_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    const-wide/32 v5, 0x1d4c0

    sub-long/2addr v3, v5

    goto :goto_2

    .line 79
    :cond_2
    :goto_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    .line 84
    :goto_2
    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v5

    invoke-virtual {v1, v2, v5}, Lcom/moji/location/provider/LocationPreference;->a(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/Long;)V

    .line 86
    iget-object v1, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->c:Lcom/moji/location/entity/MJLocation;

    iget-object v2, p0, Lcom/moji/location/provider/HistoryLocationHelper$1;->b:Lcom/moji/location/MJLocationSource;

    invoke-static {v1, v2, v3, v4}, Lcom/moji/location/provider/HistoryLocationHelper;->a(Lcom/moji/location/entity/MJLocation;Lcom/moji/location/MJLocationSource;J)V

    .line 87
    monitor-exit v0

    goto :goto_3

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :try_start_2
    throw v1
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    move-exception v0

    const-string v1, " setNewLocation:"

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

    :goto_3
    return-void

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_6
        :pswitch_5
        :pswitch_4
        :pswitch_3
        :pswitch_2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method
