From 6d6e24957504b9b3e2da73a18d50c7cebafc482a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 3 Apr 2022 18:15:32 +0200 Subject: [PATCH] fixing some mediasession initialization at third party intents --- app/build.gradle | 2 +- .../simplemobiletools/musicplayer/services/MusicService.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 4967fe05..ea7566a7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -68,7 +68,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:8301d8356c' + implementation 'com.github.SimpleMobileTools:Simple-Commons:7ad1d7c4db' implementation 'org.greenrobot:eventbus:3.2.0' implementation 'androidx.media:media:1.4.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt index 69b01a10..925d87a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/services/MusicService.kt @@ -721,6 +721,10 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr if (mPlayOnPrepare) { mp.start() requestAudioFocus() + + if (mIsThirdPartyIntent) { + trackChanged() + } } else if (mSetProgressOnPrepare > 0) { mPlayer?.seekTo(mSetProgressOnPrepare) broadcastTrackProgress(mSetProgressOnPrepare / 1000)