Apply the new A2DP codec config only when passed the check with codec status

In order to apply a new codec config, the Bluetooth framework needs to
re-configure A2DP with remote, to restart the session with the Audio
HAL, and to notify the audio server to reset the output. This is a
heavy task over HALs and frameworks, so we use the current codec status
to ignore redundant codec preferences.

* To change the preference of optional codecs only when there are all
  mandatory and optional codecs selectable.
* To apply the new codec preference only when those feeding parameters
  or codec specifics are changing.
* Using the current feeding parameters as default settings, and no
  codec changed is needed.

Bug: 131147224
Bug: 133719424
Test: atest -t BluetoothInstrumentationTests:com.android.bluetooth.a2dp
Change-Id: I028b9f168d2e629dd02c8474592e3713445a5000
Merged-In: I028b9f168d2e629dd02c8474592e3713445a5000
(cherry picked from commit 1e2b5beb5c3c7fad890ad03dc96ef9415bebba83)
3 files changed