apkfuckery/com.discord/smali/com/discord/stores/StoreConnectivity.smali

731 lines
17 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Lcom/discord/stores/StoreConnectivity;
.super Landroid/content/BroadcastReceiver;
.source "StoreConnectivity.java"
# static fields
2019-12-06 03:29:40 +00:00
.field public static final CONNECTING_DELAY_AGGRESSIVE:J = 0xbb8L
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final CONNECTING_DELAY_PASSIVE:J = 0x7530L
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final RECENTLY_FOREGROUNDED_WINDOW:J = 0x7530L
2019-07-24 11:27:29 +00:00
.field public static final STATE_CONNECTING:I = 0x3
.field public static final STATE_OFFLINE:I = 0x2
.field public static final STATE_ONLINE:I = 0x1
# instance fields
2019-12-06 03:29:40 +00:00
.field public final $lock:Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public connectingTransitionTimerSubscription:Lrx/Subscription;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final connectionOpenSubject:Lrx/subjects/Subject;
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/subjects/Subject<",
"Ljava/lang/Boolean;",
"Ljava/lang/Boolean;",
">;"
}
.end annotation
.end field
2019-12-06 03:29:40 +00:00
.field public deviceNetworkOffline:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public optimisticallyConnected:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public recentlyForegrounded:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public recentlyForegroundedClearSubscription:Lrx/Subscription;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public state:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final statePublisher:Lrx/subjects/Subject;
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/subjects/Subject<",
"Ljava/lang/Integer;",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>()V
2019-12-06 03:29:40 +00:00
.locals 3
2019-07-24 11:27:29 +00:00
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
const/4 v0, 0x0
2019-12-06 03:29:40 +00:00
new-array v1, v0, [Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-object v1, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v1, 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-boolean v1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v2, Lrx/subjects/SerializedSubject;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v1}, Lrx/subjects/BehaviorSubject;->a(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v2, v1}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
iput-object v2, p0, Lcom/discord/stores/StoreConnectivity;->statePublisher:Lrx/subjects/Subject;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v1, Lrx/subjects/SerializedSubject;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v0}, Lrx/subjects/BehaviorSubject;->a(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v1, v0}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-object v1, p0, Lcom/discord/stores/StoreConnectivity;->connectionOpenSubject:Lrx/subjects/Subject;
2019-07-24 11:27:29 +00:00
return-void
.end method
.method private handleDeviceConnectivityChange(Z)V
.locals 1
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
if-nez p1, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
:try_start_0
iput-boolean p1, p0, Lcom/discord/stores/StoreConnectivity;->deviceNetworkOffline:Z
invoke-direct {p0}, Lcom/discord/stores/StoreConnectivity;->updateConnectivityState()V
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
2019-12-06 03:29:40 +00:00
.method public static isDeviceConnectedOrConnecting(Landroid/content/Context;)Z
2019-07-24 11:27:29 +00:00
.locals 6
2019-12-06 03:29:40 +00:00
.param p0 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
const-string v0, "connectivity"
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/net/ConnectivityManager;
const/4 v0, 0x0
if-nez p0, :cond_0
return v0
:cond_0
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
move-result-object v1
const/4 v2, 0x1
if-eqz v1, :cond_1
invoke-virtual {v1}, Landroid/net/NetworkInfo;->isConnectedOrConnecting()Z
move-result v1
if-eqz v1, :cond_1
return v2
:cond_1
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getAllNetworks()[Landroid/net/Network;
move-result-object v1
2019-11-20 22:09:14 +00:00
if-eqz v1, :cond_3
2019-07-24 11:27:29 +00:00
array-length v3, v1
const/4 v4, 0x0
:goto_0
2019-11-20 22:09:14 +00:00
if-ge v4, v3, :cond_3
2019-07-24 11:27:29 +00:00
aget-object v5, v1, v4
invoke-virtual {p0, v5}, Landroid/net/ConnectivityManager;->getNetworkInfo(Landroid/net/Network;)Landroid/net/NetworkInfo;
move-result-object v5
if-eqz v5, :cond_2
invoke-virtual {v5}, Landroid/net/NetworkInfo;->isConnectedOrConnecting()Z
move-result v5
if-eqz v5, :cond_2
return v2
:cond_2
add-int/lit8 v4, v4, 0x1
goto :goto_0
:cond_3
return v0
.end method
.method private setRecentlyForegrounded(Z)V
.locals 1
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iput-boolean p1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
.method private setState(I)V
.locals 2
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget v1, p0, Lcom/discord/stores/StoreConnectivity;->state:I
if-ne v1, p1, :cond_0
monitor-exit v0
return-void
:cond_0
iput p1, p0, Lcom/discord/stores/StoreConnectivity;->state:I
iget-object v1, p0, Lcom/discord/stores/StoreConnectivity;->statePublisher:Lrx/subjects/Subject;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
2020-02-20 19:33:18 +00:00
invoke-interface {v1, p1}, Le0/g;->onNext(Ljava/lang/Object;)V
2019-07-24 11:27:29 +00:00
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
.method private transitioningFromRecentlyForegroundedTimer(Z)V
2019-12-06 03:29:40 +00:00
.locals 6
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
if-eqz v0, :cond_0
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
2019-08-14 23:59:34 +00:00
const/4 v0, 0x0
iput-object v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
2019-07-24 11:27:29 +00:00
:cond_0
if-eqz p1, :cond_1
return-void
:cond_1
2019-08-14 23:59:34 +00:00
const-wide/16 v0, 0x7530
2019-07-24 11:27:29 +00:00
sget-object p1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
2019-12-06 03:29:40 +00:00
invoke-static {v0, v1, p1}, Lrx/Observable;->i(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object p1
2020-03-02 06:11:59 +00:00
invoke-static {}, Le/a/b/l;->a()Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
move-result-object v0
invoke-virtual {p1, v0}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
move-result-object p1
2020-01-28 00:59:01 +00:00
new-instance v0, Le/a/h/b;
2019-07-24 11:27:29 +00:00
2020-01-28 00:59:01 +00:00
invoke-direct {v0, p0}, Le/a/h/b;-><init>(Lcom/discord/stores/StoreConnectivity;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-class v1, Lcom/discord/stores/StoreConnectivity;
2019-07-24 11:27:29 +00:00
2020-01-28 00:59:01 +00:00
new-instance v3, Le/a/h/c;
2019-12-06 03:29:40 +00:00
2020-01-28 00:59:01 +00:00
invoke-direct {v3, p0}, Le/a/h/c;-><init>(Lcom/discord/stores/StoreConnectivity;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v4, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v5, 0x10
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v2, 0x0
2020-03-02 06:11:59 +00:00
invoke-static/range {v0 .. v5}, Le/a/b/l;->a(Lrx/functions/Action1;Ljava/lang/Class;Lrx/functions/Action1;Lrx/functions/Action1;Landroid/content/Context;I)Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
move-result-object v0
invoke-virtual {p1, v0}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
return-void
.end method
.method private updateConnectivityState()V
2019-12-06 03:29:40 +00:00
.locals 7
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
if-eqz v0, :cond_0
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
2019-08-14 23:59:34 +00:00
const/4 v0, 0x0
iput-object v0, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
2019-07-24 11:27:29 +00:00
:cond_0
iget-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->deviceNetworkOffline:Z
2019-08-14 23:59:34 +00:00
const/4 v1, 0x2
2019-07-24 11:27:29 +00:00
if-eqz v0, :cond_1
2019-08-14 23:59:34 +00:00
invoke-direct {p0, v1}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_1
iget-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->optimisticallyConnected:Z
if-eqz v0, :cond_2
const/4 v0, 0x1
invoke-direct {p0, v0}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_2
iget v0, p0, Lcom/discord/stores/StoreConnectivity;->state:I
2019-08-14 23:59:34 +00:00
if-ne v0, v1, :cond_3
2019-07-24 11:27:29 +00:00
const/4 v0, 0x3
invoke-direct {p0, v0}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_3
iget-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
if-eqz v0, :cond_4
2019-08-14 23:59:34 +00:00
const-wide/16 v0, 0xbb8
2019-07-24 11:27:29 +00:00
goto :goto_0
:cond_4
2019-08-14 23:59:34 +00:00
const-wide/16 v0, 0x7530
2019-07-24 11:27:29 +00:00
:goto_0
2019-08-14 23:59:34 +00:00
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v0, v1, v2}, Lrx/Observable;->i(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object v0
2020-03-02 06:11:59 +00:00
invoke-static {}, Le/a/b/l;->a()Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
2019-08-14 23:59:34 +00:00
move-result-object v1
2019-07-24 11:27:29 +00:00
2019-08-14 23:59:34 +00:00
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object v0
2020-01-28 00:59:01 +00:00
new-instance v1, Le/a/h/e;
2019-07-24 11:27:29 +00:00
2020-01-28 00:59:01 +00:00
invoke-direct {v1, p0}, Le/a/h/e;-><init>(Lcom/discord/stores/StoreConnectivity;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-class v2, Lcom/discord/stores/StoreConnectivity;
2019-07-24 11:27:29 +00:00
2020-01-28 00:59:01 +00:00
new-instance v4, Le/a/h/d;
2019-07-24 11:27:29 +00:00
2020-01-28 00:59:01 +00:00
invoke-direct {v4, p0}, Le/a/h/d;-><init>(Lcom/discord/stores/StoreConnectivity;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v5, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v6, 0x10
const/4 v3, 0x0
2020-03-02 06:11:59 +00:00
invoke-static/range {v1 .. v6}, Le/a/b/l;->a(Lrx/functions/Action1;Ljava/lang/Class;Lrx/functions/Action1;Lrx/functions/Action1;Landroid/content/Context;I)Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
return-void
.end method
# virtual methods
2019-12-06 03:29:40 +00:00
.method public synthetic a(Ljava/lang/Long;)V
.locals 0
const/4 p1, 0x0
invoke-direct {p0, p1}, Lcom/discord/stores/StoreConnectivity;->setRecentlyForegrounded(Z)V
return-void
.end method
.method public synthetic a(Lrx/Subscription;)V
.locals 0
iput-object p1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
return-void
.end method
.method public synthetic b(Ljava/lang/Long;)V
.locals 0
const/4 p1, 0x3
invoke-direct {p0, p1}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
return-void
.end method
.method public synthetic b(Lrx/Subscription;)V
.locals 0
iput-object p1, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
return-void
.end method
2019-07-24 11:27:29 +00:00
.method public getConnectionOpen()Lrx/Observable;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Ljava/lang/Boolean;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->connectionOpenSubject:Lrx/subjects/Subject;
2020-03-02 06:11:59 +00:00
invoke-static {}, Le/a/b/l;->a()Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
move-result-object v1
2019-12-06 03:29:40 +00:00
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object v0
sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
const-wide/16 v2, 0x64
2019-12-06 03:29:40 +00:00
invoke-virtual {v0, v2, v3, v1}, Lrx/Observable;->c(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object v0
return-object v0
.end method
.method public getState()Lrx/Observable;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->statePublisher:Lrx/subjects/Subject;
2020-03-02 06:11:59 +00:00
invoke-static {}, Le/a/b/l;->a()Lrx/Observable$c;
2019-07-24 11:27:29 +00:00
move-result-object v1
2019-12-06 03:29:40 +00:00
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable;
2019-07-24 11:27:29 +00:00
move-result-object v0
return-object v0
.end method
2019-12-06 03:29:40 +00:00
.method public handleBackgrounded(Z)V
2019-07-24 11:27:29 +00:00
.locals 1
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
invoke-direct {p0, p1}, Lcom/discord/stores/StoreConnectivity;->transitioningFromRecentlyForegroundedTimer(Z)V
if-nez p1, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
iput-boolean p1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
invoke-direct {p0}, Lcom/discord/stores/StoreConnectivity;->updateConnectivityState()V
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
2019-12-06 03:29:40 +00:00
.method public handleConnected(Z)V
2019-07-24 11:27:29 +00:00
.locals 2
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iput-boolean p1, p0, Lcom/discord/stores/StoreConnectivity;->optimisticallyConnected:Z
invoke-direct {p0}, Lcom/discord/stores/StoreConnectivity;->updateConnectivityState()V
if-nez p1, :cond_0
iget-object p1, p0, Lcom/discord/stores/StoreConnectivity;->connectionOpenSubject:Lrx/subjects/Subject;
2019-12-06 03:29:40 +00:00
const/4 v1, 0x0
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v1
2020-02-20 19:33:18 +00:00
invoke-interface {p1, v1}, Le0/g;->onNext(Ljava/lang/Object;)V
2019-07-24 11:27:29 +00:00
:cond_0
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
2019-12-06 03:29:40 +00:00
.method public handleConnectionOpen()V
2019-07-24 11:27:29 +00:00
.locals 3
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget-object v1, p0, Lcom/discord/stores/StoreConnectivity;->connectionOpenSubject:Lrx/subjects/Subject;
2019-12-06 03:29:40 +00:00
const/4 v2, 0x1
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v2
2020-02-20 19:33:18 +00:00
invoke-interface {v1, v2}, Le0/g;->onNext(Ljava/lang/Object;)V
2019-07-24 11:27:29 +00:00
monitor-exit v0
return-void
:catchall_0
move-exception v1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v1
.end method
2019-12-06 03:29:40 +00:00
.method public handleConnectionReady(Z)V
2019-07-24 11:27:29 +00:00
.locals 2
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget-boolean v1, p0, Lcom/discord/stores/StoreConnectivity;->deviceNetworkOffline:Z
if-eqz v1, :cond_0
if-eqz p1, :cond_0
const/4 p1, 0x0
iput-boolean p1, p0, Lcom/discord/stores/StoreConnectivity;->deviceNetworkOffline:Z
:cond_0
invoke-direct {p0}, Lcom/discord/stores/StoreConnectivity;->updateConnectivityState()V
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
2019-12-06 03:29:40 +00:00
.method public init(Landroid/content/Context;)V
2019-07-24 11:27:29 +00:00
.locals 3
2019-12-06 03:29:40 +00:00
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
new-instance v1, Landroid/content/IntentFilter;
const-string v2, "android.net.conn.CONNECTIVITY_CHANGE"
invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p1, p0, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
invoke-static {p1}, Lcom/discord/stores/StoreConnectivity;->isDeviceConnectedOrConnecting(Landroid/content/Context;)Z
move-result p1
invoke-direct {p0, p1}, Lcom/discord/stores/StoreConnectivity;->handleDeviceConnectivityChange(Z)V
monitor-exit v0
return-void
:catchall_0
move-exception p1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p1
.end method
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-static {p1}, Lcom/discord/stores/StoreConnectivity;->isDeviceConnectedOrConnecting(Landroid/content/Context;)Z
move-result p1
invoke-direct {p0, p1}, Lcom/discord/stores/StoreConnectivity;->handleDeviceConnectivityChange(Z)V
return-void
.end method