2021-06-27 20:44:35 +00:00
|
|
|
package defpackage;
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
|
|
|
import com.discord.R;
|
|
|
|
import com.discord.rtcconnection.audio.DiscordAudioManager;
|
|
|
|
import com.discord.stores.StoreMediaSettings;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.voice.DiscordOverlayService;
|
|
|
|
import com.discord.views.OverlayMenuView;
|
|
|
|
import d0.t.n;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* compiled from: java-style lambda group */
|
|
|
|
/* renamed from: i reason: default package */
|
2022-03-15 17:00:47 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-11-08 18:25:28 +00:00
|
|
|
public final class i implements View.OnClickListener {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final /* synthetic */ int j;
|
|
|
|
public final /* synthetic */ Object k;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
public i(int i, Object obj) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = i;
|
|
|
|
this.k = obj;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
|
|
|
int i;
|
2021-12-17 22:03:14 +00:00
|
|
|
int i2 = this.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
if (i2 != 0) {
|
|
|
|
boolean z2 = true;
|
|
|
|
if (i2 == 1) {
|
2021-12-21 23:37:30 +00:00
|
|
|
List<DiscordAudioManager.AudioDevice> audioDevices = ((OverlayMenuView.a) this.k).c.getAudioManagerState().getAudioDevices();
|
2021-11-08 18:25:28 +00:00
|
|
|
if (!(audioDevices instanceof Collection) || !audioDevices.isEmpty()) {
|
|
|
|
i = 0;
|
|
|
|
for (DiscordAudioManager.AudioDevice audioDevice : audioDevices) {
|
2022-03-02 20:59:20 +00:00
|
|
|
if (audioDevice.f2763b && (i = i + 1) < 0) {
|
2021-11-08 18:25:28 +00:00
|
|
|
n.throwCountOverflow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
if (i <= 1) {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
StoreStream.Companion.getAudioManagerV2().toggleSpeakerOutput();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m.checkNotNullExpressionValue(view, "it");
|
2021-12-21 23:37:30 +00:00
|
|
|
b.a.d.m.g(view.getContext(), R.string.audio_devices_toggle_unavailable, 0, null, 12);
|
2021-11-08 18:25:28 +00:00
|
|
|
} else if (i2 != 2) {
|
|
|
|
if (i2 == 3) {
|
2022-03-02 20:59:20 +00:00
|
|
|
((OverlayMenuView) this.k).getOnDismissRequested$app_productionGoogleRelease().invoke();
|
2021-11-08 18:25:28 +00:00
|
|
|
StoreStream.Companion.getVoiceChannelSelected().clear();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
throw null;
|
2021-12-21 23:37:30 +00:00
|
|
|
} else if (((OverlayMenuView.a) this.k).c.isSuppressed()) {
|
2021-11-08 18:25:28 +00:00
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-12-21 23:37:30 +00:00
|
|
|
b.a.d.m.g(view.getContext(), R.string.suppressed_permission_body, 0, null, 12);
|
|
|
|
} else if (((OverlayMenuView.a) this.k).c.isMuted()) {
|
2021-11-08 18:25:28 +00:00
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-12-21 23:37:30 +00:00
|
|
|
b.a.d.m.g(view.getContext(), R.string.server_muted_dialog_body, 0, null, 12);
|
2021-11-08 18:25:28 +00:00
|
|
|
} else {
|
|
|
|
StoreMediaSettings.SelfMuteFailure selfMuteFailure = StoreStream.Companion.getMediaSettings().toggleSelfMuted();
|
|
|
|
if (selfMuteFailure != null && selfMuteFailure.ordinal() == 0) {
|
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-12-21 23:37:30 +00:00
|
|
|
b.a.d.m.g(view.getContext(), R.string.vad_permission_small, 0, null, 12);
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
DiscordOverlayService.Companion companion = DiscordOverlayService.Companion;
|
2021-12-17 22:03:14 +00:00
|
|
|
Context context = ((OverlayMenuView) this.k).getContext();
|
2021-11-08 18:25:28 +00:00
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
|
|
companion.launchForVoiceChannelSelect(context);
|
2022-03-02 20:59:20 +00:00
|
|
|
((OverlayMenuView) this.k).getOnDismissRequested$app_productionGoogleRelease().invoke();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|