Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e815d318 authored by cketti's avatar cketti
Browse files

Don't set notification sound/vibration/light on Android 8+

On Android 8+ these values should be ignored anyway. But on some devices setting a notification sound could lead to a SecurityException (when the app doesn't have permission to access the notification sound URI).
parent c415635a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ package com.fsck.k9.notification

import android.content.Context
import android.net.Uri
import android.os.Build
import android.text.TextUtils
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
@@ -90,7 +91,7 @@ internal fun NotificationCompat.Builder.setAppearance(
): NotificationCompat.Builder = apply {
    if (silent) {
        setSilent(true)
    } else {
    } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
        if (!appearance.ringtone.isNullOrEmpty()) {
            setSound(Uri.parse(appearance.ringtone))
        }