apkfuckery/com.discord/smali/androidx/media/session/MediaButtonReceiver$MediaButtonConnectionCallback.smali

187 lines
6.1 KiB
Smali
Raw Normal View History

2020-11-12 02:11:44 +00:00
.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
2020-11-16 01:00:50 +00:00
.field public final mContext:Landroid/content/Context;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
.field public final mIntent:Landroid/content/Intent;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
.field public mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
.field public final mPendingResult:Landroid/content/BroadcastReceiver$PendingResult;
2020-11-12 02:11:44 +00:00
# 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
2020-11-16 01:00:50 +00:00
.locals 1
2020-11-12 02:11:44 +00:00
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;
2020-11-16 01:00:50 +00:00
invoke-interface {v0}, Landroid/support/v4/media/MediaBrowserCompat$c;->a()V
2020-11-12 02:11:44 +00:00
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;
2020-11-16 01:00:50 +00:00
invoke-interface {v1}, Landroid/support/v4/media/MediaBrowserCompat$c;->b()Landroid/support/v4/media/session/MediaSessionCompat$Token;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
move-result-object v1
2020-11-12 02:11:44 +00:00
new-instance v2, Ljava/util/HashSet;
invoke-direct {v2}, Ljava/util/HashSet;-><init>()V
2020-11-16 01:00:50 +00:00
if-eqz v1, :cond_3
2020-11-12 02:11:44 +00:00
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x18
2020-11-16 01:00:50 +00:00
if-lt v2, v3, :cond_0
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
new-instance v2, Lt/a/b/b/b/e;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
invoke-direct {v2, v0, v1}, Lt/a/b/b/b/e;-><init>(Landroid/content/Context;Landroid/support/v4/media/session/MediaSessionCompat$Token;)V
2020-11-12 02:11:44 +00:00
goto :goto_0
2020-11-16 01:00:50 +00:00
:cond_0
2020-11-12 02:11:44 +00:00
const/16 v3, 0x17
2020-11-16 01:00:50 +00:00
if-lt v2, v3, :cond_1
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
new-instance v2, Lt/a/b/b/b/d;
2020-11-12 02:11:44 +00:00
2020-11-16 01:00:50 +00:00
invoke-direct {v2, v0, v1}, Lt/a/b/b/b/d;-><init>(Landroid/content/Context;Landroid/support/v4/media/session/MediaSessionCompat$Token;)V
2020-11-12 02:11:44 +00:00
goto :goto_0
2020-11-16 01:00:50 +00:00
:cond_1
2020-11-12 02:11:44 +00:00
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;
2020-11-16 01:00:50 +00:00
if-eqz v0, :cond_2
2020-11-12 02:11:44 +00:00
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
2020-11-16 01:00:50 +00:00
:cond_2
2020-11-12 02:11:44 +00:00
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
2020-11-16 01:00:50 +00:00
:cond_3
2020-11-12 02:11:44 +00:00
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