cn$1.smali

.class final Lcom/loc/cn$1;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/location/LocationListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/loc/cn;
.end annotation

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


# instance fields
.field final synthetic a:Lcom/loc/cn;


# direct methods
.method constructor <init>(Lcom/loc/cn;)V
    .registers 2

    iput-object p1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

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

    return-void
.end method


# virtual methods
.method public final onLocationChanged(Landroid/location/Location;)V
    .registers 16

    const-wide/16 v12, 0x1f40

    const/16 v10, 0xf

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-object v1, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    if-eqz v1, :cond_14

    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-object v1, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    const/16 v2, 0x8

    invoke-virtual {v1, v2}, Landroid/os/Handler;->removeMessages(I)V

    :cond_14
    if-nez p1, :cond_17

    :goto_16
    return-void

    :cond_17
    :try_start_17
    new-instance v1, Lcom/amap/api/location/AMapLocation;

    invoke-direct {v1, p1}, Lcom/amap/api/location/AMapLocation;-><init>(Landroid/location/Location;)V

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Lcom/amap/api/location/AMapLocation;->setLocationType(I)V

    invoke-virtual {p1}, Landroid/location/Location;->getExtras()Landroid/os/Bundle;

    move-result-object v2

    if-eqz v2, :cond_2d

    const-string/jumbo v0, "satellites"

    invoke-virtual {v2, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    :cond_2d
    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-boolean v2, v2, Lcom/loc/cn;->e:Z

    if-nez v2, :cond_5e

    invoke-static {v1}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z

    move-result v2

    if-eqz v2, :cond_5e

    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v2}, Lcom/loc/cn;->a(Lcom/loc/cn;)Landroid/content/Context;

    move-result-object v2

    invoke-static {}, Lcom/loc/cj;->b()J

    move-result-wide v4

    iget-object v3, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v3}, Lcom/loc/cn;->b(Lcom/loc/cn;)J

    move-result-wide v6

    sub-long/2addr v4, v6

    invoke-virtual {v1}, Lcom/amap/api/location/AMapLocation;->getLatitude()D

    move-result-wide v6

    invoke-virtual {v1}, Lcom/amap/api/location/AMapLocation;->getLongitude()D

    move-result-wide v8

    invoke-static {v6, v7, v8, v9}, Lcom/loc/ca;->a(DD)Z

    move-result v3

    invoke-static {v2, v4, v5, v3}, Lcom/loc/cg;->a(Landroid/content/Context;JZ)V

    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    const/4 v3, 0x1

    iput-boolean v3, v2, Lcom/loc/cn;->e:Z

    :cond_5e
    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget v2, v2, Lcom/loc/cn;->l:I

    invoke-static {p1, v2}, Lcom/loc/cj;->a(Landroid/location/Location;I)Z

    move-result v2

    if-eqz v2, :cond_91

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Lcom/amap/api/location/AMapLocation;->setMock(Z)V

    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-object v2, v2, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v2}, Lcom/amap/api/location/AMapLocationClientOption;->isMockEnable()Z

    move-result v2

    if-nez v2, :cond_91

    const/4 v2, 0x0

    const/16 v3, 0x868

    invoke-static {v2, v3}, Lcom/loc/cg;->a(Ljava/lang/String;I)V

    const/16 v2, 0xf

    invoke-virtual {v1, v2}, Lcom/amap/api/location/AMapLocation;->setErrorCode(I)V

    const-string/jumbo v2, "GPSLocation has been mocked!"

    invoke-virtual {v1, v2}, Lcom/amap/api/location/AMapLocation;->setLocationDetail(Ljava/lang/String;)V

    const-wide/16 v2, 0x0

    invoke-virtual {v1, v2, v3}, Lcom/amap/api/location/AMapLocation;->setLatitude(D)V

    const-wide/16 v2, 0x0

    invoke-virtual {v1, v2, v3}, Lcom/amap/api/location/AMapLocation;->setLongitude(D)V

    :cond_91
    invoke-virtual {v1, v0}, Lcom/amap/api/location/AMapLocation;->setSatellites(I)V

    iget-object v0, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v0, v1}, Lcom/loc/cn;->a(Lcom/loc/cn;Lcom/amap/api/location/AMapLocation;)V

    iget-object v0, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;
    :try_end_9b
    .catch Ljava/lang/Throwable; {:try_start_17 .. :try_end_9b} :catch_172

    :try_start_9b
    iget v2, v0, Lcom/loc/cn;->l:I

    const/4 v3, 0x4

    if-lt v2, v3, :cond_17e

    const/4 v0, 0x1

    invoke-virtual {v1, v0}, Lcom/amap/api/location/AMapLocation;->setGpsAccuracyStatus(I)V
    :try_end_a4
    .catch Ljava/lang/Throwable; {:try_start_9b .. :try_end_a4} :catch_188

    :goto_a4
    :try_start_a4
    iget-object v0, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v0, v1}, Lcom/loc/cn;->b(Lcom/loc/cn;Lcom/amap/api/location/AMapLocation;)Lcom/amap/api/location/AMapLocation;

    move-result-object v0

    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v1, v0}, Lcom/loc/cn;->c(Lcom/loc/cn;Lcom/amap/api/location/AMapLocation;)V

    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v0}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z

    move-result v2

    if-eqz v2, :cond_10b

    iget-object v2, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    if-eqz v2, :cond_10b

    iget-object v2, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v2}, Lcom/amap/api/location/AMapLocationClientOption;->isNeedAddress()Z

    move-result v2

    if-eqz v2, :cond_10b

    invoke-static {}, Lcom/loc/cj;->b()J

    move-result-wide v2

    iget-object v4, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v4}, Lcom/amap/api/location/AMapLocationClientOption;->getInterval()J

    move-result-wide v4

    cmp-long v4, v4, v12

    if-lez v4, :cond_df

    iget-wide v4, v1, Lcom/loc/cn;->j:J

    sub-long/2addr v2, v4

    iget-object v4, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v4}, Lcom/amap/api/location/AMapLocationClientOption;->getInterval()J

    move-result-wide v4

    sub-long/2addr v4, v12

    cmp-long v2, v2, v4

    if-lez v2, :cond_10b

    :cond_df
    new-instance v2, Landroid/os/Bundle;

    invoke-direct {v2}, Landroid/os/Bundle;-><init>()V

    const-string/jumbo v3, "lat"

    invoke-virtual {v0}, Lcom/amap/api/location/AMapLocation;->getLatitude()D

    move-result-wide v4

    invoke-virtual {v2, v3, v4, v5}, Landroid/os/Bundle;->putDouble(Ljava/lang/String;D)V

    const-string/jumbo v3, "lon"

    invoke-virtual {v0}, Lcom/amap/api/location/AMapLocation;->getLongitude()D

    move-result-wide v4

    invoke-virtual {v2, v3, v4, v5}, Landroid/os/Bundle;->putDouble(Ljava/lang/String;D)V

    invoke-static {}, Landroid/os/Message;->obtain()Landroid/os/Message;

    move-result-object v3

    invoke-virtual {v3, v2}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    const/4 v2, 0x5

    iput v2, v3, Landroid/os/Message;->what:I

    iget-object v2, v1, Lcom/loc/cn;->n:Lcom/amap/api/location/AMapLocation;

    if-nez v2, :cond_191

    iget-object v1, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    invoke-virtual {v1, v3}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_10b
    :goto_10b
    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-object v2, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    iget-object v2, v2, Lcom/loc/cn;->n:Lcom/amap/api/location/AMapLocation;

    if-eqz v2, :cond_129

    iget-object v3, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v3}, Lcom/amap/api/location/AMapLocationClientOption;->isNeedAddress()Z

    move-result v3

    if-eqz v3, :cond_129

    invoke-static {v0, v2}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;Lcom/amap/api/location/AMapLocation;)F

    move-result v3

    iget v1, v1, Lcom/loc/cn;->h:I

    int-to-float v1, v1

    cmpg-float v1, v3, v1

    if-gez v1, :cond_129

    invoke-static {v0, v2}, Lcom/loc/ca;->a(Lcom/amap/api/location/AMapLocation;Lcom/amap/api/location/AMapLocation;)Lcom/amap/api/location/AMapLocation;

    :cond_129
    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-virtual {v0}, Lcom/amap/api/location/AMapLocation;->getErrorCode()I

    move-result v2

    if-ne v2, v10, :cond_13f

    sget-object v2, Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;->b:Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;

    iget-object v3, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v3}, Lcom/amap/api/location/AMapLocationClientOption;->getLocationMode()Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/amap/api/location/AMapLocationClientOption$AMapLocationMode;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_16b

    :cond_13f
    invoke-static {}, Lcom/loc/cj;->b()J

    move-result-wide v2

    iget-wide v4, v1, Lcom/loc/cn;->j:J

    sub-long/2addr v2, v4

    iget-object v4, v1, Lcom/loc/cn;->c:Lcom/amap/api/location/AMapLocationClientOption;

    invoke-virtual {v4}, Lcom/amap/api/location/AMapLocationClientOption;->getInterval()J

    move-result-wide v4

    const-wide/16 v6, 0xc8

    sub-long/2addr v4, v6

    cmp-long v2, v2, v4

    if-ltz v2, :cond_16b

    invoke-static {}, Lcom/loc/cj;->b()J

    move-result-wide v2

    iput-wide v2, v1, Lcom/loc/cn;->j:J

    iget-object v2, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    if-eqz v2, :cond_16b

    invoke-static {}, Landroid/os/Message;->obtain()Landroid/os/Message;

    move-result-object v2

    iput-object v0, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    const/4 v3, 0x2

    iput v3, v2, Landroid/os/Message;->what:I

    iget-object v1, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    invoke-virtual {v1, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_16b
    iget-object v1, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    invoke-static {v1, v0}, Lcom/loc/cn;->d(Lcom/loc/cn;Lcom/amap/api/location/AMapLocation;)V
    :try_end_170
    .catch Ljava/lang/Throwable; {:try_start_a4 .. :try_end_170} :catch_172

    goto/16 :goto_16

    :catch_172
    move-exception v0

    const-string/jumbo v1, "GPSLocation"

    const-string/jumbo v2, "onLocationChanged"

    invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_16

    :cond_17e
    :try_start_17e
    iget v0, v0, Lcom/loc/cn;->l:I

    if-nez v0, :cond_18b

    const/4 v0, -0x1

    invoke-virtual {v1, v0}, Lcom/amap/api/location/AMapLocation;->setGpsAccuracyStatus(I)V

    goto/16 :goto_a4

    :catch_188
    move-exception v0

    goto/16 :goto_a4

    :cond_18b
    const/4 v0, 0x0

    invoke-virtual {v1, v0}, Lcom/amap/api/location/AMapLocation;->setGpsAccuracyStatus(I)V
    :try_end_18f
    .catch Ljava/lang/Throwable; {:try_start_17e .. :try_end_18f} :catch_188

    goto/16 :goto_a4

    :cond_191
    :try_start_191
    iget-object v2, v1, Lcom/loc/cn;->n:Lcom/amap/api/location/AMapLocation;

    invoke-static {v0, v2}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;Lcom/amap/api/location/AMapLocation;)F

    move-result v2

    iget v4, v1, Lcom/loc/cn;->i:I

    int-to-float v4, v4

    cmpl-float v2, v2, v4

    if-lez v2, :cond_10b

    iget-object v1, v1, Lcom/loc/cn;->a:Landroid/os/Handler;

    invoke-virtual {v1, v3}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_1a3
    .catch Ljava/lang/Throwable; {:try_start_191 .. :try_end_1a3} :catch_172

    goto/16 :goto_10b
