Floss: Support multiple volume callbacks
Currently we assume there is only one volume callback and we always replace the callback if a new audio device is connected. When two audio devices are connected simultaneously, the later device is disconnected because we can only stream audio to one device. However, the volume callback is tied to that device, so now if the user changes the volume, we can't call the correct callback. This CL stores callback to all connected devices, so we can get the correct callback when user updates the system volume. Also, to simplify things, whenever floss layer receives an AVRCP connection when there is an existing connection, we ask libbluetooth to drop the newer connection. This behavior can be updated later, e.g. when the old connection is disconnected we can smartly switch to the new connection. Bug: 366387141 Test: m -j Test: Pair two headsets that connects AVRCP when they reconnects. Connect each headset one by one. Verify the 2nd device is disconnected, and the 1st device still receive volume updates. Flag: EXEMPT, floss only change Change-Id: I2e0f707fd11a3a6dbf827d839f95ec57f47e98d9
Loading
Please register or sign in to comment