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
e0253714
authored
Oct 28, 2019
by
samrobinson
Committed by
Oliver Woodman
Oct 30, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix memory leak and calling listener when disabled in AudioBecomingNoisyManager.
PiperOrigin-RevId: 277030401
parent
ff82a132
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
library/core/src/main/java/com/google/android/exoplayer2/AudioBecomingNoisyManager.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/AudioBecomingNoisyManager.java
View file @
e0253714
...
@@ -55,7 +55,7 @@ import android.os.Handler;
...
@@ -55,7 +55,7 @@ import android.os.Handler;
}
}
}
}
private
static
final
class
AudioBecomingNoisyReceiver
extends
BroadcastReceiver
{
private
final
class
AudioBecomingNoisyReceiver
extends
BroadcastReceiver
implements
Runnable
{
private
final
EventListener
listener
;
private
final
EventListener
listener
;
private
final
Handler
eventHandler
;
private
final
Handler
eventHandler
;
...
@@ -67,7 +67,14 @@ import android.os.Handler;
...
@@ -67,7 +67,14 @@ import android.os.Handler;
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
AudioManager
.
ACTION_AUDIO_BECOMING_NOISY
.
equals
(
intent
.
getAction
()))
{
if
(
AudioManager
.
ACTION_AUDIO_BECOMING_NOISY
.
equals
(
intent
.
getAction
()))
{
eventHandler
.
post
(
listener:
:
onAudioBecomingNoisy
);
eventHandler
.
post
(
this
);
}
}
@Override
public
void
run
()
{
if
(
receiverRegistered
)
{
listener
.
onAudioBecomingNoisy
();
}
}
}
}
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
e0253714
...
@@ -1265,6 +1265,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1265,6 +1265,7 @@ public class SimpleExoPlayer extends BasePlayer
@Override
@Override
public
void
release
()
{
public
void
release
()
{
verifyApplicationThread
();
verifyApplicationThread
();
audioBecomingNoisyManager
.
setEnabled
(
false
);
audioFocusManager
.
handleStop
();
audioFocusManager
.
handleStop
();
wakeLockManager
.
setStayAwake
(
false
);
wakeLockManager
.
setStayAwake
(
false
);
player
.
release
();
player
.
release
();
...
...
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