discord-jadx/app/src/main/java/defpackage/h.java

73 lines
3.1 KiB
Java

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) {
if (((OverlayMenuView.a) this.j).f2133c.getAudioDevicesState().getAvailableOutputDevices().size() <= 1) {
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");
o.g(view.getContext(), 2131886748, 0, null, 12);
}
} else if (i != 2) {
if (i == 3) {
((OverlayMenuView) this.j).getOnDismissRequested$app_productionBetaRelease().mo1invoke();
StoreStream.Companion.getVoiceChannelSelected().clear();
return;
}
throw null;
} else if (((OverlayMenuView.a) this.j).f2133c.isSuppressed()) {
m.checkNotNullExpressionValue(view, "view");
o.g(view.getContext(), 2131893889, 0, null, 12);
} else if (((OverlayMenuView.a) this.j).f2133c.isMuted()) {
m.checkNotNullExpressionValue(view, "view");
o.g(view.getContext(), 2131893339, 0, null, 12);
} else {
StoreMediaSettings.SelfMuteFailure selfMuteFailure = StoreStream.Companion.getMediaSettings().toggleSelfMuted();
if (selfMuteFailure != null && selfMuteFailure.ordinal() == 0) {
m.checkNotNullExpressionValue(view, "view");
o.g(view.getContext(), 2131894641, 0, null, 12);
}
}
} else {
DiscordOverlayService.Companion companion2 = DiscordOverlayService.Companion;
Context context = ((OverlayMenuView) this.j).getContext();
m.checkNotNullExpressionValue(context, "context");
companion2.launchForVoiceChannelSelect(context);
((OverlayMenuView) this.j).getOnDismissRequested$app_productionBetaRelease().mo1invoke();
}
}
}