History log of /system/bt/bta/include/bta_ag_api.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
90174f35148c69502beec0325c93bce931d6f8f6 20-May-2018 Jack He <siyuanh@google.com> HFP: Return SDP status to HFP layer

* Fix an error introduced in change Ic0b4498dd623d0ea31b4513d6b7861cae390bc72
so that SDP status is sent up to the HFP BTA layer
* With SDP status correctly passed up, HFP BTA layer can correctly
determine when to continue SDP search for HSP
* When open connection to HFP or HSP devices, use a control block's
registered services instead of passing in opening services every time
from BTIF layer
* Do not use a control block that are in CONNECTING or DISCONNECTING
state
* Add a crash in btif_hf.cc:connect_int() to gurantee that no control
block is in connecting or disconnecting state when connect_int is
called as it should be guranteed by the btif queue configuration

Bug: 74234576
Test: connect to headset, make calls and hangup
Change-Id: I5e2bce8c2f0f51bd3fd3e85e82827c5fb5e92887
(cherry picked from commit 4bf260f2b71c15f091290b16f6c7948b21fa7c49)
/system/bt/bta/include/bta_ag_api.h
2dd0bdf068e329bf2aaf8d131730270de083cbe3 01-May-2018 Jack He <siyuanh@google.com> HFP: Workaround for car kits that do not send AT+BAC command

* Some misbehaving HF devices (e.g. some Hyundai car kits) indicate
their support on Wide Band Speech and Codec Negotiation, but do not
send the required AT+BAC command during Service Level Connection
setup. However, such car kits still expect Fluoride to do codec
negotiation during SCO setup.
* This CL adds a workaround so that when HF indicates support for WBS
and codec negotiation, Fluoride will attempt codec negotiation even
though AT+BAC is never received.
* Store the SDP feature locally. If WBS is supported and no AT+BAC is
received, use the SDP features to set the suported codec.

Bug: 77883405
Test: make, connect SCO to and from Hyundai car kits
Change-Id: I2be6007022183cac5b9006f37089a587b4a67372
(cherry picked from commit e42cf153f8cc9f2b80153aa3eb7c0be04f3c326f)
/system/bt/bta/include/bta_ag_api.h
559b8b5e9c1fd996be6069dcae10ca02f6a552a4 06-Apr-2018 Jack He <siyuanh@google.com> HFP: Report AT+BIA command to upper layer

* Report AT+BIA command, AG indicator activation command, to upper layer
so that upper layer can decide on whether or not to subscribe to these
indicators

Bug: 77655992
Test: make

Change-Id: Ic330d6784c5edf20683cbfedda3fa54525878ce8
(cherry picked from commit 1fa5d797d023576c0d102e2e611345d32daaac42)
/system/bt/bta/include/bta_ag_api.h
29cddf92a53abcf5c5e1946ffeccda1c4396e8a5 21-Oct-2017 Jack He <siyuanh@google.com> HFP: Save discovered HFP version to config file

* Store discovered HFP version to btif config file so that a
reconnection session knows the HFP version before SDP
* Check stored HFP version when RFCOMM channel is open before any AT
command is processed
* Set peer HFP version to 0 on control block allocation

Bug: 67938255
Test: Connect with HFP 1.7 headsets
Change-Id: I43e7aa04dee17ea7ba9e7d3992ec0860c11d23bc
(cherry picked from commit 79b4e0710b23f9bd96c0fc71d68e6649188b1bde)
/system/bt/bta/include/bta_ag_api.h
ca7d6f5912606a6306287fea372b660af117efc8 10-Jan-2018 Jack He <siyuanh@google.com> HFP: Add support for Multi-HFP (2/2)

* Allocate at most 6 control blocks for btif_hf and bta_ag,
this limit is defined by BTA_AG_MAX_NUM_CLIENTS
* Allow at most 6 RFCOMM connections to be managed by bta_ag
* Allow at most 6 SDP callbacks for each bta_ag
* Reject incoming SCO connection and do not start outgoing SCO
connection if not coming from the current active device
* Reject incoming AT+BCC request if the remote device is not an active
device
* Support only one device by default
* Fixed a bug in BTM_CreateSco where power mode was checked for old
device and new power mode is set for new device and caused BTM SCO
state machine to stuck in SCO_ST_PEND_UNPARK mode
* Added logs at failure conditions to be more verbose about connection
errors and removed logs from non-error conditions to reduce verbosity
in normal conditions

