mirror of
https://github.com/FossifyOrg/Clock.git
synced 2026-06-12 00:08:54 -04:00
Initialize the AudioManager in AlarmService
Gradual volume increase was not working because of this.
This commit is contained in:
@@ -59,6 +59,11 @@ class AlarmService : Service() {
|
||||
private val autoDismissHandler = Handler(Looper.getMainLooper())
|
||||
private val increaseVolumeHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
audioManager = getSystemService(AUDIO_SERVICE) as AudioManager
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
val alarmId = intent?.getIntExtra(ALARM_ID, -1) ?: -1
|
||||
alarm = if (alarmId != -1) {
|
||||
|
||||
Reference in New Issue
Block a user