Do not return true in handleKeycode if nothing was done

This commit is contained in:
ByteHamster 2020-02-08 00:12:33 +01:00
parent f790b78b1a
commit aa48cdb14c
1 changed files with 7 additions and 4 deletions

View File

@ -573,6 +573,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
mediaPlayer.prepare();
} else if (mediaPlayer.getPlayable() == null) {
startPlayingFromPreferences();
} else {
return false;
}
taskManager.restartSleepTimer();
return true;
@ -584,18 +586,19 @@ public class PlaybackService extends MediaBrowserServiceCompat {
mediaPlayer.prepare();
} else if (mediaPlayer.getPlayable() == null) {
startPlayingFromPreferences();
} else {
return false;
}
taskManager.restartSleepTimer();
return true;
case KeyEvent.KEYCODE_MEDIA_PAUSE:
if (status == PlayerStatus.PLAYING) {
mediaPlayer.pause(!UserPreferences.isPersistNotify(), false);
return true;
}
return true;
return false;
case KeyEvent.KEYCODE_MEDIA_NEXT:
if (notificationButton ||
UserPreferences.shouldHardwareButtonSkip()) {
if (notificationButton || UserPreferences.shouldHardwareButtonSkip()) {
// assume the skip command comes from a notification or the lockscreen
// a >| skip button should actually skip
mediaPlayer.skip();