Fix deprecated warning on vibrate
This commit is contained in:
parent
00ae63c9ba
commit
60eec2c482
|
@ -131,11 +131,7 @@ class AlarmService : Service(), OnPreparedListener {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
getSystemService(VIBRATOR_SERVICE) as Vibrator
|
getSystemService(VIBRATOR_SERVICE) as Vibrator
|
||||||
}
|
}
|
||||||
val audioAttributes = AudioAttributes.Builder()
|
vibrator!!.vibrate(VibrationEffect.createWaveform(pattern, 1))
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
|
||||||
.setUsage(AudioAttributes.USAGE_ALARM)
|
|
||||||
.build()
|
|
||||||
vibrator!!.vibrate(VibrationEffect.createWaveform(pattern, 1), audioAttributes)
|
|
||||||
return START_STICKY
|
return START_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user