389 lines
14 KiB
Smali
389 lines
14 KiB
Smali
.class public final Lcom/discord/stores/VoiceConfigurationCache;
|
|
.super Ljava/lang/Object;
|
|
.source "VoiceConfigurationCache.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/VoiceConfigurationCache$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/stores/VoiceConfigurationCache$Companion;
|
|
|
|
.field public static final DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
|
|
# instance fields
|
|
.field public final inputModeCache:Lcom/discord/utilities/persister/Persister;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/persister/Persister<",
|
|
"Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
.field public final voiceConfigSubject:Lrx/subjects/PublishSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/PublishSubject<",
|
|
"Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 12
|
|
|
|
new-instance v0, Lcom/discord/stores/VoiceConfigurationCache$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/stores/VoiceConfigurationCache$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/stores/VoiceConfigurationCache;->Companion:Lcom/discord/stores/VoiceConfigurationCache$Companion;
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
sget-object v10, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;->d:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
const/4 v7, 0x1
|
|
|
|
const/4 v8, 0x1
|
|
|
|
const/high16 v9, -0x3db80000 # -50.0f
|
|
|
|
const/high16 v11, 0x42c80000 # 100.0f
|
|
|
|
move-object v2, v0
|
|
|
|
invoke-direct/range {v2 .. v11}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;-><init>(ZZZZZZFLcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;F)V
|
|
|
|
sput-object v0, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/SharedPreferences;)V
|
|
.locals 10
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->o()Lrx/subjects/PublishSubject;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "PublishSubject.create()"
|
|
|
|
invoke-static {p1, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/VoiceConfigurationCache;->voiceConfigSubject:Lrx/subjects/PublishSubject;
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/VoiceConfigurationCache;->voiceConfigSubject:Lrx/subjects/PublishSubject;
|
|
|
|
const-wide/16 v0, 0x12c
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Lrx/Observable;->b(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "voiceConfigSubject\n \u2026L, TimeUnit.MILLISECONDS)"
|
|
|
|
invoke-static {p1, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const-class v2, Lcom/discord/stores/VoiceConfigurationCache;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
new-instance v7, Lcom/discord/stores/VoiceConfigurationCache$1;
|
|
|
|
invoke-direct {v7, p0}, Lcom/discord/stores/VoiceConfigurationCache$1;-><init>(Lcom/discord/stores/VoiceConfigurationCache;)V
|
|
|
|
const/16 v8, 0x1e
|
|
|
|
const/4 v9, 0x0
|
|
|
|
invoke-static/range {v1 .. v9}, 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
|
|
|
|
new-instance p1, Lcom/discord/utilities/persister/Persister;
|
|
|
|
sget-object v0, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;->d:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
|
|
const-string v1, "CACHE_KEY_VOICE_SETTINGS_INPUT_MODE"
|
|
|
|
invoke-direct {p1, v1, v0}, Lcom/discord/utilities/persister/Persister;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/VoiceConfigurationCache;->inputModeCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "sharedPreferences"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static final synthetic access$getDEFAULT_VOICE_CONFIG$cp()Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getInputModeCache$p(Lcom/discord/stores/VoiceConfigurationCache;)Lcom/discord/utilities/persister/Persister;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/VoiceConfigurationCache;->inputModeCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$writeToSharedPreferences(Lcom/discord/stores/VoiceConfigurationCache;Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/VoiceConfigurationCache;->writeToSharedPreferences(Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final sanitizeInputMode(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;)Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
.locals 6
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x6
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const-string v1, "inputMode was null"
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
sget-object p1, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getInputMode()Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final writeToSharedPreferences(Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
new-instance v1, Lcom/discord/stores/VoiceConfigurationCache$writeToSharedPreferences$1;
|
|
|
|
invoke-direct {v1, p0, p1}, Lcom/discord/stores/VoiceConfigurationCache$writeToSharedPreferences$1;-><init>(Lcom/discord/stores/VoiceConfigurationCache;Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;)V
|
|
|
|
invoke-static {v0, v1}, Lcom/discord/utilities/cache/SharedPreferenceExtensionsKt;->edit(Landroid/content/SharedPreferences;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final read()Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
.locals 12
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/VoiceConfigurationCache;->inputModeCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
|
|
new-instance v11, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v2, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->isMuted()Z
|
|
|
|
move-result v2
|
|
|
|
const-string v3, "CACHE_KEY_VOICE_SETTINGS_IS_MUTED"
|
|
|
|
invoke-interface {v1, v3, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v3, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->isDeafened()Z
|
|
|
|
move-result v3
|
|
|
|
const-string v4, "CACHE_KEY_VOICE_SETTINGS_IS_DEAFENED"
|
|
|
|
invoke-interface {v1, v4, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v3
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v4, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getAutomaticVad()Z
|
|
|
|
move-result v4
|
|
|
|
const-string v5, "CACHE_KEY_VOICE_SETTINGS_AUTOMATIC_VAD"
|
|
|
|
invoke-interface {v1, v5, v4}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v4
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v5, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getAutomaticGainControl()Z
|
|
|
|
move-result v5
|
|
|
|
const-string v6, "CACHE_KEY_VOICE_SETTINGS_AUTOMATIC_GAIN_CONTROL"
|
|
|
|
invoke-interface {v1, v6, v5}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v5
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v6, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getEchoCancellation()Z
|
|
|
|
move-result v6
|
|
|
|
const-string v7, "CACHE_KEY_VOICE_SETTINGS_ECHO_CANCELLATION"
|
|
|
|
invoke-interface {v1, v7, v6}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v6
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v7, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v7}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getNoiseSuppression()Z
|
|
|
|
move-result v7
|
|
|
|
const-string v8, "CACHE_KEY_VOICE_SETTINGS_NOISE_SUPPRESSION"
|
|
|
|
invoke-interface {v1, v8, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
move-result v7
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v8, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getSensitivity()F
|
|
|
|
move-result v8
|
|
|
|
const-string v9, "CACHE_KEY_VOICE_SETTINGS_SENSITIVITY"
|
|
|
|
invoke-interface {v1, v9, v8}, Landroid/content/SharedPreferences;->getFloat(Ljava/lang/String;F)F
|
|
|
|
move-result v8
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/stores/VoiceConfigurationCache;->sanitizeInputMode(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;)Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;
|
|
|
|
move-result-object v9
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/VoiceConfigurationCache;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
sget-object v1, Lcom/discord/stores/VoiceConfigurationCache;->DEFAULT_VOICE_CONFIG:Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;->getOutputVolume()F
|
|
|
|
move-result v1
|
|
|
|
const-string v10, "CACHE_KEY_VOICE_SETTINGS_OUTPUT_VOLUME"
|
|
|
|
invoke-interface {v0, v10, v1}, Landroid/content/SharedPreferences;->getFloat(Ljava/lang/String;F)F
|
|
|
|
move-result v10
|
|
|
|
move-object v1, v11
|
|
|
|
invoke-direct/range {v1 .. v10}, Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;-><init>(ZZZZZZFLcom/discord/rtcconnection/mediaengine/MediaEngineConnection$InputMode;F)V
|
|
|
|
return-object v11
|
|
.end method
|
|
|
|
.method public final write(Lcom/discord/stores/StoreMediaSettings$VoiceConfiguration;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/VoiceConfigurationCache;->voiceConfigSubject:Lrx/subjects/PublishSubject;
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "voiceConfiguration"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|