discord-jadx/app/src/main/java/defpackage/h.java
2021-09-28 21:28:19 +02:00

81 lines
3.5 KiB
Java

package defpackage;
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;
/* compiled from: java-style lambda group */
/* renamed from: h reason: default package */
public final class h implements View.OnClickListener {
public final /* synthetic */ int i;
public final /* synthetic */ Object j;
public h(int i, Object obj) {
this.i = i;
this.j = obj;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
int i;
int i2 = this.i;
if (i2 != 0) {
boolean z2 = true;
if (i2 == 1) {
List<DiscordAudioManager.AudioDevice> audioDevices = ((OverlayMenuView.a) this.j).f2202c.getAudioManagerState().getAudioDevices();
if (!(audioDevices instanceof Collection) || !audioDevices.isEmpty()) {
i = 0;
for (DiscordAudioManager.AudioDevice audioDevice : audioDevices) {
if (audioDevice.b && (i = i + 1) < 0) {
n.throwCountOverflow();
}
}
} else {
i = 0;
}
if (i <= 1) {
z2 = false;
}
if (z2) {
StoreStream.Companion.getAudioManagerV2().toggleSpeakerOutput();
return;
}
m.checkNotNullExpressionValue(view, "it");
c.a.d.m.g(view.getContext(), R.string.audio_devices_toggle_unavailable, 0, null, 12);
} else if (i2 != 2) {
if (i2 == 3) {
((OverlayMenuView) this.j).getOnDismissRequested$app_productionGoogleRelease().mo1invoke();
StoreStream.Companion.getVoiceChannelSelected().clear();
return;
}
throw null;
} else if (((OverlayMenuView.a) this.j).f2202c.isSuppressed()) {
m.checkNotNullExpressionValue(view, "view");
c.a.d.m.g(view.getContext(), R.string.suppressed_permission_body, 0, null, 12);
} else if (((OverlayMenuView.a) this.j).f2202c.isMuted()) {
m.checkNotNullExpressionValue(view, "view");
c.a.d.m.g(view.getContext(), R.string.server_muted_dialog_body, 0, null, 12);
} else {
StoreMediaSettings.SelfMuteFailure selfMuteFailure = StoreStream.Companion.getMediaSettings().toggleSelfMuted();
if (selfMuteFailure != null && selfMuteFailure.ordinal() == 0) {
m.checkNotNullExpressionValue(view, "view");
c.a.d.m.g(view.getContext(), R.string.vad_permission_small, 0, null, 12);
}
}
} else {
DiscordOverlayService.Companion companion = DiscordOverlayService.Companion;
Context context = ((OverlayMenuView) this.j).getContext();
m.checkNotNullExpressionValue(context, "context");
companion.launchForVoiceChannelSelect(context);
((OverlayMenuView) this.j).getOnDismissRequested$app_productionGoogleRelease().mo1invoke();
}
}
}