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
f3185d07
authored
Nov 21, 2019
by
olly
Committed by
Oliver Woodman
Nov 22, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Improve WakeLock/AudioBecomingNoisy Javadoc
PiperOrigin-RevId: 281764207
parent
7c24ba09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
f3185d07
...
@@ -801,7 +801,10 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -801,7 +801,10 @@ public class SimpleExoPlayer extends BasePlayer
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy">audio
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy">audio
* becoming noisy</a> documentation for more information.
* becoming noisy</a> documentation for more information.
*
*
* @param handleAudioBecomingNoisy True if the player should handle audio becoming noisy.
* <p>This feature is not enabled by default.
*
* @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is
* rerouted from a headset to device speakers.
*/
*/
public
void
setHandleAudioBecomingNoisy
(
boolean
handleAudioBecomingNoisy
)
{
public
void
setHandleAudioBecomingNoisy
(
boolean
handleAudioBecomingNoisy
)
{
verifyApplicationThread
();
verifyApplicationThread
();
...
@@ -1431,16 +1434,20 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -1431,16 +1434,20 @@ public class SimpleExoPlayer extends BasePlayer
}
}
/**
/**
* Sets whether to enable the acquiring and releasing of a {@link
* Sets whether the player should use a {@link android.os.PowerManager.WakeLock} to ensure the
* android.os.PowerManager.WakeLock}.
* device stays awake for playback, even when the screen is off.
*
* <p>Enabling this feature requires the {@link android.Manifest.permission#WAKE_LOCK} permission.
* It should be used together with a foreground {@link android.app.Service} for use cases where
* playback can occur when the screen is off (e.g. background audio playback). It is not useful if
* the screen will always be on during playback (e.g. foreground video playback).
*
*
* <p>By default, automatic wake lock handling is not enabled. Enabling this on will acquire the
* <p>This feature is not enabled by default. If enabled, a WakeLock is held whenever the player
* WakeLock if necessary. Disabling this will release the WakeLock if it is held.
* is in the {@link #STATE_READY READY} or {@link #STATE_BUFFERING BUFFERING} states with {@code
* playWhenReady = true}.
*
*
* @param handleWakeLock True if the player should handle a {@link
* @param handleWakeLock Whether the player should use a {@link android.os.PowerManager.WakeLock}
* android.os.PowerManager.WakeLock}, false otherwise. This is for use with a foreground
* to ensure the device stays awake for playback, even when the screen is off.
* {@link android.app.Service}, for allowing audio playback with the screen off. Please note
* that enabling this requires the {@link android.Manifest.permission#WAKE_LOCK} permission.
*/
*/
public
void
setHandleWakeLock
(
boolean
handleWakeLock
)
{
public
void
setHandleWakeLock
(
boolean
handleWakeLock
)
{
wakeLockManager
.
setEnabled
(
handleWakeLock
);
wakeLockManager
.
setEnabled
(
handleWakeLock
);
...
...
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