Bug: 68952570
Test: runtest -j40 bluetooth, native unit tests, HFP regression for 1
device, simple tests for multiple devices
Change-Id: I97d20f6a126d77a4ef3a0cd1706b48130b4a6aae
/system/bt/bta/include/bta_ag_api.h
8b699d1076885c6525153d927a6edae2fa1ba6f0 06-Jan-2018 Jack He <siyuanh@google.com> HFP: Use base::Bind instead of messages for bta_ag_api functions

Summary:
* Do not use bta_sys_sendmsg(BT_HDR) in bta/ag, use base::Bind instead
* Do not use BT_HDR in bta/ag
* Do not do memcpy during thread switch in bta/ag, instead, we use the
default copy constructor

Details:
* Currently, bta_ag_api functions use explicit messages to cross from
jni to bta thread. This adds unnecessary indirections that make it
hard to figure out which methods in bta actually get called
* Instead, base::Bind can bind to methods in bta directly without
putting parameters in an explicit struct. This greatly simplify our
code without breaking the current threading model
* With base:Bind, we no longer rely on bta_sys_sendmsg(BT_HDR) to send
event across threads. We can therefore get rid of BT_HDR in all
sub-types of tBTA_AG_DATA. Instead of using BT_HDR->layer_specific
flag to pass down handle IDs, we pass down handle ID directly,
resulting in less confusion on the actual meaning of data

Bug: 70538124
Test: runtest bluetooth, native unit tests
Change-Id: Ic0b4498dd623d0ea31b4513d6b7861cae390bc72
/system/bt/bta/include/bta_ag_api.h
3f10b14ea5631a894bc2f1db31d5dc020922c28e 07-Jan-2018 Jack He <siyuanh@google.com> HFP: Remove AG RFCOMM data pass through mode

* In BTA_AG_PASS_THROUGH mode defined in bta_ag_api.h, RFCOMM data is
passed directly to the upper layer. In this case, AT commands are
parsed in the user application instead of being parsed within the fluoride
stack.
* However, this mode is never used on the stack as btif_hf.cc only call
BTA_AgEnable() with BTA_AG_PARSE parameter value. Currently, AT
commands are only parsed within the fluoride stack
* This change removes this feature since the pass through mode is
never used, tested, nor maintained

Bug: 70538124
Test: runtest bluetooth, native unit tests, no functional change
Change-Id: I921d5ee950e4abadea8433c5b2d5882a99923cb0
/system/bt/bta/include/bta_ag_api.h
97611857726dbfb2a4308d7127e7649b7fff732c 07-Dec-2017 Jack He <siyuanh@google.com> HFP: Add APIs for set and get active device (3/3)

* Add set active device APIs to set active device from Java layer
* Set active device to the first connected device if no one set it
before
* Clear active device on RFCOMM disconnection if active device is the
one getting disconnected
* Currently, the active device value is not used in any functional code

Bug: 68951996
Test: runtest -j40 bluetooth
Change-Id: Id0c00e89178b0f963ed8642e72c7010160dd1d68
/system/bt/bta/include/bta_ag_api.h
6545d3f346764d796db65f403335f0d2e83ea35a 12-Dec-2017 Jack He <siyuanh@google.com> HFP: Fix static check errors

* In bta/ag and btif/btif_hf.cc
* Simplify boolean values
* Use nullptr intead of NULL
* Use C++ style include headers instead of C style ones
* Remove unused struct definitions
* Remove unused code from bta_ag_ci.h/cc
* Use range based for-loop when it can be converted automatically
* Use C++ style zero-initialization instead of memset so that non-POD
members of structs can be initialized properly
* Use "" to initliaze char array since the rest of the array will be
zero padded if the array is assigned to a shorter string than its
length

Bug: 68340193
Test: make, connect to HFP enabled device
Change-Id: I25c1e48ca1cb40629b9b60243ec462f498d8fc24
/system/bt/bta/include/bta_ag_api.h
424f2cc7b73748250af3e16c41734f237581fa34 14-Jun-2017 Albin Joy <albin.joy@huawei.com> HFP: notify HF about call status forcibly

