From d55df65131359cb34e14966be5c94714d0b63949 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 27 Nov 2024 17:02:33 -0500 Subject: [PATCH] Allow adding another prompt after notifications (cherry picked from commit 75a34db9e5561fe4877f00520e8764022acc315b) --- .../eu/siacs/conversations/ui/ConversationsActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index 72d556da7..5a44dab41 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -756,7 +756,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio if (offerToSetupDiallerIntegration()) return; if (offerToDownloadStickers()) return; if (openBatteryOptimizationDialogIfNeeded()) return; - requestNotificationPermissionIfNeeded(); + if (requestNotificationPermissionIfNeeded()) return; xmppConnectionService.rescanStickers(); } } @@ -794,10 +794,12 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio return false; } - private void requestNotificationPermissionIfNeeded() { + private boolean requestNotificationPermissionIfNeeded() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && ActivityCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[]{Manifest.permission.POST_NOTIFICATIONS}, REQUEST_POST_NOTIFICATION); + return true; } + return false; } private boolean offerToDownloadStickers() {