x.smali

.class public Lcom/baidu/location/b/x;
.super Ljava/lang/Object;


# static fields
.field private static a:Ljava/lang/Object;

.field private static b:Lcom/baidu/location/b/x;


# instance fields
.field private c:Landroid/os/HandlerThread;

.field private d:Landroid/os/Handler;

.field private e:Z


# direct methods
.method static constructor <clinit>()V
    .registers 1

    new-instance v0, Ljava/lang/Object;

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

    sput-object v0, Lcom/baidu/location/b/x;->a:Ljava/lang/Object;

    const/4 v0, 0x0

    sput-object v0, Lcom/baidu/location/b/x;->b:Lcom/baidu/location/b/x;

    return-void
.end method

.method constructor <init>()V
    .registers 2

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

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    return-void
.end method

.method static synthetic a(Lcom/baidu/location/b/x;)Landroid/os/Handler;
    .registers 1

    iget-object p0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    return-object p0
.end method

.method public static a()Lcom/baidu/location/b/x;
    .registers 2

    sget-object v0, Lcom/baidu/location/b/x;->a:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    sget-object v1, Lcom/baidu/location/b/x;->b:Lcom/baidu/location/b/x;

    if-nez v1, :cond_e

    new-instance v1, Lcom/baidu/location/b/x;

    invoke-direct {v1}, Lcom/baidu/location/b/x;-><init>()V

    sput-object v1, Lcom/baidu/location/b/x;->b:Lcom/baidu/location/b/x;

    :cond_e
    sget-object v1, Lcom/baidu/location/b/x;->b:Lcom/baidu/location/b/x;

    monitor-exit v0

    return-object v1

    :catchall_12
    move-exception v1

    monitor-exit v0
    :try_end_14
    .catchall {:try_start_3 .. :try_end_14} :catchall_12

    throw v1
.end method


# virtual methods
.method public a(Landroid/location/Location;I)V
    .registers 7

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-eqz v0, :cond_31

    if-nez p1, :cond_7

    goto :goto_31

    :cond_7
    :try_start_7
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_31

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    new-instance v1, Landroid/os/Bundle;

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

    const-string v2, "loc"

    new-instance v3, Landroid/location/Location;

    invoke-direct {v3, p1}, Landroid/location/Location;-><init>(Landroid/location/Location;)V

    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    const-string p1, "satnum"

    invoke-virtual {v1, p1, p2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

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

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2c
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_2c} :catch_2d

    goto :goto_31

    :catch_2d
    move-exception p1

    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_31
    :goto_31
    return-void
.end method

.method public b()V
    .registers 3

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-nez v0, :cond_5

    return-void

    :cond_5
    :try_start_5
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_18

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_13
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_13} :catch_14

    goto :goto_18

    :catch_14
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_18
    :goto_18
    return-void
.end method

.method public c()V
    .registers 3

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-nez v0, :cond_5

    return-void

    :cond_5
    :try_start_5
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_18

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_13
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_13} :catch_14

    goto :goto_18

    :catch_14
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_18
    :goto_18
    return-void
.end method

.method public d()V
    .registers 3

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-nez v0, :cond_5

    return-void

    :cond_5
    :try_start_5
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_18

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x7

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_13
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_13} :catch_14

    goto :goto_18

    :catch_14
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_18
    :goto_18
    return-void
.end method

.method public e()V
    .registers 5

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-eqz v0, :cond_5

    return-void

    :cond_5
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    iget-object v0, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    if-nez v0, :cond_29

    new-instance v0, Landroid/os/HandlerThread;

    const-string v1, "LocUploadThreadManager"

    invoke-direct {v0, v1}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V

    iget-object v0, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    if-eqz v0, :cond_29

    new-instance v0, Lcom/baidu/location/b/y;

    iget-object v1, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/baidu/location/b/y;-><init>(Lcom/baidu/location/b/x;Landroid/os/Looper;)V

    iput-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    :cond_29
    :try_start_29
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_3c

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x5

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_37
    .catch Ljava/lang/Exception; {:try_start_29 .. :try_end_37} :catch_38

    goto :goto_3c

    :catch_38
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_3c
    :goto_3c
    :try_start_3c
    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v0, :cond_4e

    iget-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    const/4 v1, 0x4

    sget v2, Lcom/baidu/location/g/k;->R:I

    int-to-long v2, v2

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z
    :try_end_49
    .catch Ljava/lang/Exception; {:try_start_3c .. :try_end_49} :catch_4a

    goto :goto_4e

    :catch_4a
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_4e
    :goto_4e
    return-void
.end method

.method public f()V
    .registers 3

    iget-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    if-nez v0, :cond_5

    return-void

    :cond_5
    invoke-static {}, Lcom/baidu/location/b/d;->a()Lcom/baidu/location/b/d;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/location/b/d;->b()V

    const/4 v0, 0x0

    :try_start_d
    iget-object v1, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    if-eqz v1, :cond_1b

    iget-object v1, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_d .. :try_end_16} :catch_17

    goto :goto_1b

    :catch_17
    move-exception v1

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_1b
    :goto_1b
    iput-object v0, p0, Lcom/baidu/location/b/x;->d:Landroid/os/Handler;

    :try_start_1d
    iget-object v1, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    if-eqz v1, :cond_30

    iget-object v1, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->quit()Z

    iget-object v1, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->interrupt()V
    :try_end_2b
    .catch Ljava/lang/Exception; {:try_start_1d .. :try_end_2b} :catch_2c

    goto :goto_30

    :catch_2c
    move-exception v1

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_30
    :goto_30
    iput-object v0, p0, Lcom/baidu/location/b/x;->c:Landroid/os/HandlerThread;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/baidu/location/b/x;->e:Z

    return-void
.end method