Restored minor fixes
This commit is contained in:
parent
0820763c7f
commit
c3be251e8b
|
@ -79,6 +79,7 @@ public class DownloadServiceLifecycleSupport
|
||||||
downloadQueueSerializer.getValue().deserializeDownloadQueue(new Consumer<State>() {
|
downloadQueueSerializer.getValue().deserializeDownloadQueue(new Consumer<State>() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(State state) {
|
public void accept(State state) {
|
||||||
|
// TODO: here the autoPlay = false creates problems when Ultrasonic is started by a Play MediaButton as the player won't start this way.
|
||||||
downloadService.restore(state.songs, state.currentPlayingIndex, state.currentPlayingPosition, false, false);
|
downloadService.restore(state.songs, state.currentPlayingIndex, state.currentPlayingPosition, false, false);
|
||||||
|
|
||||||
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
|
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
|
||||||
|
@ -176,7 +177,11 @@ public class DownloadServiceLifecycleSupport
|
||||||
downloadService.stop();
|
downloadService.stop();
|
||||||
break;
|
break;
|
||||||
case KeyEvent.KEYCODE_MEDIA_PLAY:
|
case KeyEvent.KEYCODE_MEDIA_PLAY:
|
||||||
if (downloadService.getPlayerState() != PlayerState.STARTED)
|
if (downloadService.getPlayerState() == PlayerState.IDLE)
|
||||||
|
{
|
||||||
|
downloadService.play();
|
||||||
|
}
|
||||||
|
else if (downloadService.getPlayerState() != PlayerState.STARTED)
|
||||||
{
|
{
|
||||||
downloadService.start();
|
downloadService.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,6 +257,7 @@ public class MediaPlayerService extends Service
|
||||||
{
|
{
|
||||||
tabInstance.hideNowPlaying();
|
tabInstance.hideNowPlaying();
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
player.getValue().clearRemoteControl();
|
||||||
isInForeground = false;
|
isInForeground = false;
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
|
@ -465,6 +466,7 @@ public class MediaPlayerService extends Service
|
||||||
if (tabInstance != null)
|
if (tabInstance != null)
|
||||||
{
|
{
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
player.getValue().clearRemoteControl();
|
||||||
isInForeground = false;
|
isInForeground = false;
|
||||||
tabInstance.hideNowPlaying();
|
tabInstance.hideNowPlaying();
|
||||||
stopSelf();
|
stopSelf();
|
||||||
|
|
|
@ -478,7 +478,7 @@ public class Player
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearRemoteControl()
|
public void clearRemoteControl()
|
||||||
{
|
{
|
||||||
if (remoteControlClient != null)
|
if (remoteControlClient != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue