mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-08 16:30:34 +00:00
PlayerHolder: add some more docstrings
This commit is contained in:
parent
83d93e16e7
commit
6a4aaba431
@ -23,6 +23,8 @@ import org.schabi.newpipe.player.event.PlayerServiceEventListener;
|
||||
import org.schabi.newpipe.player.event.PlayerServiceExtendedEventListener;
|
||||
import org.schabi.newpipe.player.playqueue.PlayQueue;
|
||||
|
||||
/** Singleton that manages a `PlayerService`
|
||||
* and can be used to control the player instance through the service. */
|
||||
public final class PlayerHolder {
|
||||
|
||||
private PlayerHolder() {
|
||||
@ -162,7 +164,11 @@ public final class PlayerHolder {
|
||||
context.stopService(new Intent(context, PlayerService.class));
|
||||
}
|
||||
|
||||
|
||||
/** Call {@link Context#unbindService(ServiceConnection)} on our service
|
||||
* (does not necesarily stop the service right away).
|
||||
* Remove all our listeners and deinitialize them.
|
||||
* @param context shared context
|
||||
* */
|
||||
private void unbind(final Context context) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "unbind() called");
|
||||
@ -215,6 +221,10 @@ public final class PlayerHolder {
|
||||
}
|
||||
}
|
||||
|
||||
/** Delegate all {@link PlayerServiceEventListener} events to our current `listener` object.
|
||||
* Only difference is that if {@link PlayerServiceEventListener#onServiceStopped()} is called,
|
||||
* it also calls {@link PlayerHolder#unbind(Context)}.
|
||||
* */
|
||||
private final PlayerServiceEventListener internalListener =
|
||||
new PlayerServiceEventListener() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user