1110 lines
30 KiB
Smali
1110 lines
30 KiB
Smali
.class public final Lcom/discord/stores/StoreNotices;
|
|
.super Lcom/discord/stores/Store;
|
|
.source "StoreNotices.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/StoreNotices$Notice;,
|
|
Lcom/discord/stores/StoreNotices$PassiveNotice;,
|
|
Lcom/discord/stores/StoreNotices$Dialog;,
|
|
Lcom/discord/stores/StoreNotices$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/stores/StoreNotices$Companion;
|
|
|
|
.field public static final PRIORITY_HIGH:I = 0x0
|
|
|
|
.field public static final PRIORITY_INAPP_NOTIFICATION:I = 0x1
|
|
|
|
.field public static final PRIORITY_PASSIVE_NOTICE:I = 0xa
|
|
|
|
.field public static final PRIORITY_USER_SURVEY:I = 0x5
|
|
|
|
.field public static final PROCESS_PERIOD_MS:J = 0x7530L
|
|
|
|
.field public static final PROCESS_THROTTLE_MS:J = 0x32L
|
|
|
|
|
|
# instance fields
|
|
.field public final clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
.field public final firstUseTimestamp$delegate:Lkotlin/Lazy;
|
|
|
|
.field public lastShownTimes:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Integer;",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final noticePublisher:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Lcom/discord/stores/StoreNotices$Notice;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final noticeQueue:Ljava/util/PriorityQueue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/PriorityQueue<",
|
|
"Lcom/discord/stores/StoreNotices$Notice;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/persister/Persister<",
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public pollRateMs:J
|
|
|
|
.field public final processTrigger:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final stream:Lcom/discord/stores/StoreStream;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreNotices$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/stores/StoreNotices$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/stores/StoreNotices;->Companion:Lcom/discord/stores/StoreNotices$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/discord/utilities/time/Clock;Lcom/discord/stores/StoreStream;)V
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/Store;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreNotices;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
new-instance p1, Lcom/discord/utilities/persister/Persister;
|
|
|
|
new-instance p2, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p2}, Ljava/util/HashMap;-><init>()V
|
|
|
|
const-string v1, "NOTICES_SHOWN_V2"
|
|
|
|
invoke-direct {p1, v1, p2}, Lcom/discord/utilities/persister/Persister;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
new-instance p1, Ljava/util/PriorityQueue;
|
|
|
|
const/16 p2, 0xb
|
|
|
|
const/4 v1, 0x3
|
|
|
|
new-array v1, v1, [Lkotlin/jvm/functions/Function1;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
sget-object v3, Lcom/discord/stores/StoreNotices$noticeQueue$1;->INSTANCE:Lcom/discord/stores/StoreNotices$noticeQueue$1;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const/4 v2, 0x1
|
|
|
|
sget-object v3, Lcom/discord/stores/StoreNotices$noticeQueue$2;->INSTANCE:Lcom/discord/stores/StoreNotices$noticeQueue$2;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const/4 v2, 0x2
|
|
|
|
sget-object v3, Lcom/discord/stores/StoreNotices$noticeQueue$3;->INSTANCE:Lcom/discord/stores/StoreNotices$noticeQueue$3;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
invoke-static {v1}, Lj0/i/u;->compareBy([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {p1, p2, v1}, Ljava/util/PriorityQueue;-><init>(ILjava/util/Comparator;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
const-wide/16 p1, 0x7530
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreNotices;->pollRateMs:J
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->lastShownTimes:Ljava/util/HashMap;
|
|
|
|
invoke-static {}, Lrx/subjects/BehaviorSubject;->e0()Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "BehaviorSubject.create()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->processTrigger:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-static {v0}, Lrx/subjects/BehaviorSubject;->f0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "BehaviorSubject.create(null as Notice?)"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->noticePublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreNotices$firstUseTimestamp$2;
|
|
|
|
invoke-direct {p1, p0}, Lcom/discord/stores/StoreNotices$firstUseTimestamp$2;-><init>(Lcom/discord/stores/StoreNotices;)V
|
|
|
|
invoke-static {p1}, Lf/i/a/b/i1/e;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreNotices;->firstUseTimestamp$delegate:Lkotlin/Lazy;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "stream"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "clock"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getClock$p(Lcom/discord/stores/StoreNotices;)Lcom/discord/utilities/time/Clock;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreNotices;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getNoticeQueue$p(Lcom/discord/stores/StoreNotices;)Ljava/util/PriorityQueue;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getPollRateMs$p(Lcom/discord/stores/StoreNotices;)J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/discord/stores/StoreNotices;->pollRateMs:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$processNextNotice(Lcom/discord/stores/StoreNotices;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreNotices;->processNextNotice()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setPollRateMs$p(Lcom/discord/stores/StoreNotices;J)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreNotices;->setPollRateMs(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic markSeen$default(Lcom/discord/stores/StoreNotices;Ljava/lang/String;JILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x2
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
iget-object p2, p0, Lcom/discord/stores/StoreNotices;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
invoke-interface {p2}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide p2
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/stores/StoreNotices;->markSeen(Ljava/lang/String;J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final declared-synchronized processNextNotice()V
|
|
.locals 4
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreNotices;->lastShownTimes:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v2, v3}, Lcom/discord/stores/StoreNotices$Notice;->shouldShow(Ljava/util/Map;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
check-cast v1, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticePublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private final setPollRateMs(J)V
|
|
.locals 2
|
|
|
|
const-wide/16 v0, 0x1f4
|
|
|
|
invoke-static {v0, v1, p1, p2}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreNotices;->pollRateMs:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final declared-synchronized clearSeen(Ljava/lang/String;)V
|
|
.locals 4
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
const-string v0, "noticeName"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
new-instance v3, Lcom/discord/stores/StoreNotices$clearSeen$1;
|
|
|
|
invoke-direct {v3, p1}, Lcom/discord/stores/StoreNotices$clearSeen$1;-><init>(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-static {v0, v2, v3, p1, v1}, Lcom/discord/utilities/persister/Persister;->getAndSet$default(Lcom/discord/utilities/persister/Persister;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
:try_start_1
|
|
invoke-static {v0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final getFirstUseTimestamp()J
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->firstUseTimestamp$delegate:Lkotlin/Lazy;
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Number;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final getNotices()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/stores/StoreNotices$Notice;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticePublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreNotices$getNotices$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/stores/StoreNotices$getNotices$1;-><init>(Lcom/discord/stores/StoreNotices;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->S(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "noticePublisher\n .s\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStream()Lcom/discord/stores/StoreStream;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public init(Landroid/content/Context;)V
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/stores/Store;->init(Landroid/content/Context;)V
|
|
|
|
sget-object p1, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
const-string v1, "Notices init"
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {p1, v1, v0, v2, v0}, Lcom/discord/utilities/logging/Logger;->d$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
sget-object p1, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
const-string v1, "Notices prev seen: "
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/utilities/persister/Persister;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v3}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {p1, v1, v0, v2, v0}, Lcom/discord/utilities/logging/Logger;->d$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreNotices;->processTrigger:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreNotices$init$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/stores/StoreNotices$init$1;-><init>(Lcom/discord/stores/StoreNotices;)V
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->S(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-wide/16 v0, 0x32
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Lrx/Observable;->o(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "processTrigger\n .\u2026S, TimeUnit.MILLISECONDS)"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreNotices$init$2;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/stores/StoreNotices$init$2;-><init>(Lcom/discord/stores/StoreNotices;)V
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreNotices$init$3;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/stores/StoreNotices$init$3;-><init>(Lcom/discord/stores/StoreNotices;)V
|
|
|
|
invoke-virtual {p1, v0, v1}, Lrx/Observable;->Q(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final markDialogSeen(Ljava/lang/String;)V
|
|
.locals 7
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
:try_start_0
|
|
invoke-static {p1}, Lcom/discord/stores/StoreNotices$Dialog$Type;->valueOf(Ljava/lang/String;)Lcom/discord/stores/StoreNotices$Dialog$Type;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Lcom/discord/stores/StoreNotices;->markSeen(Lcom/discord/stores/StoreNotices$Dialog$Type;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
const-wide/16 v3, 0x0
|
|
|
|
const/4 v5, 0x2
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p1
|
|
|
|
invoke-static/range {v1 .. v6}, Lcom/discord/stores/StoreNotices;->markSeen$default(Lcom/discord/stores/StoreNotices;Ljava/lang/String;JILjava/lang/Object;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "noticeDialogType"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final markSeen(Lcom/discord/stores/StoreNotices$Dialog$Type;)V
|
|
.locals 6
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->name()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/stores/StoreNotices;->markSeen$default(Lcom/discord/stores/StoreNotices;Ljava/lang/String;JILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "type"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final declared-synchronized markSeen(Ljava/lang/String;J)V
|
|
.locals 10
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
const-string v0, "noticeName"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p1, :cond_a
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Notice seen: "
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, " @ "
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3, p1}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v2, v1
|
|
|
|
:goto_0
|
|
check-cast v2, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
if-eqz v2, :cond_9
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-virtual {v0, v2}, Ljava/util/PriorityQueue;->remove(Ljava/lang/Object;)Z
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreNotices$Notice;->getDelayPeriodMs()J
|
|
|
|
move-result-wide v3
|
|
|
|
iget-wide v5, p0, Lcom/discord/stores/StoreNotices;->pollRateMs:J
|
|
|
|
cmp-long v0, v3, v5
|
|
|
|
if-gtz v0, :cond_7
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
move-object v3, v1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
move-object v4, v3
|
|
|
|
check-cast v4, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/StoreNotices$Notice;->getDelayPeriodMs()J
|
|
|
|
move-result-wide v4
|
|
|
|
:cond_4
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
move-object v7, v6
|
|
|
|
check-cast v7, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
invoke-virtual {v7}, Lcom/discord/stores/StoreNotices$Notice;->getDelayPeriodMs()J
|
|
|
|
move-result-wide v7
|
|
|
|
cmp-long v9, v4, v7
|
|
|
|
if-lez v9, :cond_5
|
|
|
|
move-object v3, v6
|
|
|
|
move-wide v4, v7
|
|
|
|
:cond_5
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v6
|
|
|
|
if-nez v6, :cond_4
|
|
|
|
:goto_1
|
|
check-cast v3, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
if-eqz v3, :cond_6
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StoreNotices$Notice;->getDelayPeriodMs()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
const-wide/16 v3, 0x7530
|
|
|
|
:goto_2
|
|
invoke-direct {p0, v3, v4}, Lcom/discord/stores/StoreNotices;->setPollRateMs(J)V
|
|
|
|
:cond_7
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->lastShownTimes:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreNotices$Notice;->getPriority()I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v0, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreNotices$Notice;->getPersist()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v2, v0, v3}, Lcom/discord/utilities/persister/Persister;->set(Ljava/lang/Object;Z)Ljava/lang/Object;
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "Notice seen saved: "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " @ "
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 p2, 0x2
|
|
|
|
invoke-static {v0, p1, v1, p2, v1}, Lcom/discord/utilities/logging/Logger;->v$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
:cond_8
|
|
iget-object p1, p0, Lcom/discord/stores/StoreNotices;->noticePublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-virtual {p1, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_9
|
|
iget-object p1, p0, Lcom/discord/stores/StoreNotices;->processTrigger:Lrx/subjects/BehaviorSubject;
|
|
|
|
sget-object p2, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
invoke-virtual {p1, p2}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_a
|
|
:try_start_1
|
|
invoke-static {v0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final observeNoticesSeen()Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->getObservable()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final declared-synchronized requestToShow(Lcom/discord/stores/StoreNotices$Notice;)V
|
|
.locals 5
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
const-string v0, "notice"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticesSeenCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Long;
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/stores/StoreNotices$Notice;->canShow(Ljava/lang/Long;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
instance-of v2, v0, Ljava/util/Collection;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/stores/StoreNotices$Notice;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v2, v4}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
if-eqz v3, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/PriorityQueue;->add(Ljava/lang/Object;)Z
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Notice Request: "
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreNotices$Notice;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "Notice queues: "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreNotices;->noticeQueue:Ljava/util/PriorityQueue;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
invoke-static {v0, v2, v1, v3, v1}, Lcom/discord/utilities/logging/Logger;->d$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreNotices$Notice;->getDelayPeriodMs()J
|
|
|
|
move-result-wide v0
|
|
|
|
iget-wide v2, p0, Lcom/discord/stores/StoreNotices;->pollRateMs:J
|
|
|
|
cmp-long p1, v0, v2
|
|
|
|
if-gez p1, :cond_3
|
|
|
|
invoke-direct {p0, v0, v1}, Lcom/discord/stores/StoreNotices;->setPollRateMs(J)V
|
|
|
|
:cond_3
|
|
iget-object p1, p0, Lcom/discord/stores/StoreNotices;->processTrigger:Lrx/subjects/BehaviorSubject;
|
|
|
|
sget-object v0, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
invoke-virtual {p1, v0}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_4
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
:try_start_1
|
|
invoke-static {v0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|