72 lines
3.1 KiB
Java
72 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).f2137c.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(), 2131886749, 0, null, 12);
|
|
}
|
|
} else if (i != 2) {
|
|
if (i == 3) {
|
|
((OverlayMenuView) this.j).getOnDismissRequested$app_productionGoogleRelease().mo1invoke();
|
|
StoreStream.Companion.getVoiceChannelSelected().clear();
|
|
return;
|
|
}
|
|
throw null;
|
|
} else if (((OverlayMenuView.a) this.j).f2137c.isSuppressed()) {
|
|
m.checkNotNullExpressionValue(view, "view");
|
|
o.g(view.getContext(), 2131893913, 0, null, 12);
|
|
} else if (((OverlayMenuView.a) this.j).f2137c.isMuted()) {
|
|
m.checkNotNullExpressionValue(view, "view");
|
|
o.g(view.getContext(), 2131893356, 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(), 2131894669, 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_productionGoogleRelease().mo1invoke();
|
|
}
|
|
}
|
|
}
|