2021-06-27 20:44:35 +00:00
|
|
|
package defpackage;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
|
|
|
import c.a.d.o;
|
|
|
|
import com.discord.stores.StoreAudioDevices;
|
|
|
|
import com.discord.stores.StoreMediaSettings;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.voice.DiscordOverlayService;
|
|
|
|
import com.discord.views.OverlayMenuView;
|
|
|
|
import d0.z.d.m;
|
|
|
|
/* 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 = this.i;
|
|
|
|
if (i != 0) {
|
|
|
|
boolean z2 = true;
|
|
|
|
if (i == 1) {
|
2021-08-04 22:02:59 +00:00
|
|
|
if (((OverlayMenuView.a) this.j).f2140c.getAudioDevicesState().getAvailableOutputDevices().size() <= 1) {
|
2021-06-27 20:44:35 +00:00
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
|
|
StoreAudioDevices audioDevices = companion.getAudioDevices();
|
|
|
|
if (audioDevices.getEnabled()) {
|
|
|
|
audioDevices.toggleSpeakerOutput();
|
|
|
|
} else {
|
|
|
|
companion.getAudioManagerV2().toggleSpeakerOutput();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
m.checkNotNullExpressionValue(view, "it");
|
2021-08-04 22:02:59 +00:00
|
|
|
o.g(view.getContext(), 2131886750, 0, null, 12);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
} else if (i != 2) {
|
|
|
|
if (i == 3) {
|
2021-06-27 22:10:28 +00:00
|
|
|
((OverlayMenuView) this.j).getOnDismissRequested$app_productionGoogleRelease().mo1invoke();
|
2021-06-27 20:44:35 +00:00
|
|
|
StoreStream.Companion.getVoiceChannelSelected().clear();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
throw null;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (((OverlayMenuView.a) this.j).f2140c.isSuppressed()) {
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-08-04 22:02:59 +00:00
|
|
|
o.g(view.getContext(), 2131893994, 0, null, 12);
|
|
|
|
} else if (((OverlayMenuView.a) this.j).f2140c.isMuted()) {
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-08-04 22:02:59 +00:00
|
|
|
o.g(view.getContext(), 2131893430, 0, null, 12);
|
2021-06-27 20:44:35 +00:00
|
|
|
} else {
|
|
|
|
StoreMediaSettings.SelfMuteFailure selfMuteFailure = StoreStream.Companion.getMediaSettings().toggleSelfMuted();
|
|
|
|
if (selfMuteFailure != null && selfMuteFailure.ordinal() == 0) {
|
|
|
|
m.checkNotNullExpressionValue(view, "view");
|
2021-08-04 22:02:59 +00:00
|
|
|
o.g(view.getContext(), 2131894756, 0, null, 12);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
DiscordOverlayService.Companion companion2 = DiscordOverlayService.Companion;
|
|
|
|
Context context = ((OverlayMenuView) this.j).getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
|
|
companion2.launchForVoiceChannelSelect(context);
|
2021-06-27 22:10:28 +00:00
|
|
|
((OverlayMenuView) this.j).getOnDismissRequested$app_productionGoogleRelease().mo1invoke();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|