From 303aacb2e37d767eed991ee42467aefb7f101299 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 4 Sep 2023 14:49:28 +0930 Subject: [PATCH] Fix post notifications permission request --- .../main/java/org/thoughtcrime/securesms/home/HomeActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt index ba519f0a79..f255455727 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt @@ -8,6 +8,7 @@ import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.content.IntentFilter +import android.os.Build import android.os.Bundle import android.text.SpannableString import android.widget.Toast @@ -300,7 +301,8 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), EventBus.getDefault().register(this@HomeActivity) if (intent.hasExtra(FROM_ONBOARDING) && intent.getBooleanExtra(FROM_ONBOARDING, false)) { - if ((getSystemService(NOTIFICATION_SERVICE) as NotificationManager).areNotificationsEnabled().not()) { + if (Build.VERSION.SDK_INT >= 33 && + (getSystemService(NOTIFICATION_SERVICE) as NotificationManager).areNotificationsEnabled().not()) { Permissions.with(this) .request(Manifest.permission.POST_NOTIFICATIONS) .execute()