feat(alarmas): replace one-line reliability button with full diagnostics screen

Surface all six DiagnosticoAlarmasAndroid fields instead of three: the
battery-optimization exemption and native pending-alarm count were
already collected but silently dropped by the old widget. Each failing
signal now offers a "Fix this" action that opens the right system
settings screen (exact alarms, notifications, full-screen intent,
battery optimization), guarded by SDK level and never crashing when a
ROM lacks that screen. Manufacturers known for aggressive background
killing (Xiaomi/Redmi/POCO, Huawei, Oppo, Vivo, OnePlus, Samsung) get
an honest explanation that Autostart must be enabled manually, since
there is no API to detect or grant it.

Notifications now deep-links straight to
ACTION_APP_NOTIFICATION_SETTINGS via a new openNotificationSettings
native method, instead of reusing the runtime permission popup meant
for first-time alarm creation.

New copy is added to all 13 ARB locales with real per-language
translations (not Spanish copies), verified by the ARB parity and
anti-copy tests plus the corruption scanner.
This commit is contained in:
2026-07-31 19:10:52 +02:00
parent ef9705a30e
commit 049ab78acb
35 changed files with 2262 additions and 79 deletions
@@ -190,6 +190,15 @@ abstract class PuertoAlarmasAndroid {
Future<bool> solicitarPermisoPantallaCompleta();
Future<bool> solicitarExencionBateria();
/// Opens the system's per-app notification settings screen directly
/// (`ACTION_APP_NOTIFICATION_SETTINGS`), as opposed to
/// [solicitarPermisoNotificaciones]'s runtime permission popup. Used from
/// the reliability diagnostics screen: once a user is troubleshooting an
/// alarm that already failed, sending them straight to Settings is more
/// robust than a runtime dialog the OS may refuse to show again after a
/// prior denial.
Future<bool> abrirConfiguracionNotificaciones();
Future<DiagnosticoAlarmasAndroid> diagnostico();
Future<EventoAlarmaAndroid?> obtenerEventoInicial();
Future<List<EjecucionAlarmaNativa>> obtenerEjecucionesNativasGestionadas();
@@ -416,6 +425,14 @@ class ServicioAlarmasAndroid implements PuertoAlarmasAndroid {
return abierto ?? false;
}
@override
Future<bool> abrirConfiguracionNotificaciones() async {
final abierto = await _channel.invokeMethod<bool>(
'openNotificationSettings',
);
return abierto ?? false;
}
@override
Future<DiagnosticoAlarmasAndroid> diagnostico() async {
debugPrint('[PluriWave][alarmas] diagnostico android');