When call is hung up and still there is another
call is in active,some of the HF cannot acquire
the call states by its own. If HF try to terminate
a call, it may not send the command AT+CHUP because
the call states are not updated properly. HF should
get informed the call status forcibly.

Bug: 63411867
Test: motorola H500
Change-Id: I4025b39ebcef0bc915a6ab146ea3a5c5a8ebb2c2
/system/bt/bta/include/bta_ag_api.h
5b790feeeb211c42bf78ca3ae9c26aa30e516765 18-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Make copyright headers consistent with Google template; remove "(C)"

Test: Comment changes only; still compiles...
Change-Id: Id699a8170112f06e4a2c9f2e0f0834d1817ace4e
/system/bt/bta/include/bta_ag_api.h
a484a888196ddf8bcbf1ad3226d6451bc735a94b 25-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Rename bt_bdaddr_t into RawAddress (3/3)

Test: compilation test
Change-Id: I4571721a0c6165a66450ee157a53d8d15bfc45d0
/system/bt/bta/include/bta_ag_api.h
c2276b06572ab6fc1f900fbb1f41087e77d47e2a 10-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Use bt_bdaddr_t instead of BD_ADDR

Test: compilation test, sl4a GattReadTest
Change-Id: I8d1bd6914aec55bb53495b1d0d5e3d37b86865e6
/system/bt/bta/include/bta_ag_api.h
acdc11cae50e335175cfb16935dec160b0327966 19-Apr-2017 Zach Johnson <zachoverflow@google.com> Allow blocking AG SCO connects by policy

Needed for devices that support both HFP AG and HFP HF.

btsnoop logs show the sequence of events leading to failure:
(corroborated by bt logcat)

1. ACL connection with remote phone established on handle 0x01
2. ACL connection with remote headset established on handle 0x02
3. Incoming call in HF role from phone
4. Phone call locally published to telecom
5. Answer incoming call
6. SCO connection established with phone in HF role
7. AG role with headset picks up on call state change to answered
via BTA_AG_IN_CALL_CONN_RES
8. Inside handler for BTA_AG_IN_CALL_CONN_RES, bta_ag_sco_open called
to establish the SCO connection in the AG role with the headset,
stomping on the previous (wanted) SCO connection with the phone.

Fix is to publish the SCO audio route policy to fluoride, so we can
stop 8 from happening.

Bug: 32958838
Test: manual:
received incoming call in HF role, audio worked both ways;
recieved incoming MT call, headset audio in AG role worked both ways
Change-Id: I12961598e8200bd1d5adb46ee8ec3a802114b80a
/system/bt/bta/include/bta_ag_api.h
400ac497f45181d3c64f6a19687992de9b69b094 08-May-2017 Jack He <siyuanh@google.com> eSCO: Additional fix to get eSCO working for HFP and HSP (3/5)

* Removed vendor specific call after codec negotiation and before eSCO
command is sent to Bluetooth chip
* Removed vendor specific call after a SCO connection is requested by
the peer
* Removed vendor specific save audio state methods

Bug: 19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: I899405a8eaa2f38ee0de04949c5288f9eefa74df
/system/bt/bta/include/bta_ag_api.h
3e634d6c1e83f053005c9abdbd89e662ad81c4d4 10-Feb-2017 Myles Watson <mylesgw@google.com> eSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)

All of our platforms support WBS.

Bug: 19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: I384d49f73935ebb35b17132e71c85174797c435e
/system/bt/bta/include/bta_ag_api.h
ad1e23d50e431fb82ff1b8d3ce02f64ca0c5a940 10-Dec-2016 Jack He <siyuanh@google.com> Remove extern "C" from header files

Since change 290046, most files in system/bt is compiled as C++ source.
Therefore, there is no longer a need for the extern "C" wrapper around
includes that export symbols from those sources.

The following python script is applied to each file in the directory:

front = '#ifdef\s+__cplusplus\s+extern\s+"C"\s+{\s+#endif\s+'
back = '#ifdef\s+__cplusplus\s+}\s+#endif'
with open(sys.argv[1], "r") as f:
data = f.read()
data = re.sub(front, "", data)
data = re.sub(back, "", data)
print data

through a shell script:

for file in $(find . -name "*.h"); do
python remove_cpp_extern_c.py $file > tmp
cat tmp > $file
rm tmp
done

