feat(eq): android auto custom equalizer and robust device detection
- MainActivity: onListen re-emits the current active device and registers the audio device callback idempotently, so recreated activities resync instead of freezing the active-device id on a disconnected device. - servicio_dispositivo_audio: resubscribir() re-opens the event channel; estado_ecualizador exposes refrescarDispositivoActual() with an in-flight guard, invoked on app resume and when opening advanced EQ options, clearing stale green-dot device selections. - navegacion_auto/servicio_audio: new 'Personalizado' browse tree in Android Auto (5 band folders, 13 gain steps each) applied live via setBanda; preset and gain taps persist at device level when multi-device EQ is active and respect station/matrix overrides, with apply-before-persist ordering and children-changed notifications. - l10n: regenerate stale generated localizations; add rxdart as direct dependency for the subscribeToChildren override.
This commit is contained in:
+19
-1
@@ -96,7 +96,8 @@ class _PaginaPrincipal extends StatefulWidget {
|
||||
State<_PaginaPrincipal> createState() => _PaginaPrincipalState();
|
||||
}
|
||||
|
||||
class _PaginaPrincipalState extends State<_PaginaPrincipal> {
|
||||
class _PaginaPrincipalState extends State<_PaginaPrincipal>
|
||||
with WidgetsBindingObserver {
|
||||
int _indice = 0;
|
||||
StreamSubscription<String>? _errorSubscription;
|
||||
StreamSubscription<EventoAlarmaAndroid>? _alarmaSubscription;
|
||||
@@ -124,6 +125,22 @@ class _PaginaPrincipalState extends State<_PaginaPrincipal> {
|
||||
PluriNavItem(glyph: PluriIconGlyph.settings, label: l10n.navSettings),
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
if (state != AppLifecycleState.resumed) return;
|
||||
// Fix "stale green dot": on return to foreground the Activity may have
|
||||
// been recreated over the cached engine, leaving the device event channel
|
||||
// without a live native sink. Re-subscribe and re-seed the active device
|
||||
// (no-op when multi-device EQ is off).
|
||||
unawaited(context.read<EstadoEcualizador>().refrescarDispositivoActual());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
@@ -179,6 +196,7 @@ class _PaginaPrincipalState extends State<_PaginaPrincipal> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_errorSubscription?.cancel();
|
||||
_alarmaSubscription?.cancel();
|
||||
_alarmaVencidaSubscription?.cancel();
|
||||
|
||||
Reference in New Issue
Block a user