NetworkChangeNotifier.smali

.class public Laegon/chrome/net/NetworkChangeNotifier;
.super Ljava/lang/Object;


# annotations
.annotation runtime Laegon/chrome/base/annotations/JNINamespace;
    value = "net"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;
    }
.end annotation


# static fields
.field static final synthetic $assertionsDisabled:Z

.field private static sInstance:Laegon/chrome/net/NetworkChangeNotifier;
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "StaticFieldLeak"
        }
    .end annotation
.end field


# instance fields
.field private mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

.field private final mConnectionTypeObservers:Laegon/chrome/base/ObserverList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Laegon/chrome/base/ObserverList",
            "<",
            "Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;",
            ">;"
        }
    .end annotation
.end field

.field private final mConnectivityManager:Landroid/net/ConnectivityManager;

.field private mCurrentConnectionType:I

.field private final mNativeChangeNotifiers:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/Long;",
            ">;"
        }
    .end annotation
.end field


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

    const-class v0, Laegon/chrome/net/NetworkChangeNotifier;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    if-nez v0, :cond_c

    const/4 v0, 0x1

    :goto_9
    sput-boolean v0, Laegon/chrome/net/NetworkChangeNotifier;->$assertionsDisabled:Z

    return-void

    :cond_c
    const/4 v0, 0x0

    goto :goto_9
.end method

.method protected constructor <init>()V
    .registers 3
    .annotation build Laegon/chrome/base/VisibleForTesting;
    .end annotation

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

    const/4 v0, 0x0

    iput v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mCurrentConnectionType:I

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    new-instance v0, Laegon/chrome/base/ObserverList;

    invoke-direct {v0}, Laegon/chrome/base/ObserverList;-><init>()V

    iput-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectionTypeObservers:Laegon/chrome/base/ObserverList;

    invoke-static {}, Laegon/chrome/base/ContextUtils;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "connectivity"

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

    move-result-object v0

    check-cast v0, Landroid/net/ConnectivityManager;

    iput-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectivityManager:Landroid/net/ConnectivityManager;

    return-void
.end method

.method static synthetic access$000(Laegon/chrome/net/NetworkChangeNotifier;I)V
    .registers 2

    invoke-direct {p0, p1}, Laegon/chrome/net/NetworkChangeNotifier;->updateCurrentConnectionType(I)V

    return-void
.end method

