Fix deprecated warning on vibrate

This commit is contained in:
Brandon Presley 2024-02-10 16:45:19 +13:00
parent 00ae63c9ba
commit 60eec2c482
1 changed files with 1 additions and 5 deletions

View File

@ -131,11 +131,7 @@ class AlarmService : Service(), OnPreparedListener {
@Suppress("DEPRECATION")
getSystemService(VIBRATOR_SERVICE) as Vibrator
}
val audioAttributes = AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_ALARM)
.build()
vibrator!!.vibrate(VibrationEffect.createWaveform(pattern, 1), audioAttributes)
vibrator!!.vibrate(VibrationEffect.createWaveform(pattern, 1))
return START_STICKY
}