refactor(alarm): make the ringing screen pure UI over a reduced native port
PantallaAlarmaSonando no longer owns any audio orchestration (fallback player, dB ramp, native handoff confirm, media-volume override/restore): it only calls EstadoAlarmas.finalizarEjecucion/posponerAlarma from Stop/Snooze/back, keeping the single-exit guard, PopScope back=Stop and dismiss semantics intact. The status line now reads directly from the alarm's static config (station name or a neutral label) instead of a live playback/handoff state. PuertoAlarmasAndroid drops confirmarAudioFlutter, forzarVolumenMediaParaAlarma and restaurarVolumenMedia, and app.dart no longer pre-starts a station before pushing the ring screen. This is the Dart half of moving to a single native ring-audio owner (WU1 of 2); the Kotlin service rebuild lands next and keeps this intermediate state shippable with no double audio.
This commit is contained in:
@@ -142,19 +142,6 @@ abstract class PuertoAlarmasAndroid {
|
||||
Future<bool> solicitarPermisoNotificaciones();
|
||||
Future<bool> solicitarPermisoPantallaCompleta();
|
||||
Future<bool> solicitarExencionBateria();
|
||||
Future<void> confirmarAudioFlutter(String alarmaId);
|
||||
|
||||
/// Forces `STREAM_MUSIC` to the fixed audible reference level for the
|
||||
/// duration of an alarm ring so the alarm cannot be silenced by a device
|
||||
/// media volume of 0 (Requirement: Ring-scoped device-volume override).
|
||||
/// [fraccion] is reserved for future tuning; the current native
|
||||
/// implementation always targets the device max regardless of its value.
|
||||
Future<void> forzarVolumenMediaParaAlarma(double fraccion);
|
||||
|
||||
/// Restores `STREAM_MUSIC` to the value captured by
|
||||
/// [forzarVolumenMediaParaAlarma]. Idempotent: safe to call even when no
|
||||
/// override is active or it was already restored.
|
||||
Future<void> restaurarVolumenMedia();
|
||||
|
||||
Future<DiagnosticoAlarmasAndroid> diagnostico();
|
||||
Future<EventoAlarmaAndroid?> obtenerEventoInicial();
|
||||
@@ -290,18 +277,6 @@ class ServicioAlarmasAndroid implements PuertoAlarmasAndroid {
|
||||
Future<void> detenerSonidoNativo(String alarmaId) =>
|
||||
_logAndInvokeVoid('stopNativeAlarmSound', {'id': alarmaId});
|
||||
|
||||
@override
|
||||
Future<void> confirmarAudioFlutter(String alarmaId) =>
|
||||
_logAndInvokeVoid('confirmFlutterAudio', {'id': alarmaId});
|
||||
|
||||
@override
|
||||
Future<void> forzarVolumenMediaParaAlarma(double fraccion) =>
|
||||
_logAndInvokeVoid('overrideMediaVolumeForRing', {'fraction': fraccion});
|
||||
|
||||
@override
|
||||
Future<void> restaurarVolumenMedia() =>
|
||||
_logAndInvokeVoid('restoreMediaVolume', {});
|
||||
|
||||
@override
|
||||
Future<bool> solicitarPermisoAlarmasExactas() async {
|
||||
final abierto = await _channel.invokeMethod<bool>(
|
||||
|
||||
Reference in New Issue
Block a user