diff options
| author | Albin <albin@mullvad.net> | 2022-01-21 15:41:46 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2022-01-24 13:44:45 +0100 |
| commit | 70ceb177b7c43a4d9cfbf95fe7dc5d3f5f7ce06e (patch) | |
| tree | b6e5a5fa56b90c32530f2a64e503efeba54ea372 /android/app | |
| parent | 12d08a1e79c05488e60e486ae2b4cd0466b7551b (diff) | |
| download | mullvadvpn-70ceb177b7c43a4d9cfbf95fe7dc5d3f5f7ce06e.tar.xz mullvadvpn-70ceb177b7c43a4d9cfbf95fe7dc5d3f5f7ce06e.zip | |
Specify default notification vibration behavior
Default vibration behavior:
* Vibration enabled for account expiration notification.
* Vibration disabled for tunnel state notification.
These defaults can be overridden in system settings.
Diffstat (limited to 'android/app')
3 files changed, 7 insertions, 3 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt index c2e227b725..7b835bccdc 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt @@ -40,7 +40,8 @@ class AccountExpiryNotification( NotificationCompat.VISIBILITY_PRIVATE, R.string.account_time_notification_channel_name, R.string.account_time_notification_channel_description, - NotificationManager.IMPORTANCE_HIGH + NotificationManager.IMPORTANCE_HIGH, + true ) var loginStatus by observable<LoginStatus?>(null) { _, oldValue, newValue -> diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt index e8b5ab7e8e..cceb5b4344 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt @@ -14,7 +14,8 @@ class NotificationChannel( val visibility: Int, name: Int, description: Int, - importance: Int + importance: Int, + isVibrationEnabled: Boolean ) { private val badgeColor by lazy { context.getColor(R.color.colorPrimary) @@ -30,6 +31,7 @@ class NotificationChannel( .setName(channelName) .setDescription(channelDescription) .setShowBadge(true) + .setVibrationEnabled(isVibrationEnabled) .build() notificationManager.createNotificationChannel(channel) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt index e6b3a5da55..a69b769d36 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/TunnelStateNotification.kt @@ -23,7 +23,8 @@ class TunnelStateNotification(val context: Context) { NotificationCompat.VISIBILITY_SECRET, R.string.foreground_notification_channel_name, R.string.foreground_notification_channel_description, - NotificationManager.IMPORTANCE_MIN + NotificationManager.IMPORTANCE_MIN, + false ) private val notificationText: Int |
