mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-18 12:40:52 +01:00
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>() {
|
||||
@Override
|
||||
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);
|
||||
|
||||
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
|
||||
@ -176,7 +177,11 @@ public class DownloadServiceLifecycleSupport
|
||||
downloadService.stop();
|
||||
break;
|
||||
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();
|
||||
}
|
||||
|
@ -257,6 +257,7 @@ public class MediaPlayerService extends Service
|
||||
{
|
||||
tabInstance.hideNowPlaying();
|
||||
stopForeground(true);
|
||||
player.getValue().clearRemoteControl();
|
||||
isInForeground = false;
|
||||
stopSelf();
|
||||
}
|
||||
@ -465,6 +466,7 @@ public class MediaPlayerService extends Service
|
||||
if (tabInstance != null)
|
||||
{
|
||||
stopForeground(true);
|
||||
player.getValue().clearRemoteControl();
|
||||
isInForeground = false;
|
||||
tabInstance.hideNowPlaying();
|
||||
stopSelf();
|
||||
|
@ -478,7 +478,7 @@ public class Player
|
||||
}
|
||||
}
|
||||
|
||||
private void clearRemoteControl()
|
||||
public void clearRemoteControl()
|
||||
{
|
||||
if (remoteControlClient != null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user