Do not return true in handleKeycode if nothing was done
This commit is contained in:
parent
f790b78b1a
commit
aa48cdb14c
@ -573,6 +573,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||||||
mediaPlayer.prepare();
|
mediaPlayer.prepare();
|
||||||
} else if (mediaPlayer.getPlayable() == null) {
|
} else if (mediaPlayer.getPlayable() == null) {
|
||||||
startPlayingFromPreferences();
|
startPlayingFromPreferences();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
taskManager.restartSleepTimer();
|
taskManager.restartSleepTimer();
|
||||||
return true;
|
return true;
|
||||||
@ -584,18 +586,19 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||||||
mediaPlayer.prepare();
|
mediaPlayer.prepare();
|
||||||
} else if (mediaPlayer.getPlayable() == null) {
|
} else if (mediaPlayer.getPlayable() == null) {
|
||||||
startPlayingFromPreferences();
|
startPlayingFromPreferences();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
taskManager.restartSleepTimer();
|
taskManager.restartSleepTimer();
|
||||||
return true;
|
return true;
|
||||||
case KeyEvent.KEYCODE_MEDIA_PAUSE:
|
case KeyEvent.KEYCODE_MEDIA_PAUSE:
|
||||||
if (status == PlayerStatus.PLAYING) {
|
if (status == PlayerStatus.PLAYING) {
|
||||||
mediaPlayer.pause(!UserPreferences.isPersistNotify(), false);
|
mediaPlayer.pause(!UserPreferences.isPersistNotify(), false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
return true;
|
|
||||||
case KeyEvent.KEYCODE_MEDIA_NEXT:
|
case KeyEvent.KEYCODE_MEDIA_NEXT:
|
||||||
if (notificationButton ||
|
if (notificationButton || UserPreferences.shouldHardwareButtonSkip()) {
|
||||||
UserPreferences.shouldHardwareButtonSkip()) {
|
|
||||||
// assume the skip command comes from a notification or the lockscreen
|
// assume the skip command comes from a notification or the lockscreen
|
||||||
// a >| skip button should actually skip
|
// a >| skip button should actually skip
|
||||||
mediaPlayer.skip();
|
mediaPlayer.skip();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user