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)
committerSanket Agarwal <sanketa@google.com>
Sun, 30 Oct 2016 21:06:02 +0000 (14:06 -0700)
commit80b6c335540ddc0fc3b22782a5f9f3a352587d3c
treec146139cfe49fca762ddb95c859d0635d57f7238
parent2b42a4906be952d3761d8b47134fba5a277a7765
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
(cherry picked from commit f8b181e9f395010dee2926a4b7b1dbe4f3db0470)
jni/com_android_bluetooth_a2dp_sink.cpp