.class public final Lcom/google/android/gms/internal/ads/k3;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Landroid/hardware/SensorEventListener;


# instance fields
.field public final a:Landroid/hardware/SensorManager;
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation
.end field

.field public final b:Landroid/hardware/Sensor;
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation
.end field

.field public c:F

.field public d:Ljava/lang/Float;

.field public e:J

.field public f:I

.field public g:Z

.field public h:Z

.field public i:Lz5/kr0;
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation
.end field

.field public j:Z
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 4

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

    const/4 v0, 0x0

    iput v0, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object v0

    iput-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzj()Lu5/c;

    move-result-object v0

    invoke-interface {v0}, Lu5/c;->b()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/google/android/gms/internal/ads/k3;->e:J

    const/4 v0, 0x0

    iput v0, p0, Lcom/google/android/gms/internal/ads/k3;->f:I

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->g:Z

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->h:Z

    const/4 v1, 0x0

    iput-object v1, p0, Lcom/google/android/gms/internal/ads/k3;->i:Lz5/kr0;

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->j:Z

    const-string v0, "sensor"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/hardware/SensorManager;

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->a:Landroid/hardware/SensorManager;

    if-eqz p1, :cond_36

    const/4 v0, 0x4

    invoke-virtual {p1, v0}, Landroid/hardware/SensorManager;->getDefaultSensor(I)Landroid/hardware/Sensor;

    move-result-object p1

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->b:Landroid/hardware/Sensor;

    return-void

    :cond_36
    iput-object v1, p0, Lcom/google/android/gms/internal/ads/k3;->b:Landroid/hardware/Sensor;

    return-void
.end method


# virtual methods
.method public final a()V
    .registers 4

    monitor-enter p0

    :try_start_1
    sget-object v0, Lz5/so;->U5:Lz5/no;

    .line 1
    sget-object v1, Lz5/xk;->d:Lz5/xk;

    iget-object v1, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 2
    invoke-virtual {v1, v0}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_15

    monitor-exit p0

    return-void

    :cond_15
    iget-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->j:Z

    if-nez v0, :cond_2d

    iget-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->a:Landroid/hardware/SensorManager;

    if-eqz v0, :cond_2d

    iget-object v1, p0, Lcom/google/android/gms/internal/ads/k3;->b:Landroid/hardware/Sensor;

    if-eqz v1, :cond_2d

    const/4 v2, 0x2

    invoke-virtual {v0, p0, v1, v2}, Landroid/hardware/SensorManager;->registerListener(Landroid/hardware/SensorEventListener;Landroid/hardware/Sensor;I)Z

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->j:Z

    const-string v0, "Listening for flick gestures."

    invoke-static {v0}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    :cond_2d
    monitor-exit p0
    :try_end_2e
    .catchall {:try_start_1 .. :try_end_2e} :catchall_3e

    iget-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->a:Landroid/hardware/SensorManager;

    if-eqz v0, :cond_38

    iget-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->b:Landroid/hardware/Sensor;

    if-nez v0, :cond_37

    goto :goto_38

    :cond_37
    return-void

    :cond_38
    :goto_38
    const-string v0, "Flick detection failed to initialize. Failed to obtain gyroscope."

    invoke-static {v0}, Lz5/d50;->zzi(Ljava/lang/String;)V

    return-void

    :catchall_3e
    move-exception v0

    :try_start_3f
    monitor-exit p0
    :try_end_40
    .catchall {:try_start_3f .. :try_end_40} :catchall_3e

    throw v0
.end method

.method public final onAccuracyChanged(Landroid/hardware/Sensor;I)V
    .registers 3

    return-void
.end method

