OSDN Git Service

Handle all kinds of focuses and make fault tolerant to phone calls.
authorSanket Agarwal <sanketa@google.com>
Thu, 7 Apr 2016 20:48:40 +0000 (13:48 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 15 Apr 2016 23:13:11 +0000 (23:13 +0000)
commitbacd3374a5b2c2193e45aac0eafb8cc39762d9f5
treedd4bf8a56715eb74f99707d03472109a5631a565
parent003f0b624af9474d43e594463d58bc795c98013e
Handle all kinds of focuses and make fault tolerant to phone calls.

Audio Focus Loss Transient: We stop music and wait for focus gain.
Audio Focus Loss Transient May Duck: We lower the volume (via Gain).

Sometimes phones do not resume even after sending play after the phone
call. This is possible if there is a race condition of when A2dp thinks
it got focus back vs phone actually releasing the call. To avoid this we
add retry logic to try playing again. This also avoids janky situations
when playing music will not initiate at first.

Bug: b/28003743
Bug: b/28065071

Change-Id: I1d31156d134d98959ff3044c98206c60515d7e5a
jni/com_android_bluetooth_a2dp_sink.cpp
res/values/config.xml
src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachine.java
src/com/android/bluetooth/a2dpsink/A2dpSinkStreamingStateMachine.java
src/com/android/bluetooth/hfpclient/connserv/HfpClientConnection.java