2021-08-09 22:50:52 +00:00
|
|
|
package com.discord.stores;
|
|
|
|
|
|
|
|
import android.app.Application;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.HandlerThread;
|
|
|
|
import androidx.annotation.VisibleForTesting;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.voice.state.VoiceState;
|
|
|
|
import com.discord.rtcconnection.RtcConnection;
|
|
|
|
import com.discord.rtcconnection.audio.DiscordAudioManager;
|
|
|
|
import com.discord.stores.updates.ObservationDeck;
|
2021-08-18 07:29:27 +00:00
|
|
|
import com.discord.utilities.voice.PerceptualVolumeUtils;
|
2021-08-09 22:50:52 +00:00
|
|
|
import d0.t.h0;
|
|
|
|
import d0.t.o;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: StoreAudioManagerV2.kt */
|
|
|
|
public final class StoreAudioManagerV2 extends StoreV2 {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
2021-10-11 07:48:45 +00:00
|
|
|
private static final State DEFAULT_STATE = new State(DiscordAudioManager.f(), DiscordAudioManager.DeviceTypes.EARPIECE);
|
2021-08-09 22:50:52 +00:00
|
|
|
private Handler audioManagerHandler;
|
|
|
|
private final HandlerThread audioManagerThread = new HandlerThread("AudioManagerThread", -1);
|
|
|
|
private final StoreChannels channelsStore;
|
|
|
|
private Context context;
|
|
|
|
private final Dispatcher dispatcher;
|
2021-08-24 07:28:10 +00:00
|
|
|
private final StoreExperiments experimentsStore;
|
2021-08-09 22:50:52 +00:00
|
|
|
private DiscordAudioManager.AudioDevice lastActiveAudioDevice = DiscordAudioManager.b;
|
|
|
|
private final ObservationDeck observationDeck;
|
|
|
|
private boolean prevMyVideoOn;
|
|
|
|
private State state;
|
|
|
|
private State stateSnapshot;
|
2021-08-18 07:29:27 +00:00
|
|
|
private final StoreStreamRtcConnection streamRtcConnectionStore;
|
2021-08-09 22:50:52 +00:00
|
|
|
private final VideoUseDetector videoUseDetector;
|
|
|
|
private final StoreVoiceChannelSelected voiceChannelSelectedStore;
|
|
|
|
|
|
|
|
/* compiled from: StoreAudioManagerV2.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
@VisibleForTesting
|
|
|
|
public static /* synthetic */ void getDEFAULT_STATE$app_productionBetaRelease$annotations() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public final State getDEFAULT_STATE$app_productionBetaRelease() {
|
|
|
|
return StoreAudioManagerV2.access$getDEFAULT_STATE$cp();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreAudioManagerV2.kt */
|
|
|
|
public static final class State {
|
|
|
|
private DiscordAudioManager.DeviceTypes activeAudioDevice;
|
|
|
|
private List<DiscordAudioManager.AudioDevice> audioDevices;
|
|
|
|
|
|
|
|
public State() {
|
|
|
|
this(null, null, 3, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public State(List<DiscordAudioManager.AudioDevice> list, DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
m.checkNotNullParameter(list, "audioDevices");
|
|
|
|
m.checkNotNullParameter(deviceTypes, "activeAudioDevice");
|
|
|
|
this.audioDevices = list;
|
|
|
|
this.activeAudioDevice = deviceTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
|
|
public /* synthetic */ State(List list, DiscordAudioManager.DeviceTypes deviceTypes, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(list, (i & 2) != 0 ? DiscordAudioManager.DeviceTypes.INVALID : deviceTypes);
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
DiscordAudioManager discordAudioManager = DiscordAudioManager.d;
|
|
|
|
list = DiscordAudioManager.f();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.stores.StoreAudioManagerV2$State */
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public static /* synthetic */ State copy$default(State state, List list, DiscordAudioManager.DeviceTypes deviceTypes, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
list = state.audioDevices;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
deviceTypes = state.activeAudioDevice;
|
|
|
|
}
|
|
|
|
return state.copy(list, deviceTypes);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<DiscordAudioManager.AudioDevice> component1() {
|
|
|
|
return this.audioDevices;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final DiscordAudioManager.DeviceTypes component2() {
|
|
|
|
return this.activeAudioDevice;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final State copy(List<DiscordAudioManager.AudioDevice> list, DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
m.checkNotNullParameter(list, "audioDevices");
|
|
|
|
m.checkNotNullParameter(deviceTypes, "activeAudioDevice");
|
|
|
|
return new State(list, deviceTypes);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof State)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
State state = (State) obj;
|
|
|
|
return m.areEqual(this.audioDevices, state.audioDevices) && m.areEqual(this.activeAudioDevice, state.activeAudioDevice);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final DiscordAudioManager.DeviceTypes getActiveAudioDevice() {
|
|
|
|
return this.activeAudioDevice;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<DiscordAudioManager.AudioDevice> getAudioDevices() {
|
|
|
|
return this.audioDevices;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
List<DiscordAudioManager.AudioDevice> list = this.audioDevices;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (list != null ? list.hashCode() : 0) * 31;
|
|
|
|
DiscordAudioManager.DeviceTypes deviceTypes = this.activeAudioDevice;
|
|
|
|
if (deviceTypes != null) {
|
|
|
|
i = deviceTypes.hashCode();
|
|
|
|
}
|
|
|
|
return hashCode + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void setActiveAudioDevice(DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
m.checkNotNullParameter(deviceTypes, "<set-?>");
|
|
|
|
this.activeAudioDevice = deviceTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void setAudioDevices(List<DiscordAudioManager.AudioDevice> list) {
|
|
|
|
m.checkNotNullParameter(list, "<set-?>");
|
|
|
|
this.audioDevices = list;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O("State(audioDevices=");
|
|
|
|
O.append(this.audioDevices);
|
|
|
|
O.append(", activeAudioDevice=");
|
|
|
|
O.append(this.activeAudioDevice);
|
|
|
|
O.append(")");
|
|
|
|
return O.toString();
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreAudioManagerV2.kt */
|
|
|
|
public static final class VideoUseDetector {
|
|
|
|
private final StoreChannels channelsStore;
|
|
|
|
private final StoreUser usersStore;
|
|
|
|
private final StoreVoiceStates voiceStatesStore;
|
|
|
|
|
|
|
|
public VideoUseDetector(StoreChannels storeChannels, StoreVoiceStates storeVoiceStates, StoreUser storeUser) {
|
|
|
|
m.checkNotNullParameter(storeChannels, "channelsStore");
|
|
|
|
m.checkNotNullParameter(storeVoiceStates, "voiceStatesStore");
|
|
|
|
m.checkNotNullParameter(storeUser, "usersStore");
|
|
|
|
this.channelsStore = storeChannels;
|
|
|
|
this.voiceStatesStore = storeVoiceStates;
|
|
|
|
this.usersStore = storeUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
|
|
|
private final Map<Long, VoiceState> getVoiceStatesForChannel(long j) {
|
|
|
|
Channel findChannelByIdInternal$app_productionBetaRelease = this.channelsStore.findChannelByIdInternal$app_productionBetaRelease(j);
|
|
|
|
Map<Long, VoiceState> map = this.voiceStatesStore.getInternal$app_productionBetaRelease().get(findChannelByIdInternal$app_productionBetaRelease != null ? Long.valueOf(findChannelByIdInternal$app_productionBetaRelease.f()) : null);
|
|
|
|
if (map == null) {
|
|
|
|
return h0.emptyMap();
|
|
|
|
}
|
|
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
|
|
for (Map.Entry<Long, VoiceState> entry : map.entrySet()) {
|
|
|
|
Long a = entry.getValue().a();
|
|
|
|
if (a != null && a.longValue() == j) {
|
|
|
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return linkedHashMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
2021-10-11 07:48:45 +00:00
|
|
|
public final boolean isMyVideoOn(long j) {
|
2021-08-09 22:50:52 +00:00
|
|
|
VoiceState voiceState = getVoiceStatesForChannel(j).get(Long.valueOf(this.usersStore.getMeInternal$app_productionBetaRelease().getId()));
|
2021-10-11 07:48:45 +00:00
|
|
|
if (voiceState == null) {
|
|
|
|
return false;
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
2021-10-11 07:48:45 +00:00
|
|
|
m.checkNotNullParameter(voiceState, "$this$hasVideo");
|
|
|
|
return voiceState.i() || voiceState.j();
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final /* synthetic */ class WhenMappings {
|
|
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
|
|
|
|
|
|
static {
|
|
|
|
DiscordAudioManager.DeviceTypes.values();
|
|
|
|
int[] iArr = new int[6];
|
|
|
|
$EnumSwitchMapping$0 = iArr;
|
|
|
|
iArr[DiscordAudioManager.DeviceTypes.SPEAKERPHONE.ordinal()] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static {
|
|
|
|
DiscordAudioManager discordAudioManager = DiscordAudioManager.d;
|
|
|
|
}
|
|
|
|
|
2021-10-05 07:27:27 +00:00
|
|
|
public StoreAudioManagerV2(ObservationDeck observationDeck, Dispatcher dispatcher, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreChannels storeChannels, StoreStreamRtcConnection storeStreamRtcConnection, VideoUseDetector videoUseDetector, StoreExperiments storeExperiments) {
|
2021-08-09 22:50:52 +00:00
|
|
|
m.checkNotNullParameter(observationDeck, "observationDeck");
|
|
|
|
m.checkNotNullParameter(dispatcher, "dispatcher");
|
|
|
|
m.checkNotNullParameter(storeVoiceChannelSelected, "voiceChannelSelectedStore");
|
|
|
|
m.checkNotNullParameter(storeChannels, "channelsStore");
|
2021-08-18 07:29:27 +00:00
|
|
|
m.checkNotNullParameter(storeStreamRtcConnection, "streamRtcConnectionStore");
|
2021-08-09 22:50:52 +00:00
|
|
|
m.checkNotNullParameter(videoUseDetector, "videoUseDetector");
|
2021-08-24 07:28:10 +00:00
|
|
|
m.checkNotNullParameter(storeExperiments, "experimentsStore");
|
2021-08-09 22:50:52 +00:00
|
|
|
this.observationDeck = observationDeck;
|
|
|
|
this.dispatcher = dispatcher;
|
|
|
|
this.voiceChannelSelectedStore = storeVoiceChannelSelected;
|
|
|
|
this.channelsStore = storeChannels;
|
2021-08-18 07:29:27 +00:00
|
|
|
this.streamRtcConnectionStore = storeStreamRtcConnection;
|
2021-08-09 22:50:52 +00:00
|
|
|
this.videoUseDetector = videoUseDetector;
|
2021-08-24 07:28:10 +00:00
|
|
|
this.experimentsStore = storeExperiments;
|
2021-08-09 22:50:52 +00:00
|
|
|
State state = new State(null, null, 3, null);
|
|
|
|
this.state = state;
|
|
|
|
this.stateSnapshot = state;
|
|
|
|
DiscordAudioManager discordAudioManager = DiscordAudioManager.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ State access$getAudioManagerState(StoreAudioManagerV2 storeAudioManagerV2) {
|
|
|
|
return storeAudioManagerV2.getAudioManagerState();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ State access$getDEFAULT_STATE$cp() {
|
|
|
|
return DEFAULT_STATE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Dispatcher access$getDispatcher$p(StoreAudioManagerV2 storeAudioManagerV2) {
|
|
|
|
return storeAudioManagerV2.dispatcher;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$updateActiveAudioDevice(StoreAudioManagerV2 storeAudioManagerV2, DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
storeAudioManagerV2.updateActiveAudioDevice(deviceTypes);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$updateAudioDevices(StoreAudioManagerV2 storeAudioManagerV2, List list) {
|
|
|
|
storeAudioManagerV2.updateAudioDevices(list);
|
|
|
|
}
|
|
|
|
|
2021-08-18 07:29:27 +00:00
|
|
|
public static final /* synthetic */ void access$updateCurrentMediaVolume(StoreAudioManagerV2 storeAudioManagerV2, int i) {
|
|
|
|
storeAudioManagerV2.updateCurrentMediaVolume(i);
|
|
|
|
}
|
|
|
|
|
2021-08-09 22:50:52 +00:00
|
|
|
private final State getAudioManagerState() {
|
|
|
|
return this.stateSnapshot;
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
|
|
|
private final void updateActiveAudioDevice(DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
State copy$default = State.copy$default(this.state, null, deviceTypes, 1, null);
|
|
|
|
this.state = copy$default;
|
|
|
|
if (!(deviceTypes == DiscordAudioManager.DeviceTypes.INVALID || deviceTypes == DiscordAudioManager.DeviceTypes.DEFAULT)) {
|
|
|
|
this.lastActiveAudioDevice = copy$default.getAudioDevices().get(deviceTypes.getValue());
|
|
|
|
}
|
|
|
|
markChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
|
|
|
private final void updateAudioDevices(List<DiscordAudioManager.AudioDevice> list) {
|
|
|
|
this.state = State.copy$default(this.state, list, null, 2, null);
|
|
|
|
markChanged();
|
|
|
|
}
|
|
|
|
|
2021-08-18 07:29:27 +00:00
|
|
|
private final void updateCurrentMediaVolume(int i) {
|
|
|
|
DiscordAudioManager discordAudioManager = DiscordAudioManager.d;
|
2021-10-11 07:48:45 +00:00
|
|
|
this.streamRtcConnectionStore.updateStreamVolume(PerceptualVolumeUtils.INSTANCE.perceptualToAmplitude((((float) i) / ((float) DiscordAudioManager.d().f2172x)) * 300.0f, 300.0f));
|
2021-08-18 07:29:27 +00:00
|
|
|
}
|
|
|
|
|
2021-08-09 22:50:52 +00:00
|
|
|
public final DiscordAudioManager.AudioDevice getLastActiveAudioDevice$app_productionBetaRelease() {
|
|
|
|
return this.lastActiveAudioDevice;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final State getState$app_productionBetaRelease() {
|
|
|
|
return this.state;
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
|
|
|
public final void handleRtcConnectionState(RtcConnection.State state) {
|
|
|
|
m.checkNotNullParameter(state, "state");
|
|
|
|
if (m.areEqual(state, RtcConnection.State.f.a)) {
|
|
|
|
Handler handler = this.audioManagerHandler;
|
|
|
|
if (handler == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("audioManagerHandler");
|
|
|
|
}
|
|
|
|
handler.post(StoreAudioManagerV2$handleRtcConnectionState$1.INSTANCE);
|
|
|
|
} else if ((state instanceof RtcConnection.State.d) && !((RtcConnection.State.d) state).a) {
|
|
|
|
Handler handler2 = this.audioManagerHandler;
|
|
|
|
if (handler2 == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("audioManagerHandler");
|
|
|
|
}
|
|
|
|
handler2.post(StoreAudioManagerV2$handleRtcConnectionState$2.INSTANCE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@StoreThread
|
|
|
|
public final void handleVoiceStatesUpdated() {
|
2021-10-11 07:48:45 +00:00
|
|
|
boolean isMyVideoOn = this.videoUseDetector.isMyVideoOn(this.voiceChannelSelectedStore.getSelectedVoiceChannelId());
|
|
|
|
if (isMyVideoOn != this.prevMyVideoOn) {
|
|
|
|
if (isMyVideoOn) {
|
2021-08-09 22:50:52 +00:00
|
|
|
DiscordAudioManager discordAudioManager = DiscordAudioManager.d;
|
|
|
|
DiscordAudioManager d = DiscordAudioManager.d();
|
|
|
|
synchronized (d) {
|
2021-08-18 07:29:27 +00:00
|
|
|
if (d.r.get(DiscordAudioManager.DeviceTypes.EARPIECE.getValue()).b) {
|
|
|
|
List<DiscordAudioManager.AudioDevice> list = d.r;
|
2021-08-09 22:50:52 +00:00
|
|
|
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(list, 10));
|
|
|
|
for (DiscordAudioManager.AudioDevice audioDevice : list) {
|
|
|
|
arrayList.add(audioDevice.a.ordinal() != 4 ? DiscordAudioManager.AudioDevice.a(audioDevice, null, false, null, null, 15) : DiscordAudioManager.AudioDevice.a(audioDevice, null, false, null, null, 13));
|
|
|
|
}
|
2021-08-18 07:29:27 +00:00
|
|
|
d.r = arrayList;
|
2021-10-11 07:48:45 +00:00
|
|
|
d.f2171s.j.onNext(arrayList);
|
2021-08-09 22:50:52 +00:00
|
|
|
d.l();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
DiscordAudioManager discordAudioManager2 = DiscordAudioManager.d;
|
|
|
|
DiscordAudioManager d2 = DiscordAudioManager.d();
|
|
|
|
synchronized (d2) {
|
2021-08-18 07:29:27 +00:00
|
|
|
if (d2.r.get(DiscordAudioManager.DeviceTypes.EARPIECE.getValue()).b != d2.h) {
|
|
|
|
List<DiscordAudioManager.AudioDevice> list2 = d2.r;
|
2021-08-09 22:50:52 +00:00
|
|
|
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(list2, 10));
|
|
|
|
for (DiscordAudioManager.AudioDevice audioDevice2 : list2) {
|
|
|
|
arrayList2.add(audioDevice2.a.ordinal() != 4 ? DiscordAudioManager.AudioDevice.a(audioDevice2, null, false, null, null, 15) : DiscordAudioManager.AudioDevice.a(audioDevice2, null, d2.h, null, null, 13));
|
|
|
|
}
|
2021-08-18 07:29:27 +00:00
|
|
|
d2.r = arrayList2;
|
2021-10-11 07:48:45 +00:00
|
|
|
d2.f2171s.j.onNext(arrayList2);
|
2021-08-09 22:50:52 +00:00
|
|
|
d2.l();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-11 07:48:45 +00:00
|
|
|
this.prevMyVideoOn = isMyVideoOn;
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void init(Application application) {
|
|
|
|
m.checkNotNullParameter(application, "context");
|
|
|
|
this.context = application;
|
|
|
|
if (!this.audioManagerThread.isAlive()) {
|
|
|
|
this.audioManagerThread.start();
|
|
|
|
}
|
|
|
|
Handler handler = new Handler(this.audioManagerThread.getLooper());
|
|
|
|
this.audioManagerHandler = handler;
|
|
|
|
if (handler == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("audioManagerHandler");
|
|
|
|
}
|
|
|
|
handler.post(new StoreAudioManagerV2$init$1(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<State> observeAudioManagerState() {
|
|
|
|
return ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this}, false, null, null, new StoreAudioManagerV2$observeAudioManagerState$1(this), 14, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void selectOutputDevice(DiscordAudioManager.DeviceTypes deviceTypes) {
|
|
|
|
m.checkNotNullParameter(deviceTypes, "device");
|
|
|
|
Handler handler = this.audioManagerHandler;
|
|
|
|
if (handler == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("audioManagerHandler");
|
|
|
|
}
|
|
|
|
handler.post(new StoreAudioManagerV2$selectOutputDevice$1(deviceTypes));
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void setState$app_productionBetaRelease(State state) {
|
|
|
|
m.checkNotNullParameter(state, "<set-?>");
|
|
|
|
this.state = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.stores.StoreV2
|
|
|
|
public void snapshotData() {
|
|
|
|
super.snapshotData();
|
|
|
|
List<DiscordAudioManager.AudioDevice> audioDevices = this.state.getAudioDevices();
|
|
|
|
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(audioDevices, 10));
|
|
|
|
for (DiscordAudioManager.AudioDevice audioDevice : audioDevices) {
|
|
|
|
arrayList.add(DiscordAudioManager.AudioDevice.a(audioDevice, null, false, null, null, 15));
|
|
|
|
}
|
|
|
|
this.stateSnapshot = this.state.copy(arrayList, this.state.getActiveAudioDevice());
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void toggleSpeakerOutput() {
|
|
|
|
this.dispatcher.schedule(new StoreAudioManagerV2$toggleSpeakerOutput$1(this));
|
|
|
|
}
|
2021-08-18 07:29:27 +00:00
|
|
|
|
|
|
|
public final void updateMediaVolume(float f) {
|
|
|
|
Handler handler = this.audioManagerHandler;
|
|
|
|
if (handler == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("audioManagerHandler");
|
|
|
|
}
|
|
|
|
handler.post(new StoreAudioManagerV2$updateMediaVolume$1(f));
|
|
|
|
}
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|