There are few cases when framework doesn't call connect_audio method
from HAL but we should do it internally. Call connect_audio if
we started dialing or we accepted incoming call. Also if headset
connects during active call, start SCO connection. We don't have to
disconnect SCO internally, because Android always call disconect_audio
when call has finished.
This adds code needed for translating phone_state_change command to
call, callsetup and callheld indicators. Android HAL specifcy common
type for all calls state but only subset of values are valid for
phone_state_change.
This fix following Valgrind report:
Syscall param sendmsg(msg.msg_iov[1]) points to uninitialised byte(s)
at 0x534823D: ??? (syscall-template.S:81)
by 0x5F68689: hal_ipc_cmd (hal-ipc.c:357)
by 0x5F6240B: init (hal-bluetooth.c:437)
by 0x4128C0: setup_base (android-tester.c:2594)
by 0x40DDE5: setup_callback (tester.c:380)
by 0x50803B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
by 0x5080707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
by 0x5080B09: g_main_loop_run (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
by 0x40EA0C: tester_run (tester.c:798)
by 0x404475: main (android-tester.c:4864)
Address 0x7ff0002b1 is on thread 1's stack
This patch fix segfault driven by lack of 4 element in avrg array.
If user put only two arguments, reading of lacking (auto set to start=1)
third argument, will trigger segfault.
It will service codec nogotiation and establish SCO connection with
negotiated parameters. If SCO establishment failed, try to connect
with mandatory codec CVSD.
It will handle AT+BAC command and update list of available codecs.
It will check if mandatory codec CVSD is present on list and, if
Wide Band Speech supported, MSBC codec is on next place. Other codecs
can be also used after extending codecs_defaults array.
It will also handle incorrect SLC establishment, when HF supports
Codec Negotiation, but didn't send AT+BAC.
We need to make sure /dev/uinput accessible for BlueZ in order for
AVRCP to work properly. On some devices (e.g. Nexus 7 a.k.a. flo)
permissions are set by default to 'system net_bt_stack' as thus we
need to change group to 'bluetooth'.
This patch improves handling stop disvocery in scenarios when there is a big
inflow of device found events. In such case, number of confirm
name request might block mgmt queses and make stop discovery stack in the queue.
Even we cancel previous confirm name request, there is still possibility that
new incoming device found events produce confirm name request which will
might block stop discovery.
If user wants to cancel discovery we should remove all the confirm name
requests from mgmt queues.
It is in order to make sure that stop discovery have a free way to
reach kernel.
This improves scenario when there is a big inflow of device found events and
mgmt queues become full of confirm name requests. In such case stop discovery
might stack in the queue.