with following files not edited:
* stack/include/a2dp_*
* include/bt_trace.h
* embdrv/sbc/*

Bug: 33492510
Test: Code compilation, BtFunhausMetricsTest, BtStressTest
Change-Id: Iac21cdfb1924b50478dd0b82326e092602cbc9d4
/system/bt/bta/include/bta_ag_api.h
911d1ae03efec2d54c3b1b605589d790d1745488 29-Nov-2016 Myles Watson <mylesgw@google.com> Apply clang-format to the rest of the tree

find * | grep "\.[ch]" | xargs clang-format --style=file -i

Test: mma -j32
Change-Id: I6fcc9862bb7bc07c2a367ca58fef2b3cd27a6f05
/system/bt/bta/include/bta_ag_api.h
9ca07091a1f07ea201cee0504dab6a1d7073d429 29-Nov-2016 Myles Watson <mylesgw@google.com> Reformat long comments before clang-format

Test: mma -j32
Change-Id: I86a2a4af9dcd22d675ca1f764bb2c9623d63edcc
/system/bt/bta/include/bta_ag_api.h
cd1fd07f1306e08fe048682dd5918987e579f937 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Apply clang-format

clang-format -i --style=file bta/*/*

(twice)

Test: mma -j32
Change-Id: Ib118b1dfb6a34f9a5bfe153d65841e9041165264
/system/bt/bta/include/bta_ag_api.h
8af480e24549ba51a3f6858d9d9af504715e0bea 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Remove double asterisks in comments

