From 9d3a51def2394dfd7a5c84c1371a50021e0aea02 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 1 Jun 2026 14:28:09 +0000 Subject: [PATCH] Check battery optimization status before showing general battery saver prompt. --- .../org/thoughtcrime/securesms/notifications/VitalsViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/VitalsViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/VitalsViewModel.kt index be6f1769a2..d6a343ebfd 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/VitalsViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/VitalsViewModel.kt @@ -68,7 +68,7 @@ class VitalsViewModel(private val context: Application) : AndroidViewModel(conte return@fromCallable State.PROMPT_SPECIFIC_BATTERY_SAVER_DIALOG } - if (havingDelayedNotifications && SlowNotificationHeuristics.shouldPromptBatterySaver()) { + if (havingDelayedNotifications && SlowNotificationHeuristics.shouldPromptBatterySaver() && SlowNotificationHeuristics.isBatteryOptimizationsOn()) { return@fromCallable State.PROMPT_GENERAL_BATTERY_SAVER_DIALOG }