109 lines
4.3 KiB
Java
109 lines
4.3 KiB
Java
package com.discord.rtcconnection.enums;
|
|
|
|
import android.bluetooth.BluetoothDevice;
|
|
import android.content.Intent;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: BluetoothHeadsetAudioState.kt */
|
|
public enum BluetoothHeadsetAudioState {
|
|
Disconnected(10),
|
|
Connecting(11),
|
|
Connected(12);
|
|
|
|
public static final a Companion = new a(null);
|
|
private final int value;
|
|
|
|
/* compiled from: BluetoothHeadsetAudioState.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
|
|
public final BluetoothHeadsetAudioState a(int i) {
|
|
BluetoothHeadsetAudioState[] values = BluetoothHeadsetAudioState.values();
|
|
for (int i2 = 0; i2 < 3; i2++) {
|
|
BluetoothHeadsetAudioState bluetoothHeadsetAudioState = values[i2];
|
|
if (bluetoothHeadsetAudioState.getValue() == i) {
|
|
return bluetoothHeadsetAudioState;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final b b(Intent intent) {
|
|
m.checkNotNullParameter(intent, "intent");
|
|
if (m.areEqual(intent.getAction(), "android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED")) {
|
|
m.checkNotNullParameter(intent, "$this$getBluetoothDeviceExtra");
|
|
BluetoothDevice bluetoothDevice = (BluetoothDevice) intent.getParcelableExtra("android.bluetooth.device.extra.DEVICE");
|
|
Integer E0 = AnimatableValueParser.E0(intent, "android.bluetooth.profile.extra.PREVIOUS_STATE");
|
|
BluetoothHeadsetAudioState bluetoothHeadsetAudioState = null;
|
|
BluetoothHeadsetAudioState a = E0 != null ? BluetoothHeadsetAudioState.Companion.a(E0.intValue()) : null;
|
|
Integer E02 = AnimatableValueParser.E0(intent, "android.bluetooth.profile.extra.STATE");
|
|
if (E02 != null) {
|
|
bluetoothHeadsetAudioState = BluetoothHeadsetAudioState.Companion.a(E02.intValue());
|
|
}
|
|
return new b(bluetoothHeadsetAudioState, a, bluetoothDevice);
|
|
}
|
|
throw new IllegalArgumentException("Failed requirement.".toString());
|
|
}
|
|
}
|
|
|
|
/* compiled from: BluetoothHeadsetAudioState.kt */
|
|
public static final class b {
|
|
public final BluetoothHeadsetAudioState a;
|
|
public final BluetoothHeadsetAudioState b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final BluetoothDevice f2105c;
|
|
|
|
public b(BluetoothHeadsetAudioState bluetoothHeadsetAudioState, BluetoothHeadsetAudioState bluetoothHeadsetAudioState2, BluetoothDevice bluetoothDevice) {
|
|
this.a = bluetoothHeadsetAudioState;
|
|
this.b = bluetoothHeadsetAudioState2;
|
|
this.f2105c = bluetoothDevice;
|
|
}
|
|
|
|
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) && m.areEqual(this.f2105c, bVar.f2105c);
|
|
}
|
|
|
|
public int hashCode() {
|
|
BluetoothHeadsetAudioState bluetoothHeadsetAudioState = this.a;
|
|
int i = 0;
|
|
int hashCode = (bluetoothHeadsetAudioState != null ? bluetoothHeadsetAudioState.hashCode() : 0) * 31;
|
|
BluetoothHeadsetAudioState bluetoothHeadsetAudioState2 = this.b;
|
|
int hashCode2 = (hashCode + (bluetoothHeadsetAudioState2 != null ? bluetoothHeadsetAudioState2.hashCode() : 0)) * 31;
|
|
BluetoothDevice bluetoothDevice = this.f2105c;
|
|
if (bluetoothDevice != null) {
|
|
i = bluetoothDevice.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder L = c.d.b.a.a.L("Update(current=");
|
|
L.append(this.a);
|
|
L.append(", previous=");
|
|
L.append(this.b);
|
|
L.append(", device=");
|
|
L.append(this.f2105c);
|
|
L.append(")");
|
|
return L.toString();
|
|
}
|
|
}
|
|
|
|
private BluetoothHeadsetAudioState(int i) {
|
|
this.value = i;
|
|
}
|
|
|
|
public final int getValue() {
|
|
return this.value;
|
|
}
|
|
}
|