apkfuckery/com.discord/smali/androidx/media/AudioAttributesImplApi21.smali

416 lines
10 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class Landroidx/media/AudioAttributesImplApi21;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "AudioAttributesImplApi21.java"
2019-02-04 20:08:30 +00:00
# interfaces
.implements Landroidx/media/AudioAttributesImpl;
# annotations
.annotation build Landroid/annotation/TargetApi;
value = 0x15
.end annotation
# static fields
.field private static final TAG:Ljava/lang/String; = "AudioAttributesCompat21"
.field static sAudioAttributesToLegacyStreamType:Ljava/lang/reflect/Method;
# instance fields
.field mAudioAttributes:Landroid/media/AudioAttributes;
.field mLegacyStreamType:I
# direct methods
.method constructor <init>()V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, -0x1
iput v0, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
return-void
.end method
.method constructor <init>(Landroid/media/AudioAttributes;)V
.locals 1
const/4 v0, -0x1
invoke-direct {p0, p1, v0}, Landroidx/media/AudioAttributesImplApi21;-><init>(Landroid/media/AudioAttributes;I)V
return-void
.end method
.method constructor <init>(Landroid/media/AudioAttributes;I)V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, -0x1
iput v0, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
iput-object p1, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
iput p2, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
return-void
.end method
.method public static fromBundle(Landroid/os/Bundle;)Landroidx/media/AudioAttributesImpl;
.locals 3
const/4 v0, 0x0
if-nez p0, :cond_0
return-object v0
:cond_0
const-string v1, "androidx.media.audio_attrs.FRAMEWORKS"
invoke-virtual {p0, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object v1
check-cast v1, Landroid/media/AudioAttributes;
if-nez v1, :cond_1
return-object v0
:cond_1
const-string v0, "androidx.media.audio_attrs.LEGACY_STREAM_TYPE"
const/4 v2, -0x1
invoke-virtual {p0, v0, v2}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I
move-result p0
new-instance v0, Landroidx/media/AudioAttributesImplApi21;
invoke-direct {v0, v1, p0}, Landroidx/media/AudioAttributesImplApi21;-><init>(Landroid/media/AudioAttributes;I)V
return-object v0
.end method
.method static getAudioAttributesToLegacyStreamTypeMethod()Ljava/lang/reflect/Method;
.locals 5
:try_start_0
sget-object v0, Landroidx/media/AudioAttributesImplApi21;->sAudioAttributesToLegacyStreamType:Ljava/lang/reflect/Method;
if-nez v0, :cond_0
const-class v0, Landroid/media/AudioAttributes;
const-string v1, "toLegacyStreamType"
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/Class;
const/4 v3, 0x0
const-class v4, Landroid/media/AudioAttributes;
aput-object v4, v2, v3
invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
sput-object v0, Landroidx/media/AudioAttributesImplApi21;->sAudioAttributesToLegacyStreamType:Ljava/lang/reflect/Method;
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
:cond_0
sget-object v0, Landroidx/media/AudioAttributesImplApi21;->sAudioAttributesToLegacyStreamType:Ljava/lang/reflect/Method;
return-object v0
:catch_0
const/4 v0, 0x0
return-object v0
.end method
# virtual methods
.method public equals(Ljava/lang/Object;)Z
.locals 1
instance-of v0, p1, Landroidx/media/AudioAttributesImplApi21;
if-nez v0, :cond_0
const/4 p1, 0x0
return p1
:cond_0
check-cast p1, Landroidx/media/AudioAttributesImplApi21;
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
iget-object p1, p1, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0, p1}, Landroid/media/AudioAttributes;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public getAudioAttributes()Ljava/lang/Object;
.locals 1
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
return-object v0
.end method
.method public getContentType()I
.locals 1
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0}, Landroid/media/AudioAttributes;->getContentType()I
move-result v0
return v0
.end method
.method public getFlags()I
.locals 1
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0}, Landroid/media/AudioAttributes;->getFlags()I
move-result v0
return v0
.end method
.method public getLegacyStreamType()I
.locals 6
iget v0, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
const/4 v1, -0x1
if-eq v0, v1, :cond_0
return v0
:cond_0
invoke-static {}, Landroidx/media/AudioAttributesImplApi21;->getAudioAttributesToLegacyStreamTypeMethod()Ljava/lang/reflect/Method;
move-result-object v0
if-nez v0, :cond_1
const-string v0, "AudioAttributesCompat21"
new-instance v2, Ljava/lang/StringBuilder;
const-string v3, "No AudioAttributes#toLegacyStreamType() on API: "
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
return v1
:cond_1
const/4 v2, 0x0
const/4 v3, 0x1
:try_start_0
new-array v3, v3, [Ljava/lang/Object;
const/4 v4, 0x0
iget-object v5, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
aput-object v5, v3, v4
invoke-virtual {v0, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
:try_end_0
2019-02-17 02:24:41 +00:00
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_1
2019-02-04 20:08:30 +00:00
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
return v0
:catch_0
move-exception v0
2019-02-17 02:24:41 +00:00
goto :goto_0
:catch_1
move-exception v0
:goto_0
2019-02-04 20:08:30 +00:00
const-string v2, "AudioAttributesCompat21"
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "getLegacyStreamType() failed on API: "
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sget v4, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return v1
.end method
.method public getRawLegacyStreamType()I
.locals 1
iget v0, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
return v0
.end method
.method public getUsage()I
.locals 1
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0}, Landroid/media/AudioAttributes;->getUsage()I
move-result v0
return v0
.end method
.method public getVolumeControlStream()I
.locals 3
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x1a
if-lt v0, v1, :cond_0
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0}, Landroid/media/AudioAttributes;->getVolumeControlStream()I
move-result v0
return v0
:cond_0
const/4 v0, 0x1
invoke-virtual {p0}, Landroidx/media/AudioAttributesImplApi21;->getFlags()I
move-result v1
invoke-virtual {p0}, Landroidx/media/AudioAttributesImplApi21;->getUsage()I
move-result v2
invoke-static {v0, v1, v2}, Landroidx/media/AudioAttributesCompat;->toVolumeStreamType(ZII)I
move-result v0
return v0
.end method
.method public hashCode()I
.locals 1
iget-object v0, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0}, Landroid/media/AudioAttributes;->hashCode()I
move-result v0
return v0
.end method
.method public toBundle()Landroid/os/Bundle;
.locals 3
.annotation build Landroidx/annotation/NonNull;
.end annotation
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
const-string v1, "androidx.media.audio_attrs.FRAMEWORKS"
iget-object v2, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
iget v1, p0, Landroidx/media/AudioAttributesImplApi21;->mLegacyStreamType:I
const/4 v2, -0x1
if-eq v1, v2, :cond_0
2019-02-04 20:29:01 +00:00
const-string v2, "androidx.media.audio_attrs.LEGACY_STREAM_TYPE"
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {v0, v2, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
2019-02-04 20:08:30 +00:00
:cond_0
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "AudioAttributesCompat: audioattributes="
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Landroidx/media/AudioAttributesImplApi21;->mAudioAttributes:Landroid/media/AudioAttributes;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method