.end method

.method public final onProviderDisabled(Ljava/lang/String;)V
    .registers 6

    :try_start_0
    const-string/jumbo v0, "gps"

    invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_f

    iget-object v0, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    const-wide/16 v2, 0x0

    iput-wide v2, v0, Lcom/loc/cn;->d:J
    :try_end_f
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_f} :catch_10

    :cond_f
    :goto_f
    return-void

    :catch_10
    move-exception v0

    const-string/jumbo v1, "GPSLocation"

    const-string/jumbo v2, "onProviderDisabled"

    invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_f
.end method

.method public final onProviderEnabled(Ljava/lang/String;)V
    .registers 2

    return-void
.end method

.method public final onStatusChanged(Ljava/lang/String;ILandroid/os/Bundle;)V
    .registers 8

    if-nez p2, :cond_8

    :try_start_2
    iget-object v0, p0, Lcom/loc/cn$1;->a:Lcom/loc/cn;

    const-wide/16 v2, 0x0

    iput-wide v2, v0, Lcom/loc/cn;->d:J
    :try_end_8
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_8} :catch_9

    :cond_8
    :goto_8
    return-void

    :catch_9
    move-exception v0

    const-string/jumbo v1, "GPSLocation"

    const-string/jumbo v2, "onStatusChanged"

    invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_8
.end method