summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorzengjing <zengjing@xiaomi.com>2018-05-25 11:15:20 +0800
committerzengjing <zengjing@xiaomi.com>2018-05-25 11:15:20 +0800
commit452da339bd4737b55915f1c34ac1433330faec62 (patch)
treeafc1c940fb42f2e1c7b09ed3ee21e460d24c6aca /tools/aapt2/java/JavaClassGenerator_test.cpp
parentd01890df3ce3ee71b752fbeb15686d6c8740a10d (diff)
Do not setForceUse when a2dp config without change
When device connected with wired headset and without any bluetooth connection, APP may call MediaRouter to setForceUse to set FOR_MEDIA with FORCE_SPEAKER, then sound be output to SPEAKER. In this case, if setBluetoothA2dpOn(false) was called, FOR_MEDIA will be set with FORCE_NONE and sound be output to wird headset. The issue discussed above occurred on our device. We developed an FM radio APP. Beforce work, wired headset must be plugged in to be used as antennas. Then we setForceUse FOR_MEDIA to FORCE_SPEAKER, and audio stream was output to speaker. At this moment, if we play other sound (such as ScreenCapture sound), MediaRouterService will detected audio playbacked state changed. Because FM Audio was not monitor by AudioPlaybackMonitor, there was not any audio playback active. So, restoreBluetoothA2dp was called in the function of onAudioPlayerActiveStateChanged, which call AudioService.setBluetoothA2dpOn(false). As a result sound was switch to headset. There are two solutions to fix our issue. 1) Check a2dp state before setBluetoothA2dpOn in MediaRouterService::restoreBluetoothA2dp, if a2dp state does not change, setBluetoothA2dpOn should not be called 2) Check a2dp state before setForceUse in AudioService::setBluetoothA2dpOn, if a2dp state does not change, setForceUse should not be called Consdering that setBluetoothA2dpOn may be called by other method, we try to fix it with the second one. Test: NA Change-Id: I3a2e64e7d73d9aa9539176fea556feb433cb7211 Signed-off-by: zengjing <zengjing@xiaomi.com>
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions