747 lines
18 KiB
Smali
747 lines
18 KiB
Smali
.class public Lcom/discord/stores/StoreConnectivity;
|
|
.super Landroid/content/BroadcastReceiver;
|
|
.source "StoreConnectivity.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final CONNECTING_DELAY_AGGRESSIVE:J = 0xbb8L
|
|
|
|
.field private static final CONNECTING_DELAY_PASSIVE:J = 0x7530L
|
|
|
|
.field private static final RECENTLY_FOREGROUNDED_WINDOW:J = 0x7530L
|
|
|
|
.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
|
|
.field private final $lock:Ljava/lang/Object;
|
|
|
|
.field private connectingTransitionTimerSubscription:Lrx/Subscription;
|
|
|
|
.field private final connectionOpenSubject:Lrx/subjects/Subject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/Subject<",
|
|
"Ljava/lang/Boolean;",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private deviceNetworkOffline:Z
|
|
|
|
.field private optimisticallyConnected:Z
|
|
|
|
.field private recentlyForegrounded:Z
|
|
|
|
.field private recentlyForegroundedClearSubscription:Lrx/Subscription;
|
|
|
|
.field private state:I
|
|
|
|
.field private final statePublisher:Lrx/subjects/Subject;
|
|
.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
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreConnectivity;->$lock:Ljava/lang/Object;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
|
|
|
|
new-instance v1, Lrx/subjects/SerializedSubject;
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lrx/subjects/BehaviorSubject;->bJ(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
|
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreConnectivity;->statePublisher:Lrx/subjects/Subject;
|
|
|
|
new-instance v0, Lrx/subjects/SerializedSubject;
|
|
|
|
sget-object v1, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
|
|
|
invoke-static {v1}, Lrx/subjects/BehaviorSubject;->bJ(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreConnectivity;->connectionOpenSubject:Lrx/subjects/Subject;
|
|
|
|
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
|
|
|
|
.method private static isDeviceConnectedOrConnecting(Landroid/content/Context;)Z
|
|
.locals 6
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
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
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v3, 0x15
|
|
|
|
if-lt v1, v3, :cond_3
|
|
|
|
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getAllNetworks()[Landroid/net/Network;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
array-length v3, v1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
if-ge v4, v3, :cond_5
|
|
|
|
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
|
|
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getAllNetworkInfo()[Landroid/net/NetworkInfo;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_5
|
|
|
|
array-length v1, p0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-ge v3, v1, :cond_5
|
|
|
|
aget-object v4, p0, v3
|
|
|
|
invoke-virtual {v4}, Landroid/net/NetworkInfo;->isConnectedOrConnecting()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
return v2
|
|
|
|
:cond_4
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
return v0
|
|
.end method
|
|
|
|
.method public static synthetic lambda$transitioningFromRecentlyForegroundedTimer$0(Lcom/discord/stores/StoreConnectivity;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 static synthetic lambda$transitioningFromRecentlyForegroundedTimer$1(Lcom/discord/stores/StoreConnectivity;Lrx/Subscription;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic lambda$updateConnectivityState$2(Lcom/discord/stores/StoreConnectivity;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 static synthetic lambda$updateConnectivityState$3(Lcom/discord/stores/StoreConnectivity;Lrx/Subscription;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
|
|
|
|
return-void
|
|
.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
|
|
|
|
invoke-virtual {v1, p1}, Lrx/subjects/Subject;->onNext(Ljava/lang/Object;)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 private transitioningFromRecentlyForegroundedTimer(Z)V
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegroundedClearSubscription:Lrx/Subscription;
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-wide/16 v2, 0x7530
|
|
|
|
sget-object p1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-static {v2, v3, p1}, Lrx/Observable;->g(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dw()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/stores/-$$Lambda$StoreConnectivity$79aIJOcQmCfX1F90-CNcEZoWnYs;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/stores/-$$Lambda$StoreConnectivity$79aIJOcQmCfX1F90-CNcEZoWnYs;-><init>(Lcom/discord/stores/StoreConnectivity;)V
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Lcom/discord/stores/-$$Lambda$StoreConnectivity$C_XVkbMCWWTYOqVJvSDysjsWsbM;
|
|
|
|
invoke-direct {v3, p0}, Lcom/discord/stores/-$$Lambda$StoreConnectivity$C_XVkbMCWWTYOqVJvSDysjsWsbM;-><init>(Lcom/discord/stores/StoreConnectivity;)V
|
|
|
|
invoke-static {v0, v2, v1, v3}, Lcom/discord/app/g;->a(Lrx/functions/Action1;Ljava/lang/Class;Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateConnectivityState()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreConnectivity;->connectingTransitionTimerSubscription:Lrx/Subscription;
|
|
|
|
:cond_0
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->deviceNetworkOffline:Z
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-direct {p0, v2}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
|
|
|
|
return-void
|
|
|
|
: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
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
iget v0, p0, Lcom/discord/stores/StoreConnectivity;->state:I
|
|
|
|
if-ne v0, v2, :cond_3
|
|
|
|
const/4 v0, 0x3
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/stores/StoreConnectivity;->setState(I)V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreConnectivity;->recentlyForegrounded:Z
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
const-wide/16 v2, 0xbb8
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const-wide/16 v2, 0x7530
|
|
|
|
:goto_0
|
|
sget-object v0, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-static {v2, v3, v0}, Lrx/Observable;->g(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dw()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v2, Lcom/discord/stores/-$$Lambda$StoreConnectivity$bqB_JVF9opveP9LnaHRK5TVznvU;
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/stores/-$$Lambda$StoreConnectivity$bqB_JVF9opveP9LnaHRK5TVznvU;-><init>(Lcom/discord/stores/StoreConnectivity;)V
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
new-instance v4, Lcom/discord/stores/-$$Lambda$StoreConnectivity$aAv_OyA6TWT6wsnPR8HFfoP8ZKY;
|
|
|
|
invoke-direct {v4, p0}, Lcom/discord/stores/-$$Lambda$StoreConnectivity$aAv_OyA6TWT6wsnPR8HFfoP8ZKY;-><init>(Lcom/discord/stores/StoreConnectivity;)V
|
|
|
|
invoke-static {v2, v3, v1, v4}, Lcom/discord/app/g;->a(Lrx/functions/Action1;Ljava/lang/Class;Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.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;
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dw()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/Subject;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v2, 0x64
|
|
|
|
invoke-virtual {v0, v2, v3, v1}, Lrx/Observable;->j(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
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;
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dw()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/Subject;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method handleBackgrounded(Z)V
|
|
.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
|
|
|
|
.method handleConnected(Z)V
|
|
.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;
|
|
|
|
sget-object v1, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
|
|
|
invoke-virtual {p1, v1}, Lrx/subjects/Subject;->onNext(Ljava/lang/Object;)V
|
|
|
|
: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
|
|
|
|
.method handleConnectionOpen()V
|
|
.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;
|
|
|
|
sget-object v2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
|
|
|
|
invoke-virtual {v1, v2}, Lrx/subjects/Subject;->onNext(Ljava/lang/Object;)V
|
|
|
|
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
|
|
|
|
.method handleConnectionReady(Z)V
|
|
.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
|
|
|
|
.method init(Landroid/content/Context;)V
|
|
.locals 3
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
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
|