.class public Ls1/e;
.super Ls1/d;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Ls1/e$a;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ls1/d<",
        "Lq1/b;",
        ">;"
    }
.end annotation


# static fields
.field public static final i:Ljava/lang/String;


# instance fields
.field public final g:Landroid/net/ConnectivityManager;

.field public h:Ls1/e$a;


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

    const-string v0, "NetworkStateTracker"

    invoke-static {v0}, Ll1/i;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Ls1/e;->i:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lx1/a;)V
    .registers 3

    invoke-direct {p0, p1, p2}, Ls1/d;-><init>(Landroid/content/Context;Lx1/a;)V

    iget-object p1, p0, Ls1/d;->b:Landroid/content/Context;

    const-string p2, "connectivity"

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

    move-result-object p1

    check-cast p1, Landroid/net/ConnectivityManager;

    iput-object p1, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    new-instance p1, Ls1/e$a;

    invoke-direct {p1, p0}, Ls1/e$a;-><init>(Ls1/e;)V

    iput-object p1, p0, Ls1/e;->h:Ls1/e$a;

    return-void
.end method


# virtual methods
.method public a()Ljava/lang/Object;
    .registers 2

    .line 1
    invoke-virtual {p0}, Ls1/e;->f()Lq1/b;

    move-result-object v0

    return-object v0
.end method

.method public d()V
    .registers 6

    const/4 v0, 0x0

    :try_start_1
    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v1

    sget-object v2, Ls1/e;->i:Ljava/lang/String;

    const-string v3, "Registering network callback"

    new-array v4, v0, [Ljava/lang/Throwable;

    invoke-virtual {v1, v2, v3, v4}, Ll1/i;->a(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    iget-object v1, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    iget-object v2, p0, Ls1/e;->h:Ls1/e$a;

    invoke-virtual {v1, v2}, Landroid/net/ConnectivityManager;->registerDefaultNetworkCallback(Landroid/net/ConnectivityManager$NetworkCallback;)V
    :try_end_15
    .catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_15} :catch_18
    .catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_15} :catch_16

    goto :goto_29

    :catch_16
    move-exception v1

    goto :goto_19

    :catch_18
    move-exception v1

    :goto_19
    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v2

    sget-object v3, Ls1/e;->i:Ljava/lang/String;

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Throwable;

    aput-object v1, v4, v0

    const-string v0, "Received exception while registering network callback"

    invoke-virtual {v2, v3, v0, v4}, Ll1/i;->b(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    :goto_29
    return-void
.end method

.method public e()V
    .registers 6

    const/4 v0, 0x0

    :try_start_1
    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v1

    sget-object v2, Ls1/e;->i:Ljava/lang/String;

    const-string v3, "Unregistering network callback"

    new-array v4, v0, [Ljava/lang/Throwable;

    invoke-virtual {v1, v2, v3, v4}, Ll1/i;->a(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    iget-object v1, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    iget-object v2, p0, Ls1/e;->h:Ls1/e$a;

    invoke-virtual {v1, v2}, Landroid/net/ConnectivityManager;->unregisterNetworkCallback(Landroid/net/ConnectivityManager$NetworkCallback;)V
    :try_end_15
    .catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_15} :catch_18
    .catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_15} :catch_16

    goto :goto_29

    :catch_16
    move-exception v1

    goto :goto_19

    :catch_18
    move-exception v1

    :goto_19
    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v2

    sget-object v3, Ls1/e;->i:Ljava/lang/String;

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Throwable;

    aput-object v1, v4, v0

    const-string v0, "Received exception while unregistering network callback"

    invoke-virtual {v2, v3, v0, v4}, Ll1/i;->b(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    :goto_29
    return-void
.end method

.method public f()Lq1/b;
    .registers 9

    iget-object v0, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;

    move-result-object v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-eqz v0, :cond_12

    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z

    move-result v3

    if-eqz v3, :cond_12

    move v3, v1

    goto :goto_13

    :cond_12
    move v3, v2

    .line 1
    :goto_13
    :try_start_13
    iget-object v4, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    invoke-virtual {v4}, Landroid/net/ConnectivityManager;->getActiveNetwork()Landroid/net/Network;

    move-result-object v4

    iget-object v5, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    invoke-virtual {v5, v4}, Landroid/net/ConnectivityManager;->getNetworkCapabilities(Landroid/net/Network;)Landroid/net/NetworkCapabilities;

    move-result-object v4

    if-eqz v4, :cond_2b

    const/16 v5, 0x10

    invoke-virtual {v4, v5}, Landroid/net/NetworkCapabilities;->hasCapability(I)Z

    move-result v4
    :try_end_27
    .catch Ljava/lang/SecurityException; {:try_start_13 .. :try_end_27} :catch_2d

    if-eqz v4, :cond_2b

    move v4, v1

    goto :goto_3e

    :cond_2b
    :goto_2b
    move v4, v2

    goto :goto_3e

    :catch_2d
    move-exception v4

    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v5

    sget-object v6, Ls1/e;->i:Ljava/lang/String;

    new-array v7, v1, [Ljava/lang/Throwable;

    aput-object v4, v7, v2

    const-string v4, "Unable to validate active network"

    invoke-virtual {v5, v6, v4, v7}, Ll1/i;->b(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    goto :goto_2b

    .line 2
    :goto_3e
    iget-object v5, p0, Ls1/e;->g:Landroid/net/ConnectivityManager;

    .line 3
    invoke-virtual {v5}, Landroid/net/ConnectivityManager;->isActiveNetworkMetered()Z

    move-result v5

    if-eqz v0, :cond_4d

    .line 4
    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isRoaming()Z

    move-result v0

    if-nez v0, :cond_4d

    goto :goto_4e

    :cond_4d
    move v1, v2

    :goto_4e
    new-instance v0, Lq1/b;

    invoke-direct {v0, v3, v4, v5, v1}, Lq1/b;-><init>(ZZZZ)V

    return-object v0
.end method
