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
a26d7b82
authored
Jan 31, 2022
by
christosts
Committed by
Andrew Lewis
Feb 01, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename MediaNotificationHandler to MediaNotificationManager
PiperOrigin-RevId: 425359015
parent
23ef7b11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
libraries/session/src/main/java/androidx/media3/session/MediaNotificationHandler.java → libraries/session/src/main/java/androidx/media3/session/MediaNotificationManager.java
libraries/session/src/main/java/androidx/media3/session/MediaSessionService.java
libraries/session/src/main/java/androidx/media3/session/MediaNotification
Handl
er.java
→
libraries/session/src/main/java/androidx/media3/session/MediaNotification
Manag
er.java
View file @
a26d7b82
/*
* Copyright 20
19
The Android Open Source Project
* Copyright 20
22
The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -52,10 +52,10 @@ import java.util.concurrent.TimeUnit;
import
java.util.concurrent.TimeoutException
;
/**
*
Class to provide default media notification for {@link MediaSessionService}, and set the service
*
as
foreground/background according to the player state.
*
Provides default media notifications for {@link MediaSessionService} and sets the service as
* foreground/background according to the player state.
*/
/* package */
class
MediaNotificationHandl
er
{
/* package */
final
class
MediaNotificationManag
er
{
private
static
final
int
NOTIFICATION_ID
=
1001
;
private
static
final
String
NOTIFICATION_CHANNEL_ID
=
"default_channel_id"
;
...
...
@@ -73,7 +73,7 @@ import java.util.concurrent.TimeoutException;
private
final
Map
<
MediaSession
,
ListenableFuture
<
MediaController
>>
controllerMap
;
public
MediaNotification
Handl
er
(
MediaSessionService
service
)
{
public
MediaNotification
Manag
er
(
MediaSessionService
service
)
{
this
.
service
=
service
;
Handler
mainHandler
=
new
Handler
(
Looper
.
getMainLooper
());
mainExecutor
=
(
runnable
)
->
Util
.
postOrRun
(
mainHandler
,
runnable
);
...
...
libraries/session/src/main/java/androidx/media3/session/MediaSessionService.java
View file @
a26d7b82
...
...
@@ -145,7 +145,7 @@ public abstract class MediaSessionService extends Service {
@GuardedBy
(
"lock"
)
@Nullable
private
MediaNotification
Handl
er
notificationHandler
;
private
MediaNotification
Manag
er
notificationHandler
;
/** Creates a service. */
public
MediaSessionService
()
{
...
...
@@ -165,7 +165,7 @@ public abstract class MediaSessionService extends Service {
super
.
onCreate
();
synchronized
(
lock
)
{
stub
=
new
MediaSessionServiceStub
(
this
);
notificationHandler
=
new
MediaNotification
Handl
er
(
this
);
notificationHandler
=
new
MediaNotification
Manag
er
(
this
);
}
}
...
...
@@ -227,7 +227,7 @@ public abstract class MediaSessionService extends Service {
if
(
old
==
null
)
{
// Session has returned for the first time. Register callbacks.
// TODO(b/191644474): Check whether the session is registered to multiple services.
MediaNotification
Handl
er
handler
;
MediaNotification
Manag
er
handler
;
synchronized
(
lock
)
{
handler
=
checkStateNotNull
(
notificationHandler
);
}
...
...
@@ -245,7 +245,7 @@ public abstract class MediaSessionService extends Service {
*/
public
final
void
removeSession
(
MediaSession
session
)
{
checkNotNull
(
session
,
"session must not be null"
);
MediaNotification
Handl
er
handler
;
MediaNotification
Manag
er
handler
;
synchronized
(
lock
)
{
sessions
.
remove
(
session
.
getId
());
handler
=
checkStateNotNull
(
notificationHandler
);
...
...
@@ -273,7 +273,7 @@ public abstract class MediaSessionService extends Service {
@Nullable
public
MediaNotification
onUpdateNotification
(
MediaSession
session
)
{
checkNotNull
(
session
,
"session must not be null"
);
MediaNotification
Handl
er
handler
;
MediaNotification
Manag
er
handler
;
synchronized
(
lock
)
{
handler
=
checkStateNotNull
(
notificationHandler
,
"Service hasn't created"
);
}
...
...
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