Skip to content

Commit

Permalink
🐛 Set Next alarm when one ring
Browse files Browse the repository at this point in the history
  • Loading branch information
Théophile Delmas authored and Théophile Delmas committed Dec 30, 2023
1 parent 6f159b7 commit dcfa6f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/rooster/rooster/AlarmActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class AlarmActivity : FragmentActivity() {
})
refreshCycle()
alarmRing()
// Release the wake lock
//TODO Release wake lock
val alarmHandler = AlarmHandler()
alarmHandler.setNextAlarm(applicationContext)
}

private fun refreshCycle() {
Expand Down Expand Up @@ -183,15 +185,13 @@ class AlarmActivity : FragmentActivity() {
wakeLock.acquire()

if (!alarmIsRunning) {
alarmIsRunning = true
//alarmIsRunning = true
}
}

override fun onPause() {
val mediaPlayer = MediaPlayer()
val vibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator


super.onPause()
alarmIsRunning = false
mediaPlayer.stop()
Expand Down

0 comments on commit dcfa6f3

Please sign in to comment.