.class public Lf/h$g;
.super Lf/h$f;
.source ""


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lf/h;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "g"
.end annotation


# instance fields
.field public final c:Lf/r;

.field public final synthetic d:Lf/h;


# direct methods
.method public constructor <init>(Lf/h;Lf/r;)V
    .registers 3

    iput-object p1, p0, Lf/h$g;->d:Lf/h;

    invoke-direct {p0, p1}, Lf/h$f;-><init>(Lf/h;)V

    iput-object p2, p0, Lf/h$g;->c:Lf/r;

    return-void
.end method


# virtual methods
.method public b()Landroid/content/IntentFilter;
    .registers 3

    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    const-string v1, "android.intent.action.TIME_SET"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "android.intent.action.TIMEZONE_CHANGED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "android.intent.action.TIME_TICK"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    return-object v0
.end method

.method public c()I
    .registers 25

    move-object/from16 v0, p0

    iget-object v1, v0, Lf/h$g;->c:Lf/r;

    .line 1
    iget-object v2, v1, Lf/r;->c:Lf/r$a;

    .line 2
    iget-wide v3, v2, Lf/r$a;->b:J

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    cmp-long v3, v3, v5

    const/4 v4, 0x1

    if-lez v3, :cond_13

    move v3, v4

    goto :goto_14

    :cond_13
    const/4 v3, 0x0

    :goto_14
    if-eqz v3, :cond_1a

    .line 3
    :goto_16
    iget-boolean v1, v2, Lf/r$a;->a:Z

    goto/16 :goto_ea

    .line 4
    :cond_1a
    iget-object v3, v1, Lf/r;->a:Landroid/content/Context;

    const-string v6, "android.permission.ACCESS_COARSE_LOCATION"

    invoke-static {v3, v6}, Li/d;->a(Landroid/content/Context;Ljava/lang/String;)I

    move-result v3

    const/4 v6, 0x0

    if-nez v3, :cond_2c

    const-string v3, "network"

    invoke-virtual {v1, v3}, Lf/r;->a(Ljava/lang/String;)Landroid/location/Location;

    move-result-object v3

    goto :goto_2d

    :cond_2c
    move-object v3, v6

    :goto_2d
    iget-object v7, v1, Lf/r;->a:Landroid/content/Context;

    const-string v8, "android.permission.ACCESS_FINE_LOCATION"

    invoke-static {v7, v8}, Li/d;->a(Landroid/content/Context;Ljava/lang/String;)I

    move-result v7

    if-nez v7, :cond_3d

    const-string v6, "gps"

    invoke-virtual {v1, v6}, Lf/r;->a(Ljava/lang/String;)Landroid/location/Location;

    move-result-object v6

    :cond_3d
    if-eqz v6, :cond_4e

    if-eqz v3, :cond_4e

    invoke-virtual {v6}, Landroid/location/Location;->getTime()J

    move-result-wide v7

    invoke-virtual {v3}, Landroid/location/Location;->getTime()J

    move-result-wide v9

    cmp-long v7, v7, v9

    if-lez v7, :cond_51

    goto :goto_50

    :cond_4e
    if-eqz v6, :cond_51

    :goto_50
    move-object v3, v6

    :cond_51
    if-eqz v3, :cond_cd

    .line 5
    iget-object v1, v1, Lf/r;->c:Lf/r$a;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v13

    .line 6
    sget-object v6, Lf/q;->d:Lf/q;

    if-nez v6, :cond_64

    new-instance v6, Lf/q;

    invoke-direct {v6}, Lf/q;-><init>()V

    sput-object v6, Lf/q;->d:Lf/q;

    :cond_64
    sget-object v11, Lf/q;->d:Lf/q;

    const-wide/32 v22, 0x5265c00

    sub-long v16, v13, v22

    .line 7
    invoke-virtual {v3}, Landroid/location/Location;->getLatitude()D

    move-result-wide v18

    invoke-virtual {v3}, Landroid/location/Location;->getLongitude()D

    move-result-wide v20

    move-object v15, v11

    invoke-virtual/range {v15 .. v21}, Lf/q;->a(JDD)V

    invoke-virtual {v3}, Landroid/location/Location;->getLatitude()D

    move-result-wide v9

    invoke-virtual {v3}, Landroid/location/Location;->getLongitude()D

    move-result-wide v15

    move-object v6, v11

    move-wide v7, v13

    move-object v5, v11

    move-wide v11, v15

    invoke-virtual/range {v6 .. v12}, Lf/q;->a(JDD)V

    iget v6, v5, Lf/q;->c:I

    if-ne v6, v4, :cond_8c

    move v6, v4

    goto :goto_8d

    :cond_8c
    const/4 v6, 0x0

    :goto_8d
    iget-wide v7, v5, Lf/q;->b:J

    iget-wide v9, v5, Lf/q;->a:J

    add-long v16, v13, v22

    invoke-virtual {v3}, Landroid/location/Location;->getLatitude()D

    move-result-wide v18

    invoke-virtual {v3}, Landroid/location/Location;->getLongitude()D

    move-result-wide v20

    move-object v15, v5

    invoke-virtual/range {v15 .. v21}, Lf/q;->a(JDD)V

    iget-wide v11, v5, Lf/q;->b:J

    const-wide/16 v15, 0x0

    const-wide/16 v17, -0x1

    cmp-long v3, v7, v17

    if-eqz v3, :cond_c2

    cmp-long v3, v9, v17

    if-nez v3, :cond_ae

    goto :goto_c2

    :cond_ae
    cmp-long v3, v13, v9

    if-lez v3, :cond_b4

    add-long/2addr v11, v15

    goto :goto_bd

    :cond_b4
    cmp-long v3, v13, v7

    if-lez v3, :cond_bb

    add-long v11, v9, v15

    goto :goto_bd

    :cond_bb
    add-long v11, v7, v15

    :goto_bd
    const-wide/32 v7, 0xea60

    add-long/2addr v11, v7

    goto :goto_c7

    :cond_c2
    :goto_c2
    const-wide/32 v7, 0x2932e00

    add-long v11, v13, v7

    :goto_c7
    iput-boolean v6, v1, Lf/r$a;->a:Z

    iput-wide v11, v1, Lf/r$a;->b:J

    goto/16 :goto_16

    :cond_cd
    const-string v1, "TwilightManager"

    const-string v2, "Could not get last known location. This is probably because the app does not have any location permissions. Falling back to hardcoded sunrise/sunset values."

    .line 8
    invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v1

    const/16 v2, 0xb

    invoke-virtual {v1, v2}, Ljava/util/Calendar;->get(I)I

    move-result v1

    const/4 v2, 0x6

    if-lt v1, v2, :cond_e8

    const/16 v2, 0x16

    if-lt v1, v2, :cond_e6

    goto :goto_e8

    :cond_e6
    const/4 v5, 0x0

    goto :goto_e9

    :cond_e8
    :goto_e8
    move v5, v4

    :goto_e9
    move v1, v5

    :goto_ea
    if-eqz v1, :cond_ed

    const/4 v4, 0x2

    :cond_ed
    return v4
.end method

.method public d()V
    .registers 2

    iget-object v0, p0, Lf/h$g;->d:Lf/h;

    invoke-virtual {v0}, Lf/h;->z()Z

    return-void
.end method
