Add seek support to modern playback notification.

This commit is contained in:
casey langen 2022-07-23 14:30:15 -07:00
parent ca8e935724
commit 5e576d5860
2 changed files with 6 additions and 2 deletions

View File

@ -564,6 +564,10 @@ class SystemService : Service() {
return false
}
override fun onSeekTo(pos: Long) {
playback?.seekTo(pos.toDouble() / 1000.0)
}
override fun onPlay() {
playback?.let {
when (it.queueCount == 0) {
@ -711,7 +715,8 @@ class SystemService : Service() {
PlaybackStateCompat.ACTION_PLAY_PAUSE or
PlaybackStateCompat.ACTION_SKIP_TO_NEXT or
PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS or
PlaybackStateCompat.ACTION_STOP
PlaybackStateCompat.ACTION_STOP or
PlaybackStateCompat.ACTION_SEEK_TO
private var wakeLockAcquireTime = -1L
private var totalWakeLockTime = 0L

View File

@ -97,7 +97,6 @@ abstract class BaseActivity : AppCompatActivity(), ViewModel.Provider, Runner.Ta
mixins.onDestroy()
}
override fun onBackPressed() {
(top as? IBackHandler)?.let {
if (it.onBackPressed()) {