Merge pull request #5812 from k9mail/fix_vibrate_on_notification
Only set vibration pattern if vibration is enabled
This commit is contained in:
commit
f042e2babd
3 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,8 @@ internal class BaseNotificationDataCreator {
|
|||
|
||||
private fun createNotificationAppearance(account: Account): NotificationAppearance {
|
||||
return with(account.notificationSetting) {
|
||||
NotificationAppearance(ringtone = ringtone, vibrationPattern = vibration, ledColor = ledColor)
|
||||
val vibrationPattern = if (isVibrateEnabled) vibration else null
|
||||
NotificationAppearance(ringtone, vibrationPattern, ledColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ class BaseNotificationDataCreatorTest {
|
|||
|
||||
@Test
|
||||
fun `vibration pattern`() {
|
||||
account.notificationSetting.isVibrateEnabled = true
|
||||
account.notificationSetting.vibratePattern = 3
|
||||
account.notificationSetting.vibrateTimes = 2
|
||||
val notificationData = createNotificationData()
|
||||
|
@ -192,7 +193,6 @@ class BaseNotificationDataCreatorTest {
|
|||
return Account("00000000-0000-4000-0000-000000000000").apply {
|
||||
description = "account name"
|
||||
identities = listOf(Identity())
|
||||
notificationSetting.vibrateTimes = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,7 +338,6 @@ class NewMailNotificationManagerTest {
|
|||
return Account(ACCOUNT_UUID).apply {
|
||||
description = ACCOUNT_NAME
|
||||
chipColor = ACCOUNT_COLOR
|
||||
notificationSetting.vibrateTimes = 1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue