Skip to content
Snippets Groups Projects
Verified Commit 63d74287 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Correctly implement notification options

parent ab37d487
No related branches found
No related tags found
No related merge requests found
...@@ -168,13 +168,18 @@ class QuasseldroidNotificationManager @Inject constructor(private val context: C ...@@ -168,13 +168,18 @@ class QuasseldroidNotificationManager @Inject constructor(private val context: C
.setColor(context.getColorCompat(R.color.colorPrimary)) .setColor(context.getColorCompat(R.color.colorPrimary))
.setLights(context.getColorCompat(R.color.colorPrimary), 200, 200) .setLights(context.getColorCompat(R.color.colorPrimary), 200, 200)
.apply { .apply {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O && isLoud) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
var defaults = 0 var defaults = 0
if (!notificationSettings.sound.isEmpty()) { if (isLoud) {
setSound(Uri.parse(notificationSettings.sound)) if (!notificationSettings.sound.isEmpty()) {
setSound(Uri.parse(notificationSettings.sound))
}
if (notificationSettings.vibrate) {
defaults = defaults or NotificationCompat.DEFAULT_VIBRATE
}
} }
if (notificationSettings.vibrate) { if (notificationSettings.light) {
defaults = defaults or NotificationCompat.DEFAULT_VIBRATE defaults = defaults or NotificationCompat.DEFAULT_LIGHTS
} }
setDefaults(defaults) setDefaults(defaults)
} }
......
...@@ -98,13 +98,10 @@ ...@@ -98,13 +98,10 @@
<PreferenceScreen <PreferenceScreen
android:key="@string/preference_notification_configure_key" android:key="@string/preference_notification_configure_key"
android:title="@string/preference_notification_configure_title"> android:title="@string/preference_notification_configure_title">
<intent android:action="android.settings.CHANNEL_NOTIFICATION_SETTINGS"> <intent android:action="android.settings.APP_NOTIFICATION_SETTINGS">
<extra <extra
android:name="android.provider.extra.APP_PACKAGE" android:name="android.provider.extra.APP_PACKAGE"
android:value="@string/package_name" /> android:value="@string/package_name" />
<extra
android:name="android.provider.extra.CHANNEL_ID"
android:value="@string/notification_channel_highlight" />
</intent> </intent>
</PreferenceScreen> </PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment