Split_A2dp: Reduce the retry timer in below cases.

Reduce check_a2dp_ready() retry to 1sec.

- While MT Call Ringing A2dp got connected we would update MM with setparams
  with A2dpSuspended=true, but due to timing issue, it took some time
  to set A2dpSuspended=true in Audio HAL. Due to which it went to call
  check_a2dp_ready() from MM, which calls BT Host IPC call, where we are retrying
  till 4secs for BT Host Stack response and returns A2DP_CTRL_ACK_INCALL_FAILURE
  after 4sec. So MM Blocked for 4sec and Telephony UI taking time to come
  foreground, and also leading to some ANRs due to this ~4sec blocking.
  So to take care these type of situations we are reducing retry in
  BT Host IPC to 1sec to avoid ANRs and smooth response of UI as well.

- When MM does start we do Protocol START, then VSC START followed by procol START
  success. When VSC commands starts exchanging due to car kit not in Media UI,
  remote send suspend immediately in between VSCs of START exchaning which is
  colliding with Remote Suspend. Due to remote suspend our state machine moved
  to opened_handler, and there in handling of BTIF_AV_OFFLOAD_START_RSP_EVT we
  are updating MM ACK_UNSUPPORTED, but not cleared the remote suspend flag.
  After that when MM does the out-standby for low-latency playback, it will do
  check_a2dp_ready(), there it is blocking for 4sec due to remote suspend flag
  didn't cleared. So to avoid this reduce the timere to 1sec.

Reduce the audio_start_stream() retry to 3sec.

- When MM does start when car kit not in Media UI, remote send suspend immediately
  before even VSCs of START exchanging. In those cases we are returing ACK_FAILURE to
  MM from oepened_handler of BTIF_AV_OFFLOAD_START_REQ_EVT with out clearing remote
  suspend flag. In those cases audio_start_stream() API got blocked for 8sec, which
  is leading to ANRs. So to avoid these ANRs cleared the remote suspend flag, and
  send Error code as ACK_UNSUPPORTED to MM, so that it will not retry. If some how
  ACK_FAILURE returns from BT Stack(In this case although it got taken care in BT
  stack by sending ACK_UNSUPPORTED) then it would unblock MM after ~3sec

Change-Id: I5a0da75fc49e483aa215c7288c296b2372e79f59
1 file changed
tree: 1343dff3b20edb58ab2f62bcc97892322cc6b58c
  1. bthost_ipc/
  2. libbt-vendor/
  3. tools/
  4. Android.mk
  5. CleanSpec.mk