apkfuckery/com.discord/smali/androidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback.smali
2020-07-16 19:51:49 +00:00

186 lines
6.1 KiB
Smali

.class public Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;
.super Landroid/support/v4/media/MediaBrowserCompat$b;
.source "MediaButtonReceiver.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/media/session/MediaButtonReceiver;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "MediaButtonConnectionCallback"
.end annotation
# instance fields
.field public final mContext:Landroid/content/Context;
.field public final mIntent:Landroid/content/Intent;
.field public mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
.field public final mPendingResult:Landroid/content/BroadcastReceiver$PendingResult;
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/content/Intent;Landroid/content/BroadcastReceiver$PendingResult;)V
.locals 0
invoke-direct {p0}, Landroid/support/v4/media/MediaBrowserCompat$b;-><init>()V
iput-object p1, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mContext:Landroid/content/Context;
iput-object p2, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mIntent:Landroid/content/Intent;
iput-object p3, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mPendingResult:Landroid/content/BroadcastReceiver$PendingResult;
return-void
.end method
.method private finish()V
.locals 1
iget-object v0, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
iget-object v0, v0, Landroid/support/v4/media/MediaBrowserCompat;->a:Landroid/support/v4/media/MediaBrowserCompat$c;
invoke-interface {v0}, Landroid/support/v4/media/MediaBrowserCompat$c;->a()V
iget-object v0, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mPendingResult:Landroid/content/BroadcastReceiver$PendingResult;
invoke-virtual {v0}, Landroid/content/BroadcastReceiver$PendingResult;->finish()V
return-void
.end method
# virtual methods
.method public onConnected()V
.locals 4
:try_start_0
iget-object v0, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mContext:Landroid/content/Context;
iget-object v1, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
iget-object v1, v1, Landroid/support/v4/media/MediaBrowserCompat;->a:Landroid/support/v4/media/MediaBrowserCompat$c;
invoke-interface {v1}, Landroid/support/v4/media/MediaBrowserCompat$c;->c()Landroid/support/v4/media/session/MediaSessionCompat$Token;
move-result-object v1
new-instance v2, Ljava/util/HashSet;
invoke-direct {v2}, Ljava/util/HashSet;-><init>()V
if-eqz v1, :cond_3
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x18
if-lt v2, v3, :cond_0
new-instance v2, Ld0/a/b/b/b/e;
invoke-direct {v2, v0, v1}, Ld0/a/b/b/b/e;-><init>(Landroid/content/Context;Landroid/support/v4/media/session/MediaSessionCompat$Token;)V
goto :goto_0
:cond_0
const/16 v3, 0x17
if-lt v2, v3, :cond_1
new-instance v2, Ld0/a/b/b/b/d;
invoke-direct {v2, v0, v1}, Ld0/a/b/b/b/d;-><init>(Landroid/content/Context;Landroid/support/v4/media/session/MediaSessionCompat$Token;)V
goto :goto_0
:cond_1
new-instance v2, Landroid/support/v4/media/session/MediaControllerCompat$MediaControllerImplApi21;
invoke-direct {v2, v0, v1}, Landroid/support/v4/media/session/MediaControllerCompat$MediaControllerImplApi21;-><init>(Landroid/content/Context;Landroid/support/v4/media/session/MediaSessionCompat$Token;)V
:goto_0
iget-object v0, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.KEY_EVENT"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/view/KeyEvent;
if-eqz v0, :cond_2
iget-object v1, v2, Landroid/support/v4/media/session/MediaControllerCompat$MediaControllerImplApi21;->a:Ljava/lang/Object;
check-cast v1, Landroid/media/session/MediaController;
invoke-virtual {v1, v0}, Landroid/media/session/MediaController;->dispatchMediaButtonEvent(Landroid/view/KeyEvent;)Z
goto :goto_1
:cond_2
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "KeyEvent may not be null"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_3
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "sessionToken must not be null"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
move-exception v0
const-string v1, "MediaButtonReceiver"
const-string v2, "Failed to create a media controller"
invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:goto_1
invoke-direct {p0}, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->finish()V
return-void
.end method
.method public onConnectionFailed()V
.locals 0
invoke-direct {p0}, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->finish()V
return-void
.end method
.method public onConnectionSuspended()V
.locals 0
invoke-direct {p0}, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->finish()V
return-void
.end method
.method public setMediaBrowser(Landroid/support/v4/media/MediaBrowserCompat;)V
.locals 0
iput-object p1, p0, Landroidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback;->mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
return-void
.end method