fix(eq): resync EstadoEcualizador with car/notification-initiated changes

A toggle from the Android Auto notification or a preset picked from the
car's EQ folder mutated PluriWaveAudioHandler state directly, leaving
EstadoEcualizador (and therefore the phone UI) unaware and never
persisting the change, so it was lost on the next app restart.

Forward the handler's ecualizadorActivo flag through ServicioAudio and,
mirroring EstadoRadio's existing playFromMediaId resync, diff it plus
presetActual against the cached values on every estadoStream tick,
adopting and persisting a divergence via ServicioEcualizador.
This commit is contained in:
2026-08-28 17:48:52 +02:00
parent 689f3e8123
commit e9f47d47c2
5 changed files with 245 additions and 7 deletions
+7
View File
@@ -582,6 +582,13 @@ class ServicioAudio {
bool get ecualizadorDisponible => _handler.ecualizadorDisponible;
PresetEcualizador get presetActual => _handler.presetActual;
/// Forwards the handler's own on/off flag (eq-sync-superficies): a
/// car/notification toggle (`accionEqToggle`) mutates
/// `PluriWaveAudioHandler._ecualizadorActivo` directly, bypassing
/// [setEcualizadorActivo] entirely. [EstadoEcualizador] polls this getter
/// on every [estadoStream] tick to detect and resync that divergence.
bool get ecualizadorActivo => _handler.ecualizadorActivo;
Future<void> aplicarPreset(PresetEcualizador preset) =>
_handler.aplicarPreset(preset);
Future<void> setEcualizadorActivo(bool activo) =>