apkfuckery/com.discord/smali/com/discord/stores/SlowTtiExperimentManager.smali

243 lines
7.3 KiB
Smali

.class public final Lcom/discord/stores/SlowTtiExperimentManager;
.super Ljava/lang/Object;
.source "SlowTtiExperimentManager.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/stores/SlowTtiExperimentManager$Companion;
}
.end annotation
# static fields
.field public static final Companion:Lcom/discord/stores/SlowTtiExperimentManager$Companion;
.field public static final INSTANCE$delegate:Lkotlin/Lazy;
# instance fields
.field public experimentBucket:I
.field public final sharedPreferences:Landroid/content/SharedPreferences;
# direct methods
.method public static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/discord/stores/SlowTtiExperimentManager$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/discord/stores/SlowTtiExperimentManager$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/discord/stores/SlowTtiExperimentManager;->Companion:Lcom/discord/stores/SlowTtiExperimentManager$Companion;
sget-object v0, Lcom/discord/stores/SlowTtiExperimentManager$Companion$INSTANCE$2;->INSTANCE:Lcom/discord/stores/SlowTtiExperimentManager$Companion$INSTANCE$2;
invoke-static {v0}, Lf/n/a/k/a;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
move-result-object v0
sput-object v0, Lcom/discord/stores/SlowTtiExperimentManager;->INSTANCE$delegate:Lkotlin/Lazy;
return-void
.end method
.method public constructor <init>()V
.locals 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
sget-object v0, Lcom/discord/utilities/cache/SharedPreferencesProvider;->INSTANCE:Lcom/discord/utilities/cache/SharedPreferencesProvider;
invoke-virtual {v0}, Lcom/discord/utilities/cache/SharedPreferencesProvider;->get()Landroid/content/SharedPreferences;
move-result-object v0
iput-object v0, p0, Lcom/discord/stores/SlowTtiExperimentManager;->sharedPreferences:Landroid/content/SharedPreferences;
const-string v1, "SLOW_TTI_EXPERIMENT"
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
iput v0, p0, Lcom/discord/stores/SlowTtiExperimentManager;->experimentBucket:I
return-void
.end method
.method public static final synthetic access$getINSTANCE$cp()Lkotlin/Lazy;
.locals 1
sget-object v0, Lcom/discord/stores/SlowTtiExperimentManager;->INSTANCE$delegate:Lkotlin/Lazy;
return-object v0
.end method
.method public static final synthetic access$writeExperimentToCache(Lcom/discord/stores/SlowTtiExperimentManager;Lcom/discord/stores/StoreExperiments$Experiment;)V
.locals 0
invoke-direct {p0, p1}, Lcom/discord/stores/SlowTtiExperimentManager;->writeExperimentToCache(Lcom/discord/stores/StoreExperiments$Experiment;)V
return-void
.end method
.method private final observeExperiment(Lcom/discord/stores/StoreExperiments;)Lrx/Observable;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/discord/stores/StoreExperiments;",
")",
"Lrx/Observable<",
"Lcom/discord/stores/StoreExperiments$Experiment;",
">;"
}
.end annotation
const-string v0, "2020-08_android_tti_delay"
const/4 v1, 0x0
const/4 v2, 0x2
invoke-static {p1, v0, v1, v2, v1}, Lcom/discord/stores/StoreExperiments;->getExperiment$default(Lcom/discord/stores/StoreExperiments;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lrx/Observable;
move-result-object p1
sget-object v0, Lcom/discord/stores/SlowTtiExperimentManager$observeExperiment$1;->INSTANCE:Lcom/discord/stores/SlowTtiExperimentManager$observeExperiment$1;
invoke-virtual {p1, v0}, Lrx/Observable;->w(Ls0/k/b;)Lrx/Observable;
move-result-object p1
const/4 v0, 0x1
invoke-virtual {p1, v0}, Lrx/Observable;->V(I)Lrx/Observable;
move-result-object p1
new-instance v0, Lcom/discord/stores/SlowTtiExperimentManager$observeExperiment$2;
invoke-direct {v0, p0}, Lcom/discord/stores/SlowTtiExperimentManager$observeExperiment$2;-><init>(Lcom/discord/stores/SlowTtiExperimentManager;)V
invoke-virtual {p1, v0}, Lrx/Observable;->t(Lrx/functions/Action1;)Lrx/Observable;
move-result-object p1
const-string v0, "storeExperiments.getExpe\u2026che(experiment)\n }"
invoke-static {p1, v0}, Lk0/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
return-object p1
.end method
.method private final writeExperimentToCache(Lcom/discord/stores/StoreExperiments$Experiment;)V
.locals 2
iget-object v0, p0, Lcom/discord/stores/SlowTtiExperimentManager;->sharedPreferences:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-virtual {p1}, Lcom/discord/stores/StoreExperiments$Experiment;->getBucket()I
move-result p1
const-string v1, "SLOW_TTI_EXPERIMENT"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object p1
invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V
return-void
.end method
# virtual methods
.method public final fetchExperiment(Lcom/discord/stores/StoreExperiments;)V
.locals 9
if-eqz p1, :cond_0
invoke-direct {p0, p1}, Lcom/discord/stores/SlowTtiExperimentManager;->observeExperiment(Lcom/discord/stores/StoreExperiments;)Lrx/Observable;
move-result-object v0
const-class v1, Lcom/discord/stores/SlowTtiExperimentManager;
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
sget-object v6, Lcom/discord/stores/SlowTtiExperimentManager$fetchExperiment$1;->INSTANCE:Lcom/discord/stores/SlowTtiExperimentManager$fetchExperiment$1;
const/16 v7, 0x1e
const/4 v8, 0x0
invoke-static/range {v0 .. v8}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
:cond_0
const-string p1, "storeExperiments"
invoke-static {p1}, Lk0/n/c/h;->c(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public final getDelayMs()J
.locals 2
invoke-static {}, Lcom/discord/stores/SlowTtiExperimentManagerKt;->access$getExperimentBucketToDelayMs$p()Ljava/util/Map;
move-result-object v0
iget v1, p0, Lcom/discord/stores/SlowTtiExperimentManager;->experimentBucket:I
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Long;
if-eqz v0, :cond_0
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
move-result-wide v0
goto :goto_0
:cond_0
const-wide/16 v0, 0x0
:goto_0
return-wide v0
.end method