265 lines
8 KiB
Smali
265 lines
8 KiB
Smali
.class public final Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
.super Ljava/lang/Object;
|
|
.source "PersistLocalMessagesFeatureFlag.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
.field public static final DEFAULT_BUCKET:I
|
|
|
|
.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/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
sget-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion$INSTANCE$2;->INSTANCE:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$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/PersistLocalMessagesFeatureFlag;->INSTANCE$delegate:Lkotlin/Lazy;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-direct {p0, v0, v1, v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;-><init>(Landroid/content/SharedPreferences;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/SharedPreferences;)V
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const-string v1, "CACHE_KEY_PERSIST_LOCAL_MESSAGES_EXPERIMENT_BUCKET"
|
|
|
|
invoke-interface {p1, v1, v0}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->experimentBucket:I
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "sharedPreferences"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Landroid/content/SharedPreferences;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/utilities/cache/SharedPreferencesProvider;->INSTANCE:Lcom/discord/utilities/cache/SharedPreferencesProvider;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/cache/SharedPreferencesProvider;->get()Landroid/content/SharedPreferences;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;-><init>(Landroid/content/SharedPreferences;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getINSTANCE$cp()Lkotlin/Lazy;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->INSTANCE$delegate:Lkotlin/Lazy;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$writeExperimentToCache(Lcom/discord/stores/PersistLocalMessagesFeatureFlag;Lcom/discord/stores/StoreExperiments$Experiment;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->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-07_android_persist_local_messages"
|
|
|
|
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/PersistLocalMessagesFeatureFlag$observeExperiment$1;->INSTANCE:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$observeExperiment$1;
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->w(Lr0/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/PersistLocalMessagesFeatureFlag$observeExperiment$2;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$observeExperiment$2;-><init>(Lcom/discord/stores/PersistLocalMessagesFeatureFlag;)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}, 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
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final writeExperimentToCache(Lcom/discord/stores/StoreExperiments$Experiment;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->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, "CACHE_KEY_PERSIST_LOCAL_MESSAGES_EXPERIMENT_BUCKET"
|
|
|
|
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/PersistLocalMessagesFeatureFlag;->observeExperiment(Lcom/discord/stores/StoreExperiments;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-class v1, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
sget-object v6, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$fetchExperiment$1;->INSTANCE:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$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}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final isEnabled()Z
|
|
.locals 2
|
|
|
|
iget v0, p0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->experimentBucket:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
return v1
|
|
.end method
|