mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 04:59:34 +01:00
parent
9386dd881c
commit
86b6ec2dde
@ -286,7 +286,7 @@ class NotificationWorker(
|
|||||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||||
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
||||||
|
|
||||||
val vibrationEffect = NotificationUtils.getVibrationEffect(appPreferences)
|
val vibrationEffect = NotificationUtils.getVibrationEffect(appPreferences, false)
|
||||||
|
|
||||||
val notificationChannelId = NotificationUtils.getNotificationChannelId(applicationContext, applicationContext.resources
|
val notificationChannelId = NotificationUtils.getNotificationChannelId(applicationContext, applicationContext.resources
|
||||||
.getString(R.string.nc_notification_channel_messages), applicationContext.resources
|
.getString(R.string.nc_notification_channel_messages), applicationContext.resources
|
||||||
|
@ -93,10 +93,14 @@ object NotificationUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getVibrationEffect(appPreferences: AppPreferences): LongArray? {
|
fun getVibrationEffect(appPreferences: AppPreferences, forCalls: Boolean = true): LongArray? {
|
||||||
val vibrator = getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
val vibrator = getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
||||||
return if (appPreferences.shouldVibrateSetting && vibrator.hasVibrator()) {
|
return if (appPreferences.shouldVibrateSetting && vibrator.hasVibrator()) {
|
||||||
longArrayOf(0L, 400L, 800L, 600L, 800L, 800L, 800L, 1000L)
|
if (forCalls) {
|
||||||
|
longArrayOf(0L, 400L, 800L, 600L, 800L, 800L, 800L, 1000L)
|
||||||
|
} else {
|
||||||
|
longArrayOf(0L, 100L, 1000L)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user