AutoDownloadNetWorkChangeReceiver.smali

.class public Lio/rong/imkit/voiceMessageDownload/AutoDownloadNetWorkChangeReceiver;
.super Landroid/content/BroadcastReceiver;
.source "AutoDownloadNetWorkChangeReceiver.java"


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

    .line 1
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .registers 4

    const-string v0, "connectivity"

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

    move-result-object p1

    check-cast p1, Landroid/net/ConnectivityManager;

    .line 2
    :try_start_8
    invoke-virtual {p1}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;

    move-result-object p1
    :try_end_c
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_c} :catch_d

    goto :goto_12

    :catch_d
    move-exception p1

    .line 3
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    const/4 p1, 0x0

    :goto_12
    if-eqz p1, :cond_22

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

    move-result v0

    if-eqz v0, :cond_22

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

    move-result p1

    if-eqz p1, :cond_22

    const/4 p1, 0x1

    goto :goto_23

    :cond_22
    const/4 p1, 0x0

    .line 5
    :goto_23
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object p2

    const-string v0, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_39

    if-eqz p1, :cond_39

    .line 6
    invoke-static {}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->getInstance()Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;

    move-result-object p1

    invoke-virtual {p1}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->resumeDownloadService()V

    goto :goto_40

    .line 7
    :cond_39
    invoke-static {}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->getInstance()Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;

    move-result-object p1

    invoke-virtual {p1}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->pauseDownloadService()V

    :goto_40
    return-void
.end method