OSDN Git Service

A2DP: Don't select disabled optional codecs when local SRC reconnecting
authorCheney Ni <cheneyni@google.com>
Tue, 14 Apr 2020 06:25:20 +0000 (14:25 +0800)
committerCheney Ni <cheneyni@google.com>
Tue, 5 May 2020 08:46:08 +0000 (16:46 +0800)
commit32379e3062f8c83388937674ba02ff4a04446b37
tree3c0909ecc8e0bb27082b7abf6dec4021347ec012
parent5c54cb7229f397a07416bc7c0a52493ed165bd01
A2DP: Don't select disabled optional codecs when local SRC reconnecting

When local SRC is establishing a connection, the Bluetooth stack follows
those default priorities to choose a codec, and A2dpService needs to
judge again after this connection up event. If a user prefers the
mandatory codec, the peer state is OPEN -> RECONFIG -> OPEN which
is redundant but lousy. Since codecs preference is saved at the
upper-layer, this change queries the mandatory codec, and raises
the priority for more preferred codec while reconnecting from local.

Bug: 134131114
Bug: 147572898
Test: Local A2DP initializes connections
Change-Id: I110ffa463dd4c9ec62e18e1843b5aebc84d73093
Merged-In: I110ffa463dd4c9ec62e18e1843b5aebc84d73093
(cherry picked from commit 2fda2f0e415b2da9e7d5201bf8089492db88e73a)
btif/co/bta_av_co.cc
btif/include/btif_av.h
btif/src/btif_av.cc
include/hardware/bt_av.h