Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3713e8af authored by Etienne Ruffieux's avatar Etienne Ruffieux
Browse files

Implement AVRCP's set addressed player

This implements SetAddressedPlayer properly now that we
have an utility for it (since the browsing refactor).

Android's MediaSessions doesn't allow to set an active
session from its controller, hence we can't set the
session as active with SetAddressedPlayer and we need to
keep the "active", "browsed" and add an "addressed" session
id.
The "active" session corresponds to the session registered
to Android media key events - the session Android Media
considers as active.
The "browsed" session is the one the remote is currently
browsing. Can be any players and isn't linked to the
"active" session.

The "addressed" session is the session the remote whishes
to control. Once a play event is received form the CT, we
check if there is an "addressed" session and proceed to
send the play event to it instead of just sending it to the
active session. This will in turn modify the "active"
session to become the addressed one.
If the active session is changed directly on TG, then the
"addressed" session will change to it and TG will notify CT

As of now, controls other than PLAY will still be sent to
the "active" session. For two reasons:
- We don't have a way to make the "addressed" session
active in Android Media, so the previous session will
continue to play and we want to be able to control it.
This fits the section 29.15 from AVRCP 1.6.2 spec.
- Sending MEDIA_NEXT to a non active session wouldn't do
anything.

Bug: 346717077
Flag: com.android.bluetooth.flags.set_addressed_player
Test: atest pts-bot:AVRCP
Change-Id: I6dae8ead88195abd7a73230793e1df8d02501d6f
parent 551dc422
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment