Merge pull request #1985 from p5nbTgip0r/fix-alarm-loop
Fix pump unreachable alarm loop
This commit is contained in:
commit
1bb1467455
1 changed files with 2 additions and 2 deletions
|
@ -74,7 +74,7 @@ class AlarmSoundService : DaggerService() {
|
||||||
if (intent?.hasExtra(ErrorHelperActivity.SOUND_ID) == true) resourceId = intent.getIntExtra(ErrorHelperActivity.SOUND_ID, R.raw.error)
|
if (intent?.hasExtra(ErrorHelperActivity.SOUND_ID) == true) resourceId = intent.getIntExtra(ErrorHelperActivity.SOUND_ID, R.raw.error)
|
||||||
player = MediaPlayer()
|
player = MediaPlayer()
|
||||||
try {
|
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)
|
player?.setDataSource(afd.fileDescriptor, afd.startOffset, afd.length)
|
||||||
afd.close()
|
afd.close()
|
||||||
player?.isLooping = true
|
player?.isLooping = true
|
||||||
|
@ -94,7 +94,7 @@ class AlarmSoundService : DaggerService() {
|
||||||
aapsLogger.error("Unhandled exception", e)
|
aapsLogger.error("Unhandled exception", e)
|
||||||
}
|
}
|
||||||
aapsLogger.debug(LTag.CORE, "onStartCommand End")
|
aapsLogger.debug(LTag.CORE, "onStartCommand End")
|
||||||
return START_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|
Loading…
Reference in a new issue