Skip to content

Commit 887311b

Browse files
committed
Fix notification settings under api 26
1 parent 1c90aac commit 887311b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package eu.kanade.presentation.more.settings.screen
33
import android.annotation.SuppressLint
44
import android.content.ActivityNotFoundException
55
import android.content.Intent
6+
import android.os.Build
67
import android.provider.Settings
78
import android.webkit.WebStorage
89
import android.webkit.WebView
@@ -147,9 +148,18 @@ object SettingsAdvancedScreen : SearchableSettings {
147148
Preference.PreferenceItem.TextPreference(
148149
title = stringResource(MR.strings.pref_manage_notifications),
149150
onClick = {
150-
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
151-
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
151+
// SY -->
152+
val intent = Intent().apply {
153+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
154+
setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
155+
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
156+
} else {
157+
setAction("android.settings.APP_NOTIFICATION_SETTINGS")
158+
putExtra("app_package", context.packageName)
159+
putExtra("app_uid", context.applicationInfo.uid)
160+
}
152161
}
162+
// SY <--
153163
context.startActivity(intent)
154164
},
155165
),

0 commit comments

Comments
 (0)