alexandroid/decompiled/jadx/sources/androidx/media/AudioAttributesImplBase.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

261 lines
8.3 KiB
Java

package androidx.media;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.media.AudioAttributesImpl;
import java.util.Arrays;
import org.openjdk.tools.javac.jvm.ByteCodes;
import rx.Single$$ExternalSyntheticBUOutline0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@RestrictTo({RestrictTo.Scope.LIBRARY})
/* loaded from: classes14.dex */
public class AudioAttributesImplBase implements AudioAttributesImpl {
@RestrictTo({RestrictTo.Scope.LIBRARY})
public int mContentType;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public int mFlags;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public int mLegacyStream;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public int mUsage;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public AudioAttributesImplBase() {
this.mUsage = 0;
this.mContentType = 0;
this.mFlags = 0;
this.mLegacyStream = -1;
}
public static int usageForStreamType(int i) {
switch (i) {
}
return 2;
}
public boolean equals(Object obj) {
if (!(obj instanceof AudioAttributesImplBase)) {
return false;
}
AudioAttributesImplBase audioAttributesImplBase = (AudioAttributesImplBase) obj;
return this.mContentType == audioAttributesImplBase.getContentType() && this.mFlags == audioAttributesImplBase.getFlags() && this.mUsage == audioAttributesImplBase.getUsage() && this.mLegacyStream == audioAttributesImplBase.mLegacyStream;
}
@Override // androidx.media.AudioAttributesImpl
@Nullable
public Object getAudioAttributes() {
return null;
}
@Override // androidx.media.AudioAttributesImpl
public int getContentType() {
return this.mContentType;
}
@Override // androidx.media.AudioAttributesImpl
public int getFlags() {
int i = this.mFlags;
int legacyStreamType = getLegacyStreamType();
if (legacyStreamType == 6) {
i |= 4;
} else if (legacyStreamType == 7) {
i |= 1;
}
return i & ByteCodes.lshrl;
}
@Override // androidx.media.AudioAttributesImpl
public int getLegacyStreamType() {
int i = this.mLegacyStream;
return i != -1 ? i : AudioAttributesCompat.toVolumeStreamType(false, this.mFlags, this.mUsage);
}
@Override // androidx.media.AudioAttributesImpl
public int getRawLegacyStreamType() {
return this.mLegacyStream;
}
@Override // androidx.media.AudioAttributesImpl
public int getUsage() {
return this.mUsage;
}
@Override // androidx.media.AudioAttributesImpl
public int getVolumeControlStream() {
return AudioAttributesCompat.toVolumeStreamType(true, this.mFlags, this.mUsage);
}
public int hashCode() {
return Arrays.hashCode(new Object[]{Integer.valueOf(this.mContentType), Integer.valueOf(this.mFlags), Integer.valueOf(this.mUsage), Integer.valueOf(this.mLegacyStream)});
}
@NonNull
public String toString() {
StringBuilder sb = new StringBuilder("AudioAttributesCompat:");
if (this.mLegacyStream != -1) {
sb.append(" stream=");
sb.append(this.mLegacyStream);
sb.append(" derived");
}
sb.append(" usage=");
sb.append(AudioAttributesCompat.usageToString(this.mUsage));
sb.append(" content=");
sb.append(this.mContentType);
sb.append(" flags=0x");
sb.append(Integer.toHexString(this.mFlags).toUpperCase());
return sb.toString();
}
public AudioAttributesImplBase(int i, int i2, int i3, int i4) {
this.mContentType = i;
this.mFlags = i2;
this.mUsage = i3;
this.mLegacyStream = i4;
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static class Builder implements AudioAttributesImpl.Builder {
private int mContentType;
private int mFlags;
private int mLegacyStream;
private int mUsage;
public Builder(AudioAttributesCompat audioAttributesCompat) {
this.mUsage = 0;
this.mContentType = 0;
this.mFlags = 0;
this.mLegacyStream = -1;
this.mUsage = audioAttributesCompat.getUsage();
this.mContentType = audioAttributesCompat.getContentType();
this.mFlags = audioAttributesCompat.getFlags();
this.mLegacyStream = audioAttributesCompat.getRawLegacyStreamType();
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
private Builder setInternalLegacyStreamType(int i) {
switch (i) {
case 0:
this.mContentType = 1;
break;
case 1:
this.mContentType = 4;
break;
case 2:
this.mContentType = 4;
break;
case 3:
this.mContentType = 2;
break;
case 4:
this.mContentType = 4;
break;
case 5:
this.mContentType = 4;
break;
case 6:
this.mContentType = 1;
this.mFlags |= 4;
break;
case 7:
this.mFlags = 1 | this.mFlags;
this.mContentType = 4;
break;
case 8:
this.mContentType = 4;
break;
case 9:
this.mContentType = 4;
break;
case 10:
this.mContentType = 1;
break;
default:
Log.e("AudioAttributesCompat", "Invalid stream type " + i + " for AudioAttributesCompat");
break;
}
this.mUsage = AudioAttributesImplBase.usageForStreamType(i);
return this;
}
@Override // androidx.media.AudioAttributesImpl.Builder
@NonNull
public AudioAttributesImpl build() {
return new AudioAttributesImplBase(this.mContentType, this.mFlags, this.mUsage, this.mLegacyStream);
}
@Override // androidx.media.AudioAttributesImpl.Builder
@NonNull
public Builder setContentType(int i) {
if (i == 0 || i == 1 || i == 2 || i == 3 || i == 4) {
this.mContentType = i;
return this;
}
this.mContentType = 0;
return this;
}
@Override // androidx.media.AudioAttributesImpl.Builder
@NonNull
public Builder setFlags(int i) {
this.mFlags = (i & 1023) | this.mFlags;
return this;
}
@Override // androidx.media.AudioAttributesImpl.Builder
@NonNull
public Builder setLegacyStreamType(int i) {
if (i != 10) {
this.mLegacyStream = i;
return setInternalLegacyStreamType(i);
}
Single$$ExternalSyntheticBUOutline0.m$3("STREAM_ACCESSIBILITY is not a legacy stream type that was used for audio playback");
return null;
}
@Override // androidx.media.AudioAttributesImpl.Builder
@NonNull
public Builder setUsage(int i) {
switch (i) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
this.mUsage = i;
break;
case 16:
this.mUsage = 12;
break;
default:
this.mUsage = 0;
break;
}
return this;
}
public Builder() {
this.mUsage = 0;
this.mContentType = 0;
this.mFlags = 0;
this.mLegacyStream = -1;
}
}
}