fix: battery optimization prompt — add missing manifest permission and fix fallback

REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent is silently dropped without
the matching manifest permission. Added it to app.json permissions.
Also replaced .catch() chain (which only triggers on thrown errors) with
try/catch blocks so the fallback to IGNORE_BATTERY_OPTIMIZATION_SETTINGS
actually fires. Added resetBatteryOptPrompt() helper to re-trigger the
prompt during testing.
This commit is contained in:
Davide Scaini
2026-06-03 09:18:03 +02:00
parent 765efe288e
commit 4e1c2ebef9
2 changed files with 22 additions and 10 deletions
+2 -1
View File
@@ -32,7 +32,8 @@
"BLUETOOTH",
"BLUETOOTH_ADMIN",
"BLUETOOTH_SCAN",
"BLUETOOTH_CONNECT"
"BLUETOOTH_CONNECT",
"REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
]
},
"web": {