Double asterisks at the beginning of the line
sed -i s,"^[*][*]"," *", bta/*/*

Double asterisks after a space
sed -i s,"^ [*][*]\([^*]\)"," *\1", bta/*/*
sed -i s,"^ [*][*]$"," *", bta/*/*

Test: mma -j32
Change-Id: Ib83b802c7000176683b4e7f24d1255b3c2c6c01c
/system/bt/bta/include/bta_ag_api.h
d5eb30d9cabc25d84a257685d781352edda7f361 05-Nov-2016 Andre Eisenbach <eisenbach@google.com> Mask out HFP 1.7 feature bits if peer version is <1.7

Bug: 32378402
Test: manual
Change-Id: Iac8684bdfd02b18cce260bedefb829e8f7285361
/system/bt/bta/include/bta_ag_api.h
b2a292b5d8df2f359c38b0787bc01181225a9bc9 15-Oct-2016 Pavlin Radoslavov <pavlin@google.com> Renamed most C files to C++: *.c to *.cc

Also:
- Fixed C++ related compilation errors.
- Added missing 'extern "C"' guards in some of the header files.
- Added missing LOCAL_CPP_EXTENSION to Android.mk files.
- Added-back btif/src/btif_mce.cc and bta/mce/bta_mce_* to
btif/Android.mk and bta/Android.mk respectively.
- Fixed the alphabetical ordering of the *.cc files in some
of the Android.mk files.
- Added missing Copyright header to "osi/include/list.h"
- Updated "osi/src/wakelock.cc" to use C++ std::string
instead of dynamic allocation of C-style strings.

Test: code compilation, unit tests, and A2DP streaming
Change-Id: Ia2f7215ed9df32775c701b68fc86b09875b942c7
/system/bt/bta/include/bta_ag_api.h
d19e0785e662e640191a075eda07acce61c2aeda 15-Jul-2016 Marie Janssen <jamuraa@google.com> Use standard types, consistent ifdef style everywhere

Remove the typedefs in stack/include/bt_types.h

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Update script to be less disruptive to aligned assignment blocks.

Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0
/system/bt/bta/include/bta_ag_api.h
4de9bbcde79eb98dbfd56de292902549ac3e2bc1 29-Feb-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> HFP 1.7 profile update (1/4)

-> Added AG support for HFP 1.7 version upgrade which
adds new type of indicator called HF(headset) indicators.
-> Added support for two new AT commands AT + BIND and AT + BIEV
which have been appended to Hands-Free SLC sequence.
-> Added support to propagate the above commands and their data to
the upper layers.

Bug: 19983867
Change-Id: I93d5b2af949f9fb99507a954e623cd0927ddc976
(cherry picked from commit e5bed64926d6ae45501617052f90932287da135b)
/system/bt/bta/include/bta_ag_api.h
e9e58ced195ec2c983c7723c9cbdabd45eb0f2fd 17-Jun-2016 Marie Janssen <jamuraa@google.com> bta: use standard types

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
/system/bt/bta/include/bta_ag_api.h
3d6accfcc0bdc5c7a8713320c9bb069cbf253348 11-May-2016 Bryce Lee <brycelee@google.com> Move extern "C" to top of headers and remove tBTA_HF_CLIENT_HDR.

Previously, extern "C" was placed in various locations within the header
files, sometimes below actual struct declarations. Doing so would lead to
alignment issues between C and C++ code.

tBTA_HF_CLIENT_HDR was removed from bta_hf_client_api since it was
extraneous and empty - leading to alignment issues.

Change-Id: Icdd338f1affe4c3a70c7bbd716249be6a16443d2
/system/bt/bta/include/bta_ag_api.h
713993d1784ab7c23aee1fa3cf1ab8676cc0aa69 21-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Convert BTIF code from C to C++

Modifications required:
* added proper casting
* moved variable definitions before goto statements
* added 'extern "C"' markers where needed
* renamed 'operator' to 'operator_name'

Bug: 28485365
Change-Id: I903357967387207e678866c02e008f047f8263f6
/system/bt/bta/include/bta_ag_api.h
d345bb208fe35923b60bca6af76b0a6e023fc56f 22-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Handle multi party call states

UseCase:
1. Set up Bluetooth connection between phone and remote device.
2. Disconnect BT link by turning off remote device.
3. Start Mo call from phone.
4. Receive MT call from far end.
5. Turn on remote device.
6. BT connection gets established successfully, but audio
doesn't get transferred to headset.

Failure:
Call audio not routed to BT HS. SCO not established.

Root cause:
When a HS connects while in an active call and 2nd call
(incoming/outgoing/alerting) setup ongoing, incorrect post SLC
call setup updates might cause HS to get confused as phone had
already updated correct call states in CIND response during SLC.
This may cause HS to behave abnormally like delayed response to
BCS as seen with jabra wave +.

Fix:
Avoid sending incorrect call updates post SLC since we already
have sent correct updates during SLC as reponse to CIND.

Change-Id: I53e57baf7cca782af6f374a043667971c66a956d
/system/bt/bta/include/bta_ag_api.h
6afb248849399cfba59fb1e683a06e31d88e5d1d 25-Mar-2015 Mudumba Ananth <ananthm@broadcom.com> Resolved hardware error observed during SCO Connection setup

Hardware error was caused due to a faulty HCI command formed in the
process of vendor specific pre-SCO setup in the stack(set_audio_state)

Fixed the above problem and also added back the vendor (interface)
mapping for the set_audio_state functionality to facilitate the
sending of the pre-SCO vendor specific commands.

Made common vendor library audio setting by moving to hci subsystem.

General cleanup around this functionality.

Bug: 19923226
Change-Id: I4a743f6725459f360bd2a90e0a46f08fcca2292d
/system/bt/bta/include/bta_ag_api.h
24933b5b1a06274c47133debac5251a97128a267 25-Sep-2014 June R. Tate-Gans <jtgans@google.com> Removing unnecessary BTAPI #defines.
/system/bt/bta/include/bta_ag_api.h
66432dcffe211e317d35978283a04a96d5620bdf 27-Apr-2014 Matthew Xie <mattx@google.com> Add WBS support on Bluedroid (2/6)

Bug 13764086

Change-Id: I12bf302f7dd19efb497ad49d4d1d638a7a926049
/system/bt/bta/include/bta_ag_api.h
2cb90bc58fc075ec2f814ada5ae8f728380566c1 15-Mar-2014 Nitin Srivastava <nitinsr@codeaurora.org> Add support for Multi-HFP devices

1. Add multi headset support in stack.
2. Each HS will be associated with unique CB in BTIF
and also corresponding SCB in BTA.
3. Upstream event callbacks will be sent to
specific HS based on BD_ADDR.
4. Similiarly all commands to BTIF will be for
specific HS.

Change-Id: I0dc6b1b54f16244b802d818ae60944877a41d020
/system/bt/bta/include/bta_ag_api.h
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/bta/include/bta_ag_api.h