b.smali

.class public final Lsg/bigo/common/e/b;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lsg/bigo/common/e/a;


# static fields
.field private static f:Lsg/bigo/common/e/b;


# instance fields
.field final a:Landroid/os/Handler;

.field b:Landroid/content/Context;

.field c:Z

.field d:I

.field final e:Ljava/lang/Runnable;

.field private final g:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/ref/WeakReference<",
            "Lsg/bigo/common/e/c;",
            ">;>;"
        }
    .end annotation
.end field

.field private h:Landroid/content/BroadcastReceiver;


# direct methods
.method private constructor <init>()V
    .registers 3

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

    .line 33
    new-instance v0, Lsg/bigo/common/e/b$1;

    invoke-direct {v0, p0}, Lsg/bigo/common/e/b$1;-><init>(Lsg/bigo/common/e/b;)V

    iput-object v0, p0, Lsg/bigo/common/e/b;->h:Landroid/content/BroadcastReceiver;

    .line 171
    new-instance v0, Lsg/bigo/common/e/b$3;

    invoke-direct {v0, p0}, Lsg/bigo/common/e/b$3;-><init>(Lsg/bigo/common/e/b;)V

    iput-object v0, p0, Lsg/bigo/common/e/b;->e:Ljava/lang/Runnable;

    .line 70
    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    .line 71
    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object v0, p0, Lsg/bigo/common/e/b;->a:Landroid/os/Handler;

    return-void
.end method

.method public static a()Lsg/bigo/common/e/a;
    .registers 1

    .line 75
    sget-object v0, Lsg/bigo/common/e/b;->f:Lsg/bigo/common/e/b;

    if-nez v0, :cond_b

    .line 76
    new-instance v0, Lsg/bigo/common/e/b;

    invoke-direct {v0}, Lsg/bigo/common/e/b;-><init>()V

    sput-object v0, Lsg/bigo/common/e/b;->f:Lsg/bigo/common/e/b;

    .line 78
    :cond_b
    sget-object v0, Lsg/bigo/common/e/b;->f:Lsg/bigo/common/e/b;

    return-object v0
.end method

.method static synthetic a(Lsg/bigo/common/e/b;Z)V
    .registers 7

    .line 1149
    iget-object v0, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    monitor-enter v0

    .line 1150
    :try_start_3
    iget-object v1, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

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

    move-result v2

    if-eqz v2, :cond_2c

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

    move-result-object v2

    check-cast v2, Ljava/lang/ref/WeakReference;

    .line 1152
    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lsg/bigo/common/e/c;

    if-eqz v2, :cond_28

    .line 1154
    iget-object v3, p0, Lsg/bigo/common/e/b;->a:Landroid/os/Handler;

    new-instance v4, Lsg/bigo/common/e/b$2;

    invoke-direct {v4, p0, v2, p1}, Lsg/bigo/common/e/b$2;-><init>(Lsg/bigo/common/e/b;Lsg/bigo/common/e/c;Z)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_9

    .line 1165
    :cond_28
    invoke-interface {v1}, Ljava/util/Iterator;->remove()V

    goto :goto_9

    .line 1168
    :cond_2c
    monitor-exit v0

    return-void

    :catchall_2e
    move-exception p0

    monitor-exit v0
    :try_end_30
    .catchall {:try_start_3 .. :try_end_30} :catchall_2e

    goto :goto_32

    :goto_31
    throw p0

    :goto_32
    goto :goto_31
.end method


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

    .line 83
    iget-object v0, p0, Lsg/bigo/common/e/b;->b:Landroid/content/Context;

    if-eqz v0, :cond_5

    return-void

    .line 86
    :cond_5
    iput-object p1, p0, Lsg/bigo/common/e/b;->b:Landroid/content/Context;

    .line 88
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

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

    .line 89
    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 90
    iget-object v1, p0, Lsg/bigo/common/e/b;->h:Landroid/content/BroadcastReceiver;

    invoke-virtual {p1, v1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 92
    iget-object p1, p0, Lsg/bigo/common/e/b;->b:Landroid/content/Context;

    invoke-static {p1}, Lsg/bigo/opensdk/d/g;->a(Landroid/content/Context;)Z

    move-result p1

    iput-boolean p1, p0, Lsg/bigo/common/e/b;->c:Z

    .line 93
    iget-object p1, p0, Lsg/bigo/common/e/b;->b:Landroid/content/Context;

    invoke-static {p1}, Lsg/bigo/opensdk/d/g;->c(Landroid/content/Context;)I

    move-result p1

    iput p1, p0, Lsg/bigo/common/e/b;->d:I

    return-void
.end method

.method public final a(Lsg/bigo/common/e/c;)V
    .registers 5

    if-nez p1, :cond_3

    return-void

    .line 120
    :cond_3
    iget-object v0, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    monitor-enter v0

    .line 121
    :try_start_6
    iget-object v1, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

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

    move-result v2

    if-eqz v2, :cond_24

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

    move-result-object v2

    check-cast v2, Ljava/lang/ref/WeakReference;

    .line 122
    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {p1, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_c

    .line 123
    monitor-exit v0

    return-void

    .line 126
    :cond_24
    iget-object v1, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    new-instance v2, Ljava/lang/ref/WeakReference;

    invoke-direct {v2, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 127
    monitor-exit v0

    return-void

    :catchall_30
    move-exception p1

    monitor-exit v0
    :try_end_32
    .catchall {:try_start_6 .. :try_end_32} :catchall_30

    goto :goto_34

    :goto_33
    throw p1

    :goto_34
    goto :goto_33
.end method

.method public final b(Lsg/bigo/common/e/c;)V
    .registers 6

    if-nez p1, :cond_3

    return-void

    .line 135
    :cond_3
    iget-object v0, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    monitor-enter v0

    .line 136
    :try_start_6
    iget-object v1, p0, Lsg/bigo/common/e/b;->g:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 137
    :cond_c
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_2a

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

    move-result-object v2

    check-cast v2, Ljava/lang/ref/WeakReference;

    .line 139
    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {p1, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_c

    .line 140
    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->clear()V

    .line 141
    invoke-interface {v1}, Ljava/util/Iterator;->remove()V

    .line 142
    monitor-exit v0

    return-void

    .line 145
    :cond_2a
    monitor-exit v0

    return-void

    :catchall_2c
    move-exception p1

    monitor-exit v0
    :try_end_2e
    .catchall {:try_start_6 .. :try_end_2e} :catchall_2c

    goto :goto_30

    :goto_2f
    throw p1

    :goto_30
    goto :goto_2f
.end method