.method public final onSensorChanged(Landroid/hardware/SensorEvent;)V
    .registers 10

    sget-object v0, Lz5/so;->U5:Lz5/no;

    .line 1
    sget-object v1, Lz5/xk;->d:Lz5/xk;

    iget-object v2, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 2
    invoke-virtual {v2, v0}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_13

    return-void

    :cond_13
    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzj()Lu5/c;

    move-result-object v0

    invoke-interface {v0}, Lu5/c;->b()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/google/android/gms/internal/ads/k3;->e:J

    sget-object v0, Lz5/so;->W5:Lz5/no;

    .line 3
    iget-object v6, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 4
    invoke-virtual {v6, v0}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    int-to-long v6, v0

    add-long/2addr v4, v6

    cmp-long v0, v4, v2

    const/4 v4, 0x0

    if-gez v0, :cond_42

    iput v4, p0, Lcom/google/android/gms/internal/ads/k3;->f:I

    iput-wide v2, p0, Lcom/google/android/gms/internal/ads/k3;->e:J

    iput-boolean v4, p0, Lcom/google/android/gms/internal/ads/k3;->g:Z

    iput-boolean v4, p0, Lcom/google/android/gms/internal/ads/k3;->h:Z

    iget-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {v0}, Ljava/lang/Float;->floatValue()F

    move-result v0

    iput v0, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    :cond_42
    iget-object p1, p1, Landroid/hardware/SensorEvent;->values:[F

    const/4 v0, 0x1

    aget p1, p1, v0

    iget-object v5, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {v5}, Ljava/lang/Float;->floatValue()F

    move-result v5

    const/high16 v6, 0x40800000    # 4.0f

    mul-float/2addr p1, v6

    add-float/2addr p1, v5

    invoke-static {p1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object p1

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {p1}, Ljava/lang/Float;->floatValue()F

    move-result p1

    iget v5, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    sget-object v6, Lz5/so;->V5:Lz5/no;

    .line 5
    iget-object v7, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 6
    invoke-virtual {v7, v6}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/Float;

    invoke-virtual {v7}, Ljava/lang/Float;->floatValue()F

    move-result v7

    add-float/2addr v7, v5

    cmpl-float p1, p1, v7

    if-lez p1, :cond_7b

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {p1}, Ljava/lang/Float;->floatValue()F

    move-result p1

    iput p1, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->h:Z

    goto :goto_9e

    :cond_7b
    iget-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {p1}, Ljava/lang/Float;->floatValue()F

    move-result p1

    iget v5, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    .line 7
    iget-object v7, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 8
    invoke-virtual {v7, v6}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/Float;

    invoke-virtual {v6}, Ljava/lang/Float;->floatValue()F

    move-result v6

    sub-float/2addr v5, v6

    cmpg-float p1, p1, v5

    if-gez p1, :cond_9e

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {p1}, Ljava/lang/Float;->floatValue()F

    move-result p1

    iput p1, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/k3;->g:Z

    :cond_9e
    :goto_9e
    iget-object p1, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    invoke-virtual {p1}, Ljava/lang/Float;->isInfinite()Z

    move-result p1

    if-eqz p1, :cond_af

    const/4 p1, 0x0

    invoke-static {p1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object v5

    iput-object v5, p0, Lcom/google/android/gms/internal/ads/k3;->d:Ljava/lang/Float;

    iput p1, p0, Lcom/google/android/gms/internal/ads/k3;->c:F

    :cond_af
    iget-boolean p1, p0, Lcom/google/android/gms/internal/ads/k3;->g:Z

    if-eqz p1, :cond_e7

    iget-boolean p1, p0, Lcom/google/android/gms/internal/ads/k3;->h:Z

    if-eqz p1, :cond_e7

    const-string p1, "Flick detected."

    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    iput-wide v2, p0, Lcom/google/android/gms/internal/ads/k3;->e:J

    iget p1, p0, Lcom/google/android/gms/internal/ads/k3;->f:I

    add-int/2addr p1, v0

    iput p1, p0, Lcom/google/android/gms/internal/ads/k3;->f:I

    iput-boolean v4, p0, Lcom/google/android/gms/internal/ads/k3;->g:Z

    iput-boolean v4, p0, Lcom/google/android/gms/internal/ads/k3;->h:Z

    iget-object v0, p0, Lcom/google/android/gms/internal/ads/k3;->i:Lz5/kr0;

    if-eqz v0, :cond_e7

    sget-object v2, Lz5/so;->X5:Lz5/no;

    .line 9
    iget-object v1, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 10
    invoke-virtual {v1, v2}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    if-ne p1, v1, :cond_e7

    new-instance p1, Lcom/google/android/gms/internal/ads/o3;

    check-cast v0, Lz5/pr0;

    invoke-direct {p1}, Lcom/google/android/gms/internal/ads/o3;-><init>()V

    sget-object v1, Lcom/google/android/gms/internal/ads/p3;->t:Lcom/google/android/gms/internal/ads/p3;

    invoke-virtual {v0, p1, v1}, Lz5/pr0;->c(Lcom/google/android/gms/internal/ads/b0;Lcom/google/android/gms/internal/ads/p3;)V

    :cond_e7
    return-void
.end method
