fix(auto): clear stuck bluetooth EQ selection on device disconnect
The advanced EQ device list kept the green-dot selection on the last connected Bluetooth device after it disconnected, instead of falling back to the default preset. - MainActivity.kt: onAudioDevicesRemoved recomputed the active output device via AudioManager.getDevices(), which can still momentarily report the just-removed sink (observed on Bluetooth A2DP). Removed device ids are now excluded explicitly instead of trusting getDevices() to already be current. - estado_ecualizador.dart: cambiarMultiDeviceEnabled() re-seeds dispositivoActualId from a fresh query when the toggle turns back on, matching cargarPersistido(), so a stale id from before the toggle flip can't leave the dot pinned to a disconnected device.
This commit is contained in:
@@ -274,6 +274,14 @@ class EstadoEcualizador extends ChangeNotifier {
|
||||
_eqMultiDeviceEnabled = habilitado;
|
||||
await servicio.guardarToggleMultiDispositivo(habilitado);
|
||||
_configurarSuscripcionDispositivo();
|
||||
|
||||
// Re-seed the active device from a fresh query instead of leaving a
|
||||
// stale _dispositivoActualId from before the toggle flip (it would
|
||||
// otherwise only self-correct on the next native device-change event).
|
||||
if (_eqMultiDeviceEnabled) {
|
||||
await _sembrarDispositivoActual();
|
||||
}
|
||||
|
||||
if (notificar) notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user