transport: fix AVRCP volume in reconfigured transports

We no longer reconnect AVRCP session on AVDTP transport reconfiguration.
This breaks AVRCP volume after reconfiguration, since there's no volume
update event incoming.

Fix by keeping track of the latest volume in btd_device volume.  It was
introduced to track volume changes that arrive when there are no
transports/players, but we should track all volume changes otherwise the
value can be out of date when we want to use it.

Fixes: 469a75ae18 ("sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle")
This commit is contained in:
Pauli Virtanen 2024-11-09 20:40:29 +02:00 committed by Luiz Augusto von Dentz
parent de1b3a5ac3
commit 774ad9fdd9

View File

@ -2598,10 +2598,9 @@ void media_transport_update_device_volume(struct btd_device *dev,
/* Volume is A2DP only */
if (media_endpoint_get_sep(transport->endpoint)) {
media_transport_update_volume(transport, volume);
return;
break;
}
}
/* If transport volume doesn't exists add to device_volume */
btd_device_set_volume(dev, volume);
}