.method public static addConnectionTypeObserver(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V
    .registers 2

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-direct {v0, p0}, Laegon/chrome/net/NetworkChangeNotifier;->addConnectionTypeObserverInternal(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V

    return-void
.end method

.method private addConnectionTypeObserverInternal(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V
    .registers 3

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectionTypeObservers:Laegon/chrome/base/ObserverList;

    invoke-virtual {v0, p1}, Laegon/chrome/base/ObserverList;->addObserver(Ljava/lang/Object;)Z

    return-void
.end method

.method private destroyAutoDetector()V
    .registers 2

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-eqz v0, :cond_c

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->destroy()V

    const/4 v0, 0x0

    iput-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    :cond_c
    return-void
.end method

.method public static fakeConnectionSubtypeChanged(I)V
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0, p0}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionSubtypeChange(I)V

    return-void
.end method

.method public static fakeDefaultNetwork(JI)V
    .registers 5
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-direct {v0, p2, p0, p1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionTypeChange(IJ)V

    return-void
.end method

.method public static fakeNetworkConnected(JI)V
    .registers 5
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0, p0, p1, p2}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfNetworkConnect(JI)V

    return-void
.end method

.method public static fakeNetworkDisconnected(J)V
    .registers 4
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0, p0, p1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfNetworkDisconnect(J)V

    return-void
.end method

.method public static fakeNetworkSoonToBeDisconnected(J)V
    .registers 4
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0, p0, p1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfNetworkSoonToDisconnect(J)V

    return-void
.end method

.method public static fakePurgeActiveNetworkList([J)V
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0, p0}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversToPurgeActiveNetworkList([J)V

    return-void
.end method

.method public static forceConnectivityState(Z)V
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    invoke-static {v0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityState(Z)V

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-direct {v0, p0}, Laegon/chrome/net/NetworkChangeNotifier;->forceConnectivityStateInternal(Z)V

    return-void
.end method

.method private forceConnectivityStateInternal(Z)V
    .registers 6

    const/4 v0, 0x6

    const/4 v2, 0x1

    const/4 v1, 0x0

    iget v3, p0, Laegon/chrome/net/NetworkChangeNotifier;->mCurrentConnectionType:I

    if-eq v3, v0, :cond_16

    move v3, v2

    :goto_8
    if-eq v3, p1, :cond_15

    if-eqz p1, :cond_d

    move v0, v1

    :cond_d
    invoke-direct {p0, v0}, Laegon/chrome/net/NetworkChangeNotifier;->updateCurrentConnectionType(I)V

    if-eqz p1, :cond_18

    :goto_12
    invoke-virtual {p0, v1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionSubtypeChange(I)V

    :cond_15
    return-void

    :cond_16
    move v3, v1

    goto :goto_8

    :cond_18
    move v1, v2

    goto :goto_12
.end method

.method public static getAutoDetectorForTest()Laegon/chrome/net/NetworkChangeNotifierAutoDetect;
    .registers 1

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    iget-object v0, v0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    return-object v0
.end method

.method public static getInstance()Laegon/chrome/net/NetworkChangeNotifier;
    .registers 1

    sget-boolean v0, Laegon/chrome/net/NetworkChangeNotifier;->$assertionsDisabled:Z

    if-nez v0, :cond_e

    sget-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    if-nez v0, :cond_e

    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    :cond_e
    sget-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    return-object v0
.end method

.method public static init()Laegon/chrome/net/NetworkChangeNotifier;
    .registers 1
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    sget-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    if-nez v0, :cond_b

    new-instance v0, Laegon/chrome/net/NetworkChangeNotifier;

    invoke-direct {v0}, Laegon/chrome/net/NetworkChangeNotifier;-><init>()V

    sput-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    :cond_b
    sget-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    return-object v0
.end method

.method public static isInitialized()Z
    .registers 1

    sget-object v0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    if-eqz v0, :cond_6

    const/4 v0, 0x1

    :goto_5
    return v0

    :cond_6
    const/4 v0, 0x0

    goto :goto_5
.end method

.method public static isOnline()Z
    .registers 2

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifier;->getCurrentConnectionType()I

    move-result v0

    const/4 v1, 0x6

    if-eq v0, v1, :cond_d

    const/4 v0, 0x1

    :goto_c
    return v0

    :cond_d
    const/4 v0, 0x0

    goto :goto_c
.end method

.method public static isProcessBoundToNetwork()Z
    .registers 1
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-direct {v0}, Laegon/chrome/net/NetworkChangeNotifier;->isProcessBoundToNetworkInternal()Z

    move-result v0

    return v0
.end method

.method private isProcessBoundToNetworkInternal()Z
    .registers 5

    const/4 v0, 0x1

    const/4 v1, 0x0

    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0x15

    if-ge v2, v3, :cond_a

    move v0, v1

    :cond_9
    :goto_9
    return v0

    :cond_a
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0x17

    if-ge v2, v3, :cond_18

    invoke-static {}, Landroid/net/ConnectivityManager;->getProcessDefaultNetwork()Landroid/net/Network;

    move-result-object v2

    if-nez v2, :cond_9

    move v0, v1

    goto :goto_9

    :cond_18
    iget-object v2, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectivityManager:Landroid/net/ConnectivityManager;

    invoke-static {v2}, Laegon/chrome/base/compat/ApiHelperForM;->getBoundNetworkForProcess(Landroid/net/ConnectivityManager;)Landroid/net/Network;

    move-result-object v2

    if-nez v2, :cond_9

    move v0, v1

    goto :goto_9
.end method

.method private native nativeNotifyConnectionTypeChanged(JIJ)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private native nativeNotifyMaxBandwidthChanged(JI)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private native nativeNotifyOfNetworkConnect(JJI)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private native nativeNotifyOfNetworkDisconnect(JJ)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private native nativeNotifyOfNetworkSoonToDisconnect(JJ)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private native nativeNotifyPurgeActiveNetworkList(J[J)V
    .annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
        value = "NetworkChangeNotifierDelegateAndroid"
    .end annotation
.end method

.method private notifyObserversOfConnectionTypeChange(IJ)V
    .registers 12

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v6

    :goto_6
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1d

    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    move-object v0, p0

    move v3, p1

    move-wide v4, p2

    invoke-direct/range {v0 .. v5}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyConnectionTypeChanged(JIJ)V

    goto :goto_6

    :cond_1d
    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectionTypeObservers:Laegon/chrome/base/ObserverList;

    invoke-virtual {v0}, Laegon/chrome/base/ObserverList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_23
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_33

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;

    invoke-interface {v0, p1}, Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;->onConnectionTypeChanged(I)V

    goto :goto_23

    :cond_33
    return-void
.end method

.method public static registerToReceiveNotificationsAlways()V
    .registers 3

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    const/4 v1, 0x1

    new-instance v2, Laegon/chrome/net/RegistrationPolicyAlwaysRegister;

    invoke-direct {v2}, Laegon/chrome/net/RegistrationPolicyAlwaysRegister;-><init>()V

    invoke-direct {v0, v1, v2}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityStateInternal(ZLaegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V

    return-void
.end method

.method public static removeConnectionTypeObserver(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V
    .registers 2

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    invoke-direct {v0, p0}, Laegon/chrome/net/NetworkChangeNotifier;->removeConnectionTypeObserverInternal(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V

    return-void
.end method

.method private removeConnectionTypeObserverInternal(Laegon/chrome/net/NetworkChangeNotifier$ConnectionTypeObserver;)V
    .registers 3

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mConnectionTypeObservers:Laegon/chrome/base/ObserverList;

    invoke-virtual {v0, p1}, Laegon/chrome/base/ObserverList;->removeObserver(Ljava/lang/Object;)Z

    return-void
.end method

.method static resetInstanceForTests(Laegon/chrome/net/NetworkChangeNotifier;)V
    .registers 1

    sput-object p0, Laegon/chrome/net/NetworkChangeNotifier;->sInstance:Laegon/chrome/net/NetworkChangeNotifier;

    return-void
.end method

.method public static setAutoDetectConnectivityState(Laegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V
    .registers 3

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    const/4 v1, 0x1

    invoke-direct {v0, v1, p0}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityStateInternal(ZLaegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V

    return-void
.end method

.method public static setAutoDetectConnectivityState(Z)V
    .registers 3

    invoke-static {}, Laegon/chrome/net/NetworkChangeNotifier;->getInstance()Laegon/chrome/net/NetworkChangeNotifier;

    move-result-object v0

    new-instance v1, Laegon/chrome/net/RegistrationPolicyApplicationStatus;

    invoke-direct {v1}, Laegon/chrome/net/RegistrationPolicyApplicationStatus;-><init>()V

    invoke-direct {v0, p0, v1}, Laegon/chrome/net/NetworkChangeNotifier;->setAutoDetectConnectivityStateInternal(ZLaegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V

    return-void
.end method

.method private setAutoDetectConnectivityStateInternal(ZLaegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V
    .registers 5

    if-eqz p1, :cond_27

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-nez v0, :cond_26

    new-instance v0, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    new-instance v1, Laegon/chrome/net/NetworkChangeNotifier$1;

    invoke-direct {v1, p0}, Laegon/chrome/net/NetworkChangeNotifier$1;-><init>(Laegon/chrome/net/NetworkChangeNotifier;)V

    invoke-direct {v0, v1, p2}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;-><init>(Laegon/chrome/net/NetworkChangeNotifierAutoDetect$Observer;Laegon/chrome/net/NetworkChangeNotifierAutoDetect$RegistrationPolicy;)V

    iput-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->getCurrentNetworkState()Laegon/chrome/net/NetworkChangeNotifierAutoDetect$NetworkState;

    move-result-object v0

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect$NetworkState;->getConnectionType()I

    move-result v1

    invoke-direct {p0, v1}, Laegon/chrome/net/NetworkChangeNotifier;->updateCurrentConnectionType(I)V

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect$NetworkState;->getConnectionSubtype()I

    move-result v0

    invoke-virtual {p0, v0}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionSubtypeChange(I)V

    :cond_26
    :goto_26
    return-void

    :cond_27
    invoke-direct {p0}, Laegon/chrome/net/NetworkChangeNotifier;->destroyAutoDetector()V

    goto :goto_26
.end method

.method private updateCurrentConnectionType(I)V
    .registers 2

    iput p1, p0, Laegon/chrome/net/NetworkChangeNotifier;->mCurrentConnectionType:I

    invoke-virtual {p0, p1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionTypeChange(I)V

    return-void
.end method


# virtual methods
.method public addNativeObserver(J)V
    .registers 6
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public getCurrentConnectionSubtype()I
    .registers 3
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    const/4 v0, 0x0

    :try_start_1
    iget-object v1, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-nez v1, :cond_6

    :goto_5
    return v0

    :cond_6
    iget-object v1, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v1}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->getCurrentNetworkState()Laegon/chrome/net/NetworkChangeNotifierAutoDetect$NetworkState;

    move-result-object v1

    invoke-virtual {v1}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect$NetworkState;->getConnectionSubtype()I
    :try_end_f
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_f} :catch_11

    move-result v0

    goto :goto_5

    :catch_11
    move-exception v1

    goto :goto_5
.end method

.method public getCurrentConnectionType()I
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mCurrentConnectionType:I

    return v0
.end method

.method public getCurrentDefaultNetId()J
    .registers 3
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-nez v0, :cond_7

    const-wide/16 v0, -0x1

    :goto_6
    return-wide v0

    :cond_7
    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->getDefaultNetId()J

    move-result-wide v0

    goto :goto_6
.end method

.method public getCurrentNetworksAndTypes()[J
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-nez v0, :cond_8

    const/4 v0, 0x0

    new-array v0, v0, [J

    :goto_7
    return-object v0

    :cond_8
    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->getNetworksAndTypes()[J

    move-result-object v0

    goto :goto_7
.end method

.method notifyObserversOfConnectionSubtypeChange(I)V
    .registers 6

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p1}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyMaxBandwidthChanged(JI)V

    goto :goto_6

    :cond_1a
    return-void
.end method

.method notifyObserversOfConnectionTypeChange(I)V
    .registers 4

    invoke-virtual {p0}, Laegon/chrome/net/NetworkChangeNotifier;->getCurrentDefaultNetId()J

    move-result-wide v0

    invoke-direct {p0, p1, v0, v1}, Laegon/chrome/net/NetworkChangeNotifier;->notifyObserversOfConnectionTypeChange(IJ)V

    return-void
.end method

.method notifyObserversOfNetworkConnect(JI)V
    .registers 13

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v7

    :goto_6
    invoke-interface {v7}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1d

    invoke-interface {v7}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    move-object v1, p0

    move-wide v4, p1

    move v6, p3

    invoke-direct/range {v1 .. v6}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyOfNetworkConnect(JJI)V

    goto :goto_6

    :cond_1d
    return-void
.end method

.method notifyObserversOfNetworkDisconnect(J)V
    .registers 8

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p1, p2}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyOfNetworkDisconnect(JJ)V

    goto :goto_6

    :cond_1a
    return-void
.end method

.method notifyObserversOfNetworkSoonToDisconnect(J)V
    .registers 8

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p1, p2}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyOfNetworkSoonToDisconnect(JJ)V

    goto :goto_6

    :cond_1a
    return-void
.end method

.method notifyObserversToPurgeActiveNetworkList([J)V
    .registers 6

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-direct {p0, v2, v3, p1}, Laegon/chrome/net/NetworkChangeNotifier;->nativeNotifyPurgeActiveNetworkList(J[J)V

    goto :goto_6

    :cond_1a
    return-void
.end method

.method public registerNetworkCallbackFailed()Z
    .registers 2
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    if-nez v0, :cond_6

    const/4 v0, 0x0

    :goto_5
    return v0

    :cond_6
    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mAutoDetector:Laegon/chrome/net/NetworkChangeNotifierAutoDetect;

    invoke-virtual {v0}, Laegon/chrome/net/NetworkChangeNotifierAutoDetect;->registerNetworkCallbackFailed()Z

    move-result v0

    goto :goto_5
.end method

.method public removeNativeObserver(J)V
    .registers 6
    .annotation build Laegon/chrome/base/annotations/CalledByNative;
    .end annotation

    iget-object v0, p0, Laegon/chrome/net/NetworkChangeNotifier;->mNativeChangeNotifiers:Ljava/util/ArrayList;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    return-void
.end method