Fix:Android cancel sleep timer resets volume #605

This commit is contained in:
advplyr
2023-02-25 09:28:22 -06:00
parent 83027a5787
commit 960f75bfba
2 changed files with 5 additions and 1 deletions
@@ -137,6 +137,8 @@ class SleepTimerManager constructor(private val playerNotificationService: Playe
sleepTimerRunning = false sleepTimerRunning = false
isAutoSleepTimer = false isAutoSleepTimer = false
playerNotificationService.unregisterSensor() playerNotificationService.unregisterSensor()
setVolume(1f)
} }
fun getSleepTimerTime():Long { fun getSleepTimerTime():Long {
@@ -378,7 +378,9 @@ class AbsAudioPlayer : Plugin() {
@PluginMethod @PluginMethod
fun cancelSleepTimer(call: PluginCall) { fun cancelSleepTimer(call: PluginCall) {
playerNotificationService.sleepTimerManager.cancelSleepTimer() Handler(Looper.getMainLooper()).post {
playerNotificationService.sleepTimerManager.cancelSleepTimer()
}
call.resolve() call.resolve()
} }