OSDN Git Service

Correct A2DP status when audio routes changed
authorSungsoo Lim <sungsoo@google.com>
Tue, 21 Nov 2017 04:12:24 +0000 (13:12 +0900)
committerSungsoo Lim <sungsoo@google.com>
Thu, 23 Nov 2017 02:28:46 +0000 (11:28 +0900)
commit90f4c8959e6bff9825c033966d461ed0d0e3b6cb
tree8cb66acfe6d34f42fcabd163ee967bda4002b0fd
parent2ffa7f0d126b7d072889cc8b8fed5233c9061e9f
Correct A2DP status when audio routes changed

When a Bluetooth device is connected and then a media is started,
sometimes MediaRouterService gets media playback status change first
and get the Bluetooth device status change later. This causes the
media plays through the phone speaker instead of BT devices.

This CL prevent that situation by not changing A2DP status when
BT device is not connected, and by calling restoreBluetoothA2dp
at the end of dispatchAudioRoutesChanged.

Bug: 69499034
Test: manually tested the bug, passed Media CTS
Change-Id: I7547a39e5ce58f58c249a25efa55446a3b023416
services/core/java/com/android/server/media/AudioPlayerStateMonitor.java
services/core/java/com/android/server/media/MediaRouterService.java