Theme$7.smali

.class final Lim/tpelyyftgw/ui/actionbar/Theme$7;
.super Ljava/lang/Object;
.source "Theme.java"

# interfaces
.implements Landroid/hardware/SensorEventListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lim/tpelyyftgw/ui/actionbar/Theme;
.end annotation

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


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

    return-void
.end method

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

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

    return-void
.end method


# virtual methods
.method public onAccuracyChanged(Landroid/hardware/Sensor;I)V
    .registers 3
    .param p1, "sensor"    # Landroid/hardware/Sensor;
    .param p2, "accuracy"    # I

    .line 3444
    return-void
.end method

.method public onSensorChanged(Landroid/hardware/SensorEvent;)V
    .registers 8
    .param p1, "event"    # Landroid/hardware/SensorEvent;

    .line 3406
    iget-object v0, p1, Landroid/hardware/SensorEvent;->values:[F

    const/4 v1, 0x0

    aget v0, v0, v1

    .line 3407
    .local v0, "lux":F
    const/4 v2, 0x0

    cmpg-float v2, v0, v2

    if-gtz v2, :cond_d

    .line 3408
    const v0, 0x3dcccccd    # 0.1f

    .line 3410
    :cond_d
    sget-boolean v2, Lim/tpelyyftgw/messenger/ApplicationLoader;->mainInterfacePaused:Z

    if-nez v2, :cond_9f

    sget-boolean v2, Lim/tpelyyftgw/messenger/ApplicationLoader;->isScreenOn:Z

    if-nez v2, :cond_17

    goto/16 :goto_9f

    .line 3413
    :cond_17
    const/high16 v2, 0x43fa0000    # 500.0f

    cmpl-float v2, v0, v2

    if-lez v2, :cond_23

    .line 3414
    const/high16 v2, 0x3f800000    # 1.0f

    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->lastBrightnessValue:F
    invoke-static {v2}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$902(F)F

    goto :goto_40

    .line 3416
    :cond_23
    const-wide v2, 0x4023dd5660000000L    # 9.932299613952637

    float-to-double v4, v0

    invoke-static {v4, v5}, Ljava/lang/Math;->log(D)D

    move-result-wide v4

    mul-double v4, v4, v2

    const-wide v2, 0x403b0f1aa0000000L    # 27.05900001525879

    add-double/2addr v4, v2

    invoke-static {v4, v5}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v2

    double-to-float v2, v2

    const/high16 v3, 0x42c80000    # 100.0f

    div-float/2addr v2, v3

    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->lastBrightnessValue:F
    invoke-static {v2}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$902(F)F

    .line 3418
    :goto_40
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->lastBrightnessValue:F
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$900()F

    move-result v2

    sget v3, Lim/tpelyyftgw/ui/actionbar/Theme;->autoNightBrighnessThreshold:F

    const/4 v4, 0x1

    cmpg-float v2, v2, v3

    if-gtz v2, :cond_7a

    .line 3419
    invoke-static {}, Lim/tpelyyftgw/messenger/MediaController;->getInstance()Lim/tpelyyftgw/messenger/MediaController;

    move-result-object v2

    invoke-virtual {v2}, Lim/tpelyyftgw/messenger/MediaController;->isRecordingOrListeningByProximity()Z

    move-result v2

    if-nez v2, :cond_9e

    .line 3420
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayRunnableScheduled:Z
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$400()Z

    move-result v2

    if-eqz v2, :cond_65

    .line 3421
    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayRunnableScheduled:Z
    invoke-static {v1}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$402(Z)Z

    .line 3422
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayBrightnessRunnable:Ljava/lang/Runnable;
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1000()Ljava/lang/Runnable;

    move-result-object v1

    invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->cancelRunOnUIThread(Ljava/lang/Runnable;)V

    .line 3424
    :cond_65
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightRunnableScheduled:Z
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$600()Z

    move-result v1

    if-nez v1, :cond_9e

    .line 3425
    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightRunnableScheduled:Z
    invoke-static {v4}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$602(Z)Z

    .line 3426
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightBrightnessRunnable:Ljava/lang/Runnable;
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1100()Ljava/lang/Runnable;

    move-result-object v1

    # invokes: Lim/tpelyyftgw/ui/actionbar/Theme;->getAutoNightSwitchThemeDelay()J
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1200()J

    move-result-wide v2

    invoke-static {v1, v2, v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->runOnUIThread(Ljava/lang/Runnable;J)V

    goto :goto_9e

    .line 3430
    :cond_7a
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightRunnableScheduled:Z
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$600()Z

    move-result v2

    if-eqz v2, :cond_8a

    .line 3431
    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightRunnableScheduled:Z
    invoke-static {v1}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$602(Z)Z

    .line 3432
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchNightBrightnessRunnable:Ljava/lang/Runnable;
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1100()Ljava/lang/Runnable;

    move-result-object v1

    invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->cancelRunOnUIThread(Ljava/lang/Runnable;)V

    .line 3434
    :cond_8a
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayRunnableScheduled:Z
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$400()Z

    move-result v1

    if-nez v1, :cond_9e

    .line 3435
    # setter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayRunnableScheduled:Z
    invoke-static {v4}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$402(Z)Z

    .line 3436
    # getter for: Lim/tpelyyftgw/ui/actionbar/Theme;->switchDayBrightnessRunnable:Ljava/lang/Runnable;
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1000()Ljava/lang/Runnable;

    move-result-object v1

    # invokes: Lim/tpelyyftgw/ui/actionbar/Theme;->getAutoNightSwitchThemeDelay()J
    invoke-static {}, Lim/tpelyyftgw/ui/actionbar/Theme;->access$1200()J

    move-result-wide v2

    invoke-static {v1, v2, v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->runOnUIThread(Ljava/lang/Runnable;J)V

    .line 3439
    :cond_9e
    :goto_9e
    return-void

    .line 3411
    :cond_9f
    :goto_9f
    return-void
.end method