Merge pull request #1985 from p5nbTgip0r/fix-alarm-loop

Fix pump unreachable alarm loop
This commit is contained in:
Milos Kozak 2022-08-03 14:14:17 +02:00 committed by GitHub
commit 1bb1467455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class AlarmSoundService : DaggerService() {
if (intent?.hasExtra(ErrorHelperActivity.SOUND_ID) == true) resourceId = intent.getIntExtra(ErrorHelperActivity.SOUND_ID, R.raw.error)
player = MediaPlayer()
try {
val afd = rh.openRawResourceFd(resourceId) ?: return START_STICKY
val afd = rh.openRawResourceFd(resourceId) ?: return START_NOT_STICKY
player?.setDataSource(afd.fileDescriptor, afd.startOffset, afd.length)
afd.close()
player?.isLooping = true
@ -94,7 +94,7 @@ class AlarmSoundService : DaggerService() {
aapsLogger.error("Unhandled exception", e)
}
aapsLogger.debug(LTag.CORE, "onStartCommand End")
return START_STICKY
return START_NOT_STICKY
}
override fun onDestroy() {