discord-jadx/app/src/main/java/com/discord/rtcconnection/enums/BluetoothProfileConnectionS...

108 lines
4.4 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: BluetoothProfileConnectionState.kt */
public enum BluetoothProfileConnectionState {
Disconnected(0),
Connecting(1),
Connected(2),
Disconnecting(3);
public static final a Companion = new a(null);
private final int value;
/* compiled from: BluetoothProfileConnectionState.kt */
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
public final BluetoothProfileConnectionState a(int i) {
BluetoothProfileConnectionState[] values = BluetoothProfileConnectionState.values();
for (int i2 = 0; i2 < 4; i2++) {
BluetoothProfileConnectionState bluetoothProfileConnectionState = values[i2];
if (bluetoothProfileConnectionState.getValue() == i) {
return bluetoothProfileConnectionState;
}
}
return null;
}
public final b b(Intent intent) {
m.checkNotNullParameter(intent, "intent");
if (m.areEqual(intent.getAction(), "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED")) {
Integer E0 = AnimatableValueParser.E0(intent, "android.bluetooth.profile.extra.PREVIOUS_STATE");
BluetoothProfileConnectionState bluetoothProfileConnectionState = null;
BluetoothProfileConnectionState a = E0 != null ? BluetoothProfileConnectionState.Companion.a(E0.intValue()) : null;
Integer E02 = AnimatableValueParser.E0(intent, "android.bluetooth.profile.extra.STATE");
if (E02 != null) {
bluetoothProfileConnectionState = BluetoothProfileConnectionState.Companion.a(E02.intValue());
}
return new b(a, bluetoothProfileConnectionState, (BluetoothDevice) intent.getParcelableExtra("android.bluetooth.device.extra.DEVICE"));
}
throw new IllegalArgumentException("Failed requirement.".toString());
}
}
/* compiled from: BluetoothProfileConnectionState.kt */
public static final class b {
public final BluetoothProfileConnectionState a;
public final BluetoothProfileConnectionState b;
/* renamed from: c reason: collision with root package name */
public final BluetoothDevice f2106c;
public b(BluetoothProfileConnectionState bluetoothProfileConnectionState, BluetoothProfileConnectionState bluetoothProfileConnectionState2, BluetoothDevice bluetoothDevice) {
this.a = bluetoothProfileConnectionState;
this.b = bluetoothProfileConnectionState2;
this.f2106c = 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.f2106c, bVar.f2106c);
}
public int hashCode() {
BluetoothProfileConnectionState bluetoothProfileConnectionState = this.a;
int i = 0;
int hashCode = (bluetoothProfileConnectionState != null ? bluetoothProfileConnectionState.hashCode() : 0) * 31;
BluetoothProfileConnectionState bluetoothProfileConnectionState2 = this.b;
int hashCode2 = (hashCode + (bluetoothProfileConnectionState2 != null ? bluetoothProfileConnectionState2.hashCode() : 0)) * 31;
BluetoothDevice bluetoothDevice = this.f2106c;
if (bluetoothDevice != null) {
i = bluetoothDevice.hashCode();
}
return hashCode2 + i;
}
public String toString() {
StringBuilder L = c.d.b.a.a.L("Update(previous=");
L.append(this.a);
L.append(", current=");
L.append(this.b);
L.append(", device=");
L.append(this.f2106c);
L.append(")");
return L.toString();
}
}
private BluetoothProfileConnectionState(int i) {
this.value = i;
}
public final int getValue() {
return this.value;
}
}