100 lines
3.1 KiB
Java
100 lines
3.1 KiB
Java
package com.discord.rtcconnection.enums;
|
|
|
|
import android.content.Intent;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: ScoAudioState.kt */
|
|
public enum ScoAudioState {
|
|
Disconnected(0),
|
|
Connected(1),
|
|
Connecting(2),
|
|
Error(-1);
|
|
|
|
public static final a Companion = new a(null);
|
|
private final int value;
|
|
|
|
/* compiled from: ScoAudioState.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
|
|
public final ScoAudioState a(int i) {
|
|
ScoAudioState[] values = ScoAudioState.values();
|
|
for (int i2 = 0; i2 < 4; i2++) {
|
|
ScoAudioState scoAudioState = values[i2];
|
|
if (scoAudioState.getValue() == i) {
|
|
return scoAudioState;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final b b(Intent intent) {
|
|
m.checkNotNullParameter(intent, "intent");
|
|
if (m.areEqual(intent.getAction(), "android.media.ACTION_SCO_AUDIO_STATE_UPDATED")) {
|
|
ScoAudioState a = a(intent.getIntExtra("android.media.extra.SCO_AUDIO_STATE", 0));
|
|
m.checkNotNull(a);
|
|
ScoAudioState a2 = a(intent.getIntExtra("android.media.extra.SCO_AUDIO_PREVIOUS_STATE", 0));
|
|
m.checkNotNull(a2);
|
|
return new b(a, a2);
|
|
}
|
|
throw new IllegalArgumentException("Failed requirement.".toString());
|
|
}
|
|
}
|
|
|
|
/* compiled from: ScoAudioState.kt */
|
|
public static final class b {
|
|
public final ScoAudioState a;
|
|
public final ScoAudioState b;
|
|
|
|
public b(ScoAudioState scoAudioState, ScoAudioState scoAudioState2) {
|
|
m.checkNotNullParameter(scoAudioState, "current");
|
|
m.checkNotNullParameter(scoAudioState2, "previous");
|
|
this.a = scoAudioState;
|
|
this.b = scoAudioState2;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof b)) {
|
|
return false;
|
|
}
|
|
b bVar = (b) obj;
|
|
return m.areEqual(this.a, bVar.a) && m.areEqual(this.b, bVar.b);
|
|
}
|
|
|
|
public int hashCode() {
|
|
ScoAudioState scoAudioState = this.a;
|
|
int i = 0;
|
|
int hashCode = (scoAudioState != null ? scoAudioState.hashCode() : 0) * 31;
|
|
ScoAudioState scoAudioState2 = this.b;
|
|
if (scoAudioState2 != null) {
|
|
i = scoAudioState2.hashCode();
|
|
}
|
|
return hashCode + i;
|
|
}
|
|
|
|
public String toString() {
|
|
if (this.b == ScoAudioState.Error) {
|
|
return String.valueOf(this.a);
|
|
}
|
|
StringBuilder L = c.d.b.a.a.L("Update(");
|
|
L.append(this.b);
|
|
L.append(" -> ");
|
|
L.append(this.a);
|
|
L.append(')');
|
|
return L.toString();
|
|
}
|
|
}
|
|
|
|
private ScoAudioState(int i) {
|
|
this.value = i;
|
|
}
|
|
|
|
public final int getValue() {
|
|
return this.value;
|
|
}
|
|
}
|