Commit Graph

97 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
697110ce07 android: Fix using plain integer as NULL pointer 2014-07-03 11:41:05 +03:00
Luiz Augusto von Dentz
ab63fc7add android/handsfree: Fix Connect SCO command
This command should not trigger SCO connection since there is already a
command Connect Audio dedicated to do that.
2014-05-14 12:51:02 +03:00
Andrei Emeltchenko
25cc813c72 android/handsfree: Add SCO Audio IPC
If SCO Audio IPC gets connected it provides only one command:
connect_sco().
2014-05-13 14:16:51 +03:00
Luiz Augusto von Dentz
e44a5bf719 android/handsfree: Fix always setting BT_VOICE
If codec negotication is not supported just skip setting BT_VOICE.
2014-05-09 13:42:32 +03:00
Szymon Janc
7a2d604673 android: Make multi-line comments style consistent
Use common style for multi-line comments consistent with rest of
codebase.
2014-04-29 13:31:00 +02:00
Andrei Emeltchenko
9324dab74e android/handsfree: trivial: Correct comment style 2014-04-17 15:25:57 +02:00
Johan Hedberg
adaf6d26ce android: Fix coding style in IPC handler tables 2014-04-01 11:31:39 +03:00
Andrei Emeltchenko
1f949a0982 android/handsfree: Check service class is not zero
Fixes static analyzers NULL dereference warnings. The similar check is
done in src/device.c in line 2959.
2014-03-27 21:43:27 +01:00
Szymon Janc
b03a345ef3 android/handsfree: Fix not sending callheld update
This fix not sending callheld indicator update in three way calling
scenario with call placed from HF. This was affecting
TC_AG_TWC_BV_05_I qualification test case.
2014-03-25 20:49:38 +01:00
Szymon Janc
8160c3fb27 android/handsfree: Update indicators if calls changed with waiting call
If ongoing calls were changed while there is waiting call, callheld and
call indicators should be updated to match new calls state. This was
affecting TC_AG_TCA_BV_05_I qualification test case.
2014-03-25 20:49:38 +01:00
Szymon Janc
bbc32b300a android/handsfree: Track if incoming call is being rejected
If incoming call is being rejected following phone_state_change are
being send to handsfree HAL (probably due to some intermediate state
when incoming call is being rejected):
active=0 hold=0 state=idle
active=0 hold=0 state=incoming
active=0 hold=0 state=idle
active=0 hold=0 state=idle

To avoid sending bogus RING and callsetup=1 indicators this needs to be
tracked. This was afecting TC_AG_ICR_BV_01_I,TC_AG_ICR_BV_02_I and
TC_AG_TWC_BV_02_I qualification test cases.
2014-03-25 20:49:38 +01:00
Szymon Janc
a4fe38cd6a android/handsfree: Send NO CARRIER if call was end due to carrier loss
This was affecting TC_AG_TCA_BV_06_I qualification test case.
2014-03-25 18:35:59 +01:00
Marcin Kraglak
9633d2ec10 android/handsfree: Start codec selection if HF send AT+BAC while codec connection
If AG receives AT+BAC in response to +BCS, refresh list of codecs
and start new codec connection. It is required in TC_AG_ACC_BV_11_I
PTS test case.
2014-03-21 16:10:33 +01:00
Szymon Janc
45eb43e85e android: Fix some random code style issues
Fix whitespace problems and not needed empty lines.
2014-03-20 15:36:52 +01:00
Szymon Janc
1f03e56889 android/handsfree: Fix not sending callheld=2 when single call was held 2014-03-20 13:35:24 +01:00
Szymon Janc
00138d547e android/handsfree: Improve audio connection handling
This add disconnecting SCO if last call was dropped (required by
Java 'virtual voice call'). Also make sure that SCO is connected
only there were no calls present before phone state change. This
makes sure SCO won't be re-connected in three way calling scenarios
when user choose to not use audio on BT headset.
2014-03-20 13:35:24 +01:00
Szymon Janc
b6b29c9aae android/handsfree: Add support for WBS mode
This patch adds support for WBS mode in handsfree HAl as well as
redefining current modes.

"persist.sys.bluetooth.handsfree" property can be used to tune
handsfree HAL. Setting it to "hfp" or "hfp_wbs" values enables HFP
profile with narrowband only or with both narrowband and wideband
speech support. Any other value or lack of property defaults to
HSP only mode.
2014-03-19 12:55:18 +01:00
Szymon Janc
b77c5ffd3d android/handsfree: Fix connecting audio when call is active on connect 2014-03-17 10:25:29 +01:00
Szymon Janc
eeacd40d7a android/handsfree: Fix not initializing call state to idle 2014-03-16 23:51:31 +01:00
Marcin Kraglak
84066fccbc android/handsfree: Connect audio when Android framemework expects it
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.
2014-03-15 23:07:32 +01:00
Szymon Janc
5d5444d657 android/handsfree: Add support for three-way calling
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.
2014-03-15 22:21:28 +01:00
Szymon Janc
5ab9740fbc android/handsfree: Fix not needed codec negotiation
If codec was already negotiated there is no need to do it again and AG
may try connecting SCO right away. This fix regression from f264a65170.
2014-03-14 13:44:29 +01:00
Szymon Janc
3697788937 android/handsfree: Cleanup info and error messages 2014-03-13 23:30:36 +01:00
Szymon Janc
f264a65170 android/handsfree: Simplify condition in connect_audio 2014-03-13 23:30:36 +01:00
Szymon Janc
f05d46c09a android/handsfree: Fix some style issues 2014-03-13 23:30:36 +01:00
Szymon Janc
6bdba6be43 android/handsfree: Split members in device for better readability 2014-03-13 23:30:36 +01:00
Marcin Kraglak
ffdf8c26fe android/handsfree: Add handling of AT+BCS and AT+BCC
It will service codec nogotiation and establish SCO connection with
negotiated parameters. If SCO establishment failed, try to connect
with mandatory codec CVSD.
2014-03-13 23:30:36 +01:00
Marcin Kraglak
86db3fc9d1 android/handsfree: Move connect_sco() to more appropriate place
Move connect_sco as it will be used in at_cmd_bcc()
2014-03-13 23:30:36 +01:00
Marcin Kraglak
7d8466bec3 android/handsfree: Add initial implementation of Codec Negotiation feature
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.
2014-03-13 23:30:36 +01:00
Szymon Janc
de8c19867b android/handsfree: Fix code comment
Tt is RING, not +RING.
2014-03-13 18:05:02 +01:00
Szymon Janc
d5419070cf android/handsfree: Fix sending +CLCC
Phone number can be present for all call states in CLCC response.
Also phone number should be quoted string.
2014-03-11 16:27:50 +01:00
Szymon Janc
e76cdcc8ee android/handsfree: Verify if phone number is send as string over IPC 2014-03-11 16:27:50 +01:00
Szymon Janc
bbe400718b android/handsfree: Add support for AT+CCWA command 2014-03-11 16:27:50 +01:00
Szymon Janc
e0c486aa48 android/handsfree: Fix sending number without terminating NULL over IPC 2014-03-11 15:53:31 +01:00
Szymon Janc
d7cd9ba425 android/handsfree: Fix unsolicited RING alert 2014-03-11 14:15:45 +01:00
Marcin Kraglak
830ed33fcc android/handsfree: Fix HF features bitmasks
Add missing Remote volume control feature.
2014-03-11 12:21:38 +01:00
Szymon Janc
d84571d97c android/handsfree: Fix not removing RING timer on disconnect 2014-03-10 17:39:34 +01:00
Szymon Janc
aaa7b60ab3 android/handsfree: Fix response for AT+CHLD=? 2014-03-10 16:13:27 +01:00
Szymon Janc
55ec25435d android/handsfree: Fix +BRSF and +CHLD responses 2014-03-10 15:41:58 +01:00
Szymon Janc
b9e029679a android/handsfree: Add comment for AT+VGS/AT+VGM result code 2014-03-10 12:32:14 +01:00
Szymon Janc
4cf9358011 android/handsfree: Add support for AT+CLIP command 2014-03-10 12:32:14 +01:00
Szymon Janc
dc740e5422 android/handsfree: Add support for phone state change command
Unfortunately HAL is not getting call, callsetup and callheld
indicators values directly from Android Framework and those need to be
chosen based on number of active/hold calls and call state that
triggered phone state change.

This patch adds only basic call state handling (no three way call).
2014-03-10 12:32:14 +01:00
Szymon Janc
90e195b088 android/handsfree: Add support for AT+CHUP command 2014-03-10 12:32:14 +01:00
Szymon Janc
2d3c2135c9 android/handsfree: Add support for AT+BLDN command 2014-03-10 12:32:14 +01:00
Szymon Janc
d938a82aaa android/handsfree: Add support for ATD command 2014-03-10 12:32:14 +01:00
Szymon Janc
c3fde816cf android/handsfree: Fix checking AT+COPS parameters 2014-03-10 12:32:14 +01:00
Szymon Janc
c81a0b07c6 android/handsfree: Add support for ATA command 2014-03-10 12:32:14 +01:00
Szymon Janc
e0cf89e07c android/handsfree: Add support for AT+VTS command 2014-03-10 12:32:14 +01:00
Szymon Janc
13d4384f68 android/handsfree: Add support fot AT+CNUM command 2014-03-10 12:32:14 +01:00
Szymon Janc
28b2c48c28 android/handsfree: Add support for AT+CKPD command 2014-03-10 12:32:14 +01:00