Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
88cedf01
authored
Mar 02, 2022
by
bachinger
Committed by
Ian Baker
Mar 03, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Avoid NPE in onStartCommand when action factory isn't instantiated
PiperOrigin-RevId: 431969914
parent
6c6e256c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
libraries/session/src/main/java/androidx/media3/session/MediaSessionService.java
libraries/session/src/main/java/androidx/media3/session/MediaSessionService.java
View file @
88cedf01
...
...
@@ -321,11 +321,7 @@ public abstract class MediaSessionService extends Service {
return
START_STICKY
;
}
DefaultActionFactory
actionFactory
;
synchronized
(
lock
)
{
actionFactory
=
checkStateNotNull
(
this
.
actionFactory
);
}
DefaultActionFactory
actionFactory
=
getActionFactory
();
@Nullable
Uri
uri
=
intent
.
getData
();
@Nullable
MediaSession
session
=
uri
!=
null
?
MediaSession
.
getSession
(
uri
)
:
null
;
if
(
actionFactory
.
isMediaAction
(
intent
))
{
...
...
@@ -396,15 +392,23 @@ public abstract class MediaSessionService extends Service {
if
(
mediaNotificationProvider
==
null
)
{
mediaNotificationProvider
=
new
DefaultMediaNotificationProvider
(
getApplicationContext
());
}
actionFactory
=
new
DefaultActionFactory
(
/* service= */
this
);
mediaNotificationManager
=
new
MediaNotificationManager
(
/* mediaSessionService= */
this
,
mediaNotificationProvider
,
actionFactory
);
/* mediaSessionService= */
this
,
mediaNotificationProvider
,
getActionFactory
()
);
}
return
mediaNotificationManager
;
}
}
private
DefaultActionFactory
getActionFactory
()
{
synchronized
(
lock
)
{
if
(
actionFactory
==
null
)
{
actionFactory
=
new
DefaultActionFactory
(
/* service= */
this
);
}
return
actionFactory
;
}
}
private
static
final
class
MediaSessionServiceStub
extends
IMediaSessionService
.
Stub
{
private
final
WeakReference
<
MediaSessionService
>
serviceReference
;
...
...
@@ -469,7 +473,7 @@ public abstract class MediaSessionService extends Service {
remoteUserInfo
,
/* controllerVersion= */
request
.
version
,
isTrusted
,
/* c
ontrollerC
b= */
null
,
/* cb= */
null
,
request
.
connectionHints
);
@Nullable
MediaSession
session
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment