.class Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;
.super Ljava/lang/Object;
.source "MainActivity.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/mjweather/MainActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "PressureSensorEventRunnable"
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/mjweather/MainActivity;

.field private b:F

.field private c:I


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/MainActivity;F)V
    .locals 0

    .line 2051
    iput-object p1, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->a:Lcom/moji/mjweather/MainActivity;

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

    .line 2052
    iput p2, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->b:F

    return-void
.end method


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

    .line 2057
    iget-object v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->a:Lcom/moji/mjweather/MainActivity;

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

    const-wide/32 v2, 0xea60

    invoke-static {v0, v1, v2, v3}, Lcom/moji/location/provider/HistoryLocationHelper;->a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;J)Z

    move-result v0

    const/4 v1, 0x1

    const/4 v2, 0x2

    if-eqz v0, :cond_1

    const-string v0, "MainActivity"

    .line 2058
    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "PressureSensorEventRunnable run location not ready "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v4, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->c:I

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v0, v3}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 2059
    iget v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->c:I

    if-le v0, v2, :cond_0

    return-void

    .line 2060
    :cond_0
    iget v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->c:I

    add-int/2addr v0, v1

    iput v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->c:I

    .line 2061
    iget-object v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->a:Lcom/moji/mjweather/MainActivity;

    invoke-static {v0}, Lcom/moji/mjweather/MainActivity;->l(Lcom/moji/mjweather/MainActivity;)Lcom/moji/mjweather/MainActivity$MainHandler;

    move-result-object v0

    const-wide/16 v1, 0x1388

    invoke-virtual {v0, p0, v1, v2}, Lcom/moji/mjweather/MainActivity$MainHandler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void

    .line 2064
    :cond_1
    iget-object v0, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->a:Lcom/moji/mjweather/MainActivity;

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

    invoke-static {v0, v3}, Lcom/moji/location/provider/HistoryLocationHelper;->b(Landroid/content/Context;Lcom/moji/location/MJLocationSource;)Lcom/moji/location/entity/MJLocation;

    move-result-object v0

    if-nez v0, :cond_2

    return-void

    .line 2066
    :cond_2
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object v3

    sget-object v4, Lcom/moji/statistics/EVENT_TAG;->WEATHER_AIR_PRESSURE:Lcom/moji/statistics/EVENT_TAG;

    iget v5, p0, Lcom/moji/mjweather/MainActivity$PressureSensorEventRunnable;->b:F

    invoke-static {v5}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;

    move-result-object v5

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v6, 0x0

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

    move-result-wide v7

    invoke-static {v7, v8}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;

    move-result-object v7

    aput-object v7, v2, v6

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

    move-result-wide v6

    invoke-static {v6, v7}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;

    move-result-object v0

    aput-object v0, v2, v1

    invoke-static {v2}, Lcom/moji/statistics/EventParams;->getProperty([Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {v3, v4, v5, v0}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;Ljava/lang/String;Lorg/json/JSONObject;)Lcom/moji/statistics/EventManager;

    return-void
.end method
