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 22:05:17 +00:00
|
|
|
.field private final mContext:Landroid/content/Context;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private final mIntent:Landroid/content/Intent;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private mMediaBrowser:Landroid/support/v4/media/MediaBrowserCompat;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private 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 22:05:17 +00:00
|
|
|
.locals 5
|
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 22:05:17 +00:00
|
|
|
check-cast v0, Landroid/support/v4/media/MediaBrowserCompat$d;
|
|
|
|
|
|
|
|
iget-object v1, v0, Landroid/support/v4/media/MediaBrowserCompat$d;->f:Landroid/support/v4/media/MediaBrowserCompat$h;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
iget-object v2, v0, Landroid/support/v4/media/MediaBrowserCompat$d;->g:Landroid/os/Messenger;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
const/4 v3, 0x7
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-virtual {v1, v3, v4, v2}, Landroid/support/v4/media/MediaBrowserCompat$h;->a(ILandroid/os/Bundle;Landroid/os/Messenger;)V
|
|
|
|
:try_end_0
|
|
|
|
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
const-string v1, "MediaBrowserCompat"
|
|
|
|
|
|
|
|
const-string v2, "Remote error unregistering client messenger."
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
:goto_0
|
|
|
|
iget-object v0, v0, Landroid/support/v4/media/MediaBrowserCompat$d;->b:Landroid/media/browse/MediaBrowser;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/media/browse/MediaBrowser;->disconnect()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 22:05:17 +00:00
|
|
|
check-cast v1, Landroid/support/v4/media/MediaBrowserCompat$d;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
iget-object v2, v1, Landroid/support/v4/media/MediaBrowserCompat$d;->h:Landroid/support/v4/media/session/MediaSessionCompat$Token;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
iget-object v2, v1, Landroid/support/v4/media/MediaBrowserCompat$d;->b:Landroid/media/browse/MediaBrowser;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Landroid/media/browse/MediaBrowser;->getSessionToken()Landroid/media/session/MediaSession$Token;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Landroid/support/v4/media/session/MediaSessionCompat$Token;->a(Ljava/lang/Object;Ls/a/b/b/b/b;)Landroid/support/v4/media/session/MediaSessionCompat$Token;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
iput-object v2, v1, Landroid/support/v4/media/MediaBrowserCompat$d;->h:Landroid/support/v4/media/session/MediaSessionCompat$Token;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v1, v1, Landroid/support/v4/media/MediaBrowserCompat$d;->h:Landroid/support/v4/media/session/MediaSessionCompat$Token;
|
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 22:05:17 +00:00
|
|
|
if-eqz v1, :cond_4
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/16 v3, 0x18
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-lt v2, v3, :cond_1
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
new-instance v2, Ls/a/b/b/b/e;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-direct {v2, v0, v1}, Ls/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 22:05:17 +00:00
|
|
|
:cond_1
|
2020-11-12 02:11:44 +00:00
|
|
|
const/16 v3, 0x17
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-lt v2, v3, :cond_2
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
new-instance v2, Ls/a/b/b/b/d;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-direct {v2, v0, v1}, Ls/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 22:05:17 +00:00
|
|
|
:cond_2
|
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 22:05:17 +00:00
|
|
|
if-eqz v0, :cond_3
|
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 22:05:17 +00:00
|
|
|
:cond_3
|
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 22:05:17 +00:00
|
|
|
:cond_4
|
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
|