discord-jadx/app/src/main/java/c/a/a/e/a/c.java

43 lines
1.9 KiB
Java

package c.a.a.e.a;
import c.a.a.e.a.f;
import com.discord.stores.StoreAudioDevices;
import d0.z.d.m;
import d0.z.d.o;
import java.util.ArrayList;
import java.util.Objects;
import java.util.Set;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: AudioOutputSelectionDialogViewModel.kt */
public final class c extends o implements Function1<f.b, Unit> {
public final /* synthetic */ f this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(f fVar) {
super(1);
this.this$0 = fVar;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public Unit invoke(f.b bVar) {
f.b bVar2 = bVar;
m.checkNotNullParameter(bVar2, "storeState");
f fVar = this.this$0;
Objects.requireNonNull(fVar);
StoreAudioDevices.AudioDevicesState audioDevicesState = bVar2.a;
Set<StoreAudioDevices.OutputDevice> availableOutputDevices = audioDevicesState.getAvailableOutputDevices();
ArrayList arrayList = new ArrayList();
for (Object obj : availableOutputDevices) {
if (obj instanceof StoreAudioDevices.OutputDevice.BluetoothAudio) {
arrayList.add(obj);
}
}
boolean z2 = !arrayList.isEmpty();
fVar.updateViewState(new f.c.a(audioDevicesState.getSelectedOutputDevice(), z2, z2 ? (StoreAudioDevices.OutputDevice.BluetoothAudio) arrayList.get(0) : null, availableOutputDevices.contains(StoreAudioDevices.OutputDevice.Speaker.INSTANCE), availableOutputDevices.contains(StoreAudioDevices.OutputDevice.WiredAudio.INSTANCE), availableOutputDevices.contains(StoreAudioDevices.OutputDevice.Earpiece.INSTANCE)));
return Unit.a;
}
}