OSDN Git Service
Matadeen Mishra [Thu, 7 Nov 2013 15:05:39 +0000 (20:35 +0530)]
Bluetooth: Notify BT APP about alias as the name if present
While scanning notify the Bluetooth APP about the alias name
as the actual device name of snanned device if alias name is
present.
CRs-Fixed:
1055177
Change-Id: Id8a093b1503eb3f308f466f30c1a4a6f4c250594
Manu Viswanadhan [Fri, 19 Aug 2016 11:13:57 +0000 (16:43 +0530)]
Bluetooth: Including vendor HAL directory path for wearables
Including vendor HAL directory path for wearables
Change-Id: I7e310bd08b5c75f4cd532d2feb2eea3635cd9a0d
CRs-Fixed:
1056850
pramod kotreshappa [Thu, 28 Jul 2016 05:56:21 +0000 (22:56 -0700)]
A2DP: Multiple Split-A2dp fixes
- Sanity check ctrl fd is valid, if the output stream was not
closed previously and audio hal is trying to start stream.
- Ack back stream suspend ctrl command from the hal immediately
during device disconnect is initiated during streaming to avoid
delay in device disconnection.
- If stream start is requested from audio hal and disconnect is
initiated at the same time, check for ctrl cmd pending for ack.
- Increase stream start retry timeout to 8sec to address IOT
issue in soft handoff scenario.
Change-Id: I39c1963cb2ecedd568b4e8b67b2df891d8f9f5bf
Ayan Ghosh [Fri, 8 Jul 2016 07:27:38 +0000 (12:57 +0530)]
Proper state transition for disconnect during connection setup
- Ensure BTA AV correctly moves to init state when remote tears
down the AV connection and ACL during incoming connection setup.
- Properly set collision flags for handling AV connection collision.
CRs-Fixed:
1052672
Change-Id: I30cecf2cbf2cd4a21b243230e81ced80ae773db5
Umesh Vats [Tue, 9 Aug 2016 18:52:48 +0000 (11:52 -0700)]
Fix for SS Level U headset not connecting
Added the changes to do proper comparison of the codec configuration
based on codec selected by the remote headset
CRs-Fixed:
1052332
Change-Id: I078f07b39ab61ea2755333f0d94afe9efaf86c85
Satheesh Kumar Pallemoni [Thu, 4 Aug 2016 12:14:11 +0000 (17:44 +0530)]
Do SDP when HSP connection opened by remote.
When HSP connection opened by Remote do SDP, So that AG could find out
whether remote supports remote volume control feature.
CRs-Fixed:
1052230
Change-Id: I6441142fcdebcd9f2b652f90e0d8d592dea3db3d
Ayan Ghosh [Mon, 25 Jul 2016 12:39:15 +0000 (18:09 +0530)]
Allow second A2dp connection when SCO exists with first
Allow A2dp connection with second device even when there is
an ongoing SCO with first and role switch fails.
CRs-Fixed:
1048629
Change-Id: Iacc2a8a3f53f497b8e00d8641b53a218c5a74589
Ayan Ghosh [Mon, 20 Jun 2016 10:34:37 +0000 (16:04 +0530)]
Initiate Reconfig if DUT preferred config not chosen
- Add all mandatory capabilities to DUT supported config list.
- On peer device initiated AV Setconfig if peer chooses
any config other than DUT preferred one then trigger AV
Reconfig to override remote chosen config.
CRs-Fixed:
1043899
Change-Id: I6c89c4fb6f87be967c280c8c1c422e250bf91ae3
Nitin Arora [Fri, 5 Aug 2016 00:39:01 +0000 (17:39 -0700)]
Bluetooth: Increase profile connection timeout
This change increases the timeout after the gatt
discovery complete from 1 sec to 5 sec.
For profiles such as HOGP, the profile level gatt connections
after the discovery complete callbacks sometime take more time,
due to which the "no app timeout" disconnects the physical link.
This change will hold the gatt connection used for remote discovery,
for 5 seconds, after the discovery is complete, and thus provide
sufficient time for the profile level connections to kick in.
CRs-Fixed:
1050047
Change-Id: I8f3c3ad162e3dadeb0e3215bf9fe6a20e4d9c425
Umesh Vats [Fri, 22 Jul 2016 19:34:08 +0000 (12:34 -0700)]
Sometimes BT settings UI shows wrong name for a paired device
This patch includes changes to use BTM_SecReadDevName instead of
bta_dm_get_remname() for getting the remote device name during
BTM_LE_NC_REQ_EVT (SMP Numeric comparison request event).
bta_dm_get_remname() relies on the global variable
bta_dm_search_cb.peer_name. This variable can have name of the
legacy device inquired earlier. Now if an LE device is paired,
during numeric comparison request event, the older remote
name stored in bta_dm_search_cb.peer_name is used and gets
stored when the LE device is pairing
Change-Id: I0e02ed262ac111c074e0a4a8b29e84a57e41faf1
CRs-Fixed:
1045318
Nitin Arora [Mon, 25 Jul 2016 18:33:19 +0000 (11:33 -0700)]
Bluetooth: Add logic to cancel link timeout alarm
Issue:
Post bonding process, temporary gatt connections are
created to perform device name discovery and remote
device discovery before any profile level connections
are made for remote devices. At every disconnection
the number of apps holding the physical link is validated
to keep the link alive. A disconnection starts the idle
timeout of 1sec if there is no other apps available.
However, a new logical connection is unable to reset
the timer, even if the link comes up, within 1sec of
the last disconnection.
Fix:
At every connection occuring within the "No app timeout",
the link timer is cancelled since there is still a gatt_if
that needs to keep the link alive.
CRs-Fixed:
1050047
Change-Id: I3205894e4d692e4e8b1a547b6fb4d346c4f281a5
Gurpreet Ghai [Tue, 2 Aug 2016 10:23:33 +0000 (15:53 +0530)]
BT: Fix hardware error detection failure for Pronto devices.
Issue: Hardware error detection failure during scenario which
include enforced ssr.
Cause: Due to incorrect condition, the function that checks
for hardware reset bit was not called.
Measure: Applied the correct check so that hardware reset is
detected in pronto devices.
Change-Id: Ie6cea5fc2b33956d01911910fcc97f8c4b4b6669
Matadeen Mishra [Tue, 2 Aug 2016 10:30:22 +0000 (16:00 +0530)]
BT: Remove Btsnoop_dump from system/bt as tool is disable
Remove Btsnoop_dump directory from system/bt.
Change-Id: I6dea2c9d87926aa1a8d77682c970462c20026d18
CRs-Fixed:
1049200
pramod kotreshappa [Tue, 10 May 2016 06:44:35 +0000 (23:44 -0700)]
A2DP: Split A2DP Extension
Split A2dp extended feature enables a2dp encoding offloaded to
LPASS. Codec info is provided to audio module via BT IPC library
to instatiate encoder session in LPASS. Remote headset codec info
is provided to BT SoC to encapsulate avdtp and l2cap header to
encoded audio data from DSP module.
Change-Id: I4dede32c7510dc6e95555d56d1066a0f9bfdf860
pramod kotreshappa [Thu, 31 Mar 2016 21:34:20 +0000 (14:34 -0700)]
A2DP: New BT IPC library
New BT IPC library that facilitates communication betwee audio hal
and BT host. Bthost-ipc library will be loaded by audio primary
hal in Split A2dp scenario to communicate with bt host and in
legacy non-split a2dp scenario this library will be loaded by
a2dp hal.
Change-Id: Ie11d88b27662c97a00ac9d484ae9c621293949e8
Ayan Ghosh [Thu, 3 Dec 2015 13:55:53 +0000 (19:25 +0530)]
Misc Split A2dp changes.
- Disconnect A2dp if any of the vendor specific command
fails to start Split A2dp in controller.
- Send mesaages to media task command queue only if
queue exists.
- Proper handling of Remote Suspend and Start.
Change-Id: I0498487d4d54b8c793e439f777e38343f89a5c9d
Ayan Ghosh [Wed, 7 Oct 2015 13:04:50 +0000 (18:34 +0530)]
Split A2dp implementation
Implement Split A2dp to process AVDTP Signalling commands
from host and media packet handling from Controller.
Host uses vendor specific commands to let controller know
the media channel configurations for controller to form
the media packets accordingly.
Change-Id: I7a98177a8125fd70b057bb514f0d870971a45bcf
Subramanian Srinivasan [Thu, 28 Jul 2016 20:11:34 +0000 (13:11 -0700)]
Fix display of GATT cache server attributes
Fix the display of GATT cache server attributes by
making use of the new GATT attribute data structures
when BTA_GATT_DEBUG is enabled.
CRs-fixed:
1047756
Change-Id: If5bbbde5b43c4e82ab4fa772c1a16e99b839ccd5
Manu Viswanadhan [Tue, 12 Jul 2016 12:46:51 +0000 (18:16 +0530)]
Bluetooth: Introduced new HAL directory for VS interface
Introduced new HAL directory for all vendor specific interface
implementations. This helps in keeping original HAL untouched
with respect to vendor specific changes. The new directory will
be used for all vendor specific API calls.
CRs-Fixed:
1047009
Change-Id: I99a4b55f645a9719fca535ee659757c55e9211e8
Ayan Ghosh [Tue, 12 Jul 2016 10:36:49 +0000 (16:06 +0530)]
Do AV registration for different roles in proper way
For multiple codec (SBC, APTx) and multiple role (SRC, SNK) enabled
environment make sure registration of individual AV endpoints are
done in a way that enabling different roles for differnt codecs does
not affect other codecs or roles.
CRs-Fixed:
1042243
Change-Id: I03e05eef7d9bf669c6600630afcb507bb52bd5a7
venkata Jagadeesh [Tue, 12 Jul 2016 13:48:12 +0000 (19:18 +0530)]
Bluetooth : GAP : Dont initiate role switch for blacklisted remotes
Don't initiate role switch for blacklisted remotes from DUT
as some remotes always rejects role switch and role swicth retrails from
DUT may lead to a2dp glitches or random disconnections
Change-Id: If0c5212e38ab16a16b6fda35b15b160f89f7f297
CRs-Fixed:
1040611
Umesh Vats [Mon, 25 Jul 2016 18:19:25 +0000 (11:19 -0700)]
Move aptX config parse to main code from the library
For aptX offload feature, aptX config parsing and caps check
functions need to be included in open source
Change-Id: If31864374a3fa04720b03637c3dfb492f2cfacd1
CRs-Fixed:
1046053
Matadeen Mishra [Thu, 21 Jul 2016 11:21:07 +0000 (16:51 +0530)]
Fix for error reported by Static analysis tool
- Fix Array Index Out of Bounds Exceptions
in the fludroid code space of Bluetooth.
Change-Id: If6d2c208e12a3e71ecd9d4d375ef6f8b81e17532
CRs-Fixed:
1044013
Hemant Gupta [Wed, 15 Jul 2015 09:38:29 +0000 (15:08 +0530)]
PBAP: Add support for SIM phonebook in SDP
This change will add SIM phonebook service support
in SDP registeration.
Change-Id: I1315a9031e66bc091a9d3d2721182e843e35e2cd
CRs-Fixed: 509165
Satish kumar sugasi [Fri, 10 Apr 2015 19:46:02 +0000 (12:46 -0700)]
Bluetooth: LE Stack certification tool changes
This includes changes needed for new code baseline
and below stashed commits.
Bluetooth stack 4.0/4.1 certification tool changes
This adds test application code and stack interface
code for BLE certification purpose
CRs-fixed: 649248
Change-Id: I6e8ecbf2fdb0fe6ee80fd6d57c2e151b62797f01
Bluetooth: Avoid Encryption after gatt server connection complete.
This doesn't start encrtyption by default after connecting to a client.
needed for certain test cases of BLE stack certification.
Change-Id: I04dbe1daba32b416f59fed00989168507ce261fa
CRs-Fixed: 652485
Bluetooth: add config flag to gatt tool test app
This adds logic to compile gatt tool only if config test flag
is enabled and aincludes indendation changes
Change-Id: If018d0676bb6334be0558fd6f6464ffbfc33196a
Bluetooth: Gatt tool changes and code cleanup
Fixes for compilation issues and remove CONFIG
flag from makefile.
Change-Id: I57646edf9b0ec3ffd62e34aeed54f13ef09ef1a0
Bluetooth: Include Gatt test app for certification
This adds debug and optional flags to makefile to compile tool
as part of android build
Change-Id: I603a982a4bc7c392e45e753bcbb57bf8394ed21c
Bluetooth: Add gatt refresh api in gatt certification tool
this fixes gatt tool crash during service discovery test cases
and code cleanup.
CRs-Fixed: 734268
Change-Id: I7e600d912c0b631b3bc865c571f9ad1c05f99ae4
Bluetooth: Add conn update api for gatt tool
This adds support to do LE connection parameters update after
successful connection using Gatt test app for certification
CRs-Fixed: 743373
Change-Id: Id76d244f6bf7721016ef397c8bfea9cd877b0253
Bluetooth: Gatt tool change for wakelock support and cleanup
This change does send hci success status for wakelock apis which
are newly added in BT.Also does remove tabs and proper indentation
CRs-Fixed: 743399
Change-Id: I9346c3a04e4c7238cd5afaabb0361f7083cb93fe
Supports Simple pairing with No bonding and no MITM
Supports Bluetooth simple pairing with no MITM,
no bonding set in the authentication request and
initiator and responder keys set to 0.
Change-Id: I6e8ecbf2fdb0fe6ee80fd6d57c2e151b62797f01
Conflicts:
main/Android.mk
Change-Id: I36eba14defe16418037ba4b253d31c9a6270d93c
Gurpreet Ghai [Thu, 4 Feb 2016 14:40:03 +0000 (20:10 +0530)]
BT: Adding check for hci_layer status before processing func calls
When hci_layer functions for transmit command and cleanup
are called during hci_layer shutdown, they might try to
access lists that are already cleared as part of shutdown
process. This causes issues during BT turn off.
Added check within such functions to check for hci_layer
state before processing.
Change-Id: I8dbca9893e03dfc500886c5033a79976dc5d23e1
Bluetooth: Process data only after cmd cmpl for reset
- Process incoming event/ACL packet only after command
complete event received for reset command.
- Otherwise there might be a chance of receving other
events though the controller module is not ready,
as part of processing events, accessing the controller
module capabilities leads to crash.
Change-Id: Id4b1d207fd237d56c95c7af801fc25d8c05808df
BT: Adding check for hci_layer state before dispatching event
During Bluetooth disable process, alarms and command lists
are reset causing race condition because pending commands
and packets are still present in the list and reactor still
runing. So, adding check for hci layer state before processing
events of command and packet ready.
Change-Id: Ib10a2caa7a9e4739088d5192208fb4f97f3e4bbf
CRs-Fixed:
1022151
Satheesh Kumar Pallemoni [Tue, 19 Jul 2016 06:23:39 +0000 (11:53 +0530)]
AG: Set/Unset HF indicator bit based on remote device
For HFP 1.6 or below remote devices, we don't set HF indicators,
S4 settings bit in BRSF in the current implementation. For HFP 1.7
remote devices, if remote does not set HF indicators bit, unset
HF indicators bit in AG's BRSF.
CRs-Fixed:
1042926
Change-Id: I24844ffd7c045cd5b19f554d78470db27bcb9f1c
Umesh Vats [Thu, 21 Jul 2016 18:19:39 +0000 (11:19 -0700)]
Bluetooth: Fix for aptX media thread cleanup crash
Changes added to stop aptX scheduler thread before media
thread cleanup happens.
Change-Id: I1988ea3c6b0a560d7028769307ed25e6876ac4dc
CRs-Fixed:
1041402
Subramanian Srinivasan [Thu, 21 Jul 2016 23:15:15 +0000 (16:15 -0700)]
Handle service discovery states properly when server cache state is LOAD
When the BT stack's server cache state is BTA_GATTC_SERV_LOAD while
performing GATT service discovery, the stack does not issue a proper
GATT_Disconnect after the completion of Gatt discovery procedure.
Also the p_clcb state is moved to BTA_GATTC_DISCOVER_ST state for
conn_id 5.
When p_clcb state is moved to BTA_GATTC_DISCOVER_ST, it implies that
service discovery is in progress in BT stack. In this scenario, when
GATT operation requests like GATT Read, GATT Write, etc are received
by BT stack from upper layers, the BTA layer state machine
(bta_gattc_sm_execute) queues up these GATT operations instead of
executing these GATT operations immediately.
The queued up GATT operations are generally executed after the service
discovery procedure is completed. In this case, the queued up GATT
operations never get executed since the GATT discovery procedure does
not get completed properly and hence the GATT operations fail.
This change cleans up the pending GATT connects for service discovery
when the server cache state is BTA_GATTC_SERV_LOAD and also resets the
discovery state. This would allow other GATT operations to get executed
by BT stack.
Change-Id: If2a25d45e2f37d1092752d4d6184540a4768c771
Rupesh Tatiya [Thu, 30 Jun 2016 15:07:22 +0000 (20:37 +0530)]
Synchronize RPA completion callback and cleanup
There is a cleanup API which can free memory for btm_multi_adv_cb while
RPA completion callback API might be using this memory for processing.
Protect btm_multi_adv_cb resource across these two functions.
CRs-Fixed:
1036742
Change-Id: I5872b0a1ff1765b0f6c4e45e3d32551c03532393
Umesh Vats [Sat, 16 Jul 2016 01:00:17 +0000 (18:00 -0700)]
Bluetooth: KW fixes in btif_rc.c
Check on index introduced.
Change-Id: Id7ff430a16cade1512e0cabef3c694c80a10b0b0
CRs-Fixed:
1042595
venkata Jagadeesh [Mon, 11 Apr 2016 14:28:54 +0000 (19:58 +0530)]
Bluetooth : Handled Cert tools new timer permissio issue
Cert tools new timer permission issue resloved.
Change-Id: I775807c07cafc326d5aae736bdcba677abc1bcfc
CRs-Fixed:
1042284
Subramanian Srinivasan [Mon, 16 May 2016 18:14:03 +0000 (11:14 -0700)]
Process Gatt read multiple response properly
The Gatt server multi response queue is made NULL after each Gatt
server response is sent by BT stack in response to the remote Gatt
client's request. But the multi response queue is not initialized
again to process subsequent read multiple Gatt server responses.
Hence, the BT stack does not send Gatt server responses for the
subsequent read multiple requests from remote device which inturn
leads to disconnection. This change would process read multiple
responses by initializing the queue when it is null.
Some of Bluetooth certification test cases involve testing
Gatt server's capability to process and send read multiple
response.
Test case: TC_GAR_SR_BV_05_C
This change also cleans up unnecessary initialization and freeing
of multi rsp queue. This change makes sure that the stack initializes
multi rsp queue only when it is necessary(ie only when the Gatt
multiple read response is being processed).
CRs-fixed:
1038422
Change-Id: Ia3e2e1569ee16cac9c518f95501945257b9fb7fd
Srinu Jella [Mon, 10 Nov 2014 13:00:26 +0000 (18:30 +0530)]
Bluetooth: GAP: Allow only one pairing from btif layer at one time
This patch prevents any new pairing request from some other remote
device if pairing has been initiated with a particular remote
device.
CRs-Fixed:
1041642
Change-Id: Id17e3f90904d2c53f1466a72253a25a38d753138
Matadeen Mishra [Thu, 14 Jul 2016 10:34:05 +0000 (16:04 +0530)]
Bluetooth: GAP: Update UUIDs immediately on NVRAM
As the new bt-if config updation have delay in writing items
to the NVRAM, some times there is a chance of not updating
incase of battery removal happens before the actual write onto
NVRAM.
As SDP UUIDs is important data to store, it will update
immediately onto NVRAM.
Change-Id: I6637dc326f3a53211a5bbf988a2dca1020203128
CRs-Fixed:
1041642
Srinu Jella [Mon, 24 Aug 2015 15:30:28 +0000 (21:00 +0530)]
Bluetooth: Read BLE vendor capability to proceed on Secure conn
- Read BLE vendor capability to proceed on enablement of
secure connection support from Host.
- If BLE vendor capability is supported from the controller
then secure connection is enabled from Host.
CRs-Fixed:
1041642
Change-Id: I64e79d4e6fff7d9f1b0ea7272250e8155f5888e2
Ajay Kumar [Wed, 12 Mar 2014 13:59:27 +0000 (19:29 +0530)]
Handled invalid MTU Size in L2cap Process Commands
Use case: Execute the L2cap test suite on Codenomicon tool
(1)From tool Codenomicon Defensics 11 menu Utilities > Bluetooth Scan, paired Bluetooth between pc and phone.
(2)From Defensics 11 Settings ,choose paired phone Bluetooth to be Target Bluetooth device address in Basic configuration.
(3)Run the test case " Security - l2cap ".
(4)When run to the number 28, 29 test case,check the phone.BT turn off and turn on automatcially
Failure: BT crash observed due to invalid MTU packets from test tool
Root cause: L2cap is not validating packets in L2cap Process Commands
Fix: Fixed by sending reject cmd for invalid commands from tool
Change-Id: I8c503ab77d8fca3728a84c3457d8115e31ee3a13
CRs-Fixed:
1041625
Srinu Jella [Mon, 7 Sep 2015 08:10:07 +0000 (13:40 +0530)]
RFCOMM: Add state check to prevent assert
This patch adds state check in bta_jv_rfcomm_write, to prevent sending
data in BTA_JV_ST_NONE state. This would prevent ASSERT in code due to
null handle, as handle might have already been set to null during previous
closing of rfcomm connection.
CRs-Fixed:
1041625
Change-Id: Ibc6b1fb7aa6dce9a4acb52d724af3023fad9a9ae
Gurpreet Ghai [Fri, 24 Jun 2016 13:56:56 +0000 (19:26 +0530)]
Bluetooth: Implement hardware error timer for command timeout case
Root cause: As part of command timeout, ssr cleanup is initiated
and a special buffer is sent from the filter to SOC for intentional
crashing and collection of logs. The time provided before the
killing of stack is not sufficient for the whole dump to be
collected.
Fix: A hardware error timer is created which gets started in the
command timeout case immediately after sending ssr cleanup to the
vendor. The timer will expire after due time to kill the process.
Change-Id: I60cf55c9d4ae4078ee05bca89359de60091b3ba6
CRs-Fixed:
1022533
Nitin Arora [Thu, 14 Jul 2016 01:02:03 +0000 (18:02 -0700)]
Bluetooth: Prevent gatt DB copy if server cache is absent
In case the server cache does not exist for a specific
connection, the API used to copy the server DB into the
DB structure needs to return immediately. This change
makes sure of that and prevents dereferencing of a null
block causing the runtime error.
Change-Id: Iec3040a1280ef9d80b1b9c76eca8071dff499411
CRs-Fixed:
1040951
Umesh Vats [Wed, 13 Jul 2016 17:39:05 +0000 (10:39 -0700)]
Removed compilation dependency on proprietary modules for aptX
This commit takes care of removing compilation dependencies between
platform/system/bt and vendor/qcom/prop../bt/hci_qcomm_init/aptX.
aptX module in the proprietary projects has been removed
Change-Id: Ibab863be20d7792d7eb187cb5c831a7f4972a19b
CRs-Fixed:
1036566
Satish kumar sugasi [Thu, 4 Jun 2015 00:23:40 +0000 (17:23 -0700)]
Bluetooth: Initial commit for BLE Gatt test tool
This file was copied from commit
4e6b49a440aff2e5bd31877b8b0d03cf6485bfa0
in platform/external/bluetooth/bluedroid project
Change-Id: I50007f918f750de7ceb29fcc965458c747b0641c
pramod kotreshappa [Wed, 7 May 2014 04:58:57 +0000 (21:58 -0700)]
Bluetooth: Dynamic ACL buffer allocation based on ACL Priority
1. A2dp acl link priority is set to high once streaming starts
2. Allocation min 2 ACL bufferswq to high priority link
CRs-fixed:
1040557
Change-Id: I8f7742ae193998643ff2a12bf87f9874844ee0f7
Satheesh Kumar Pallemoni [Tue, 28 Jun 2016 11:00:42 +0000 (16:30 +0530)]
Add Remote Device BD address to role switch Blacklist.
When some remote devices acts as a slave role for incoming
connection to DUT, they will not respond to the AVDT signalling
commands properly and go to bad state.In this case role switch
would resolve this issue.
CRs-Fixed:
1035137
Change-Id: Ic1741d96f3409b29ee6ca2280c8ba97e214e9682
Venkata Jagadeesh [Wed, 1 Jun 2016 09:54:58 +0000 (15:24 +0530)]
Bluetooth: Handle auth req in bta_dm_pinname_cback
As auth_req not handled properly in bta_dm_pinname_cback during
rnr,auth_req reset and DUT going for temperory pairing.
Change-Id: I5efa73c3f8079b5198ff672bd1d59a6ec52ec4f3
CRs-fixed:
1031548
Manu Viswanadhan [Wed, 29 Jun 2016 11:32:20 +0000 (17:02 +0530)]
BT: Get chipset type dynamically during stack initialization
Get chipset type dynamically on the basis of qcom.bluetooth.soc
property during stack initialization. This helps in avoiding
compile time board configuration feature flags.
CRs-Fixed:
1035866
Change-Id: I65602b913c052633ec5627598a97ae85a29756f7
Rupesh Tatiya [Wed, 22 Jun 2016 12:49:50 +0000 (18:19 +0530)]
Synchronize vendor callback and cleanup
There is a cleanup API which can free memory for btm_multi_adv_cb while
vendor callback API might be using this memory for processing. Protect
btm_multi_adv_cb resources across these two functions.
CRs-Fixed:
1028704
Change-Id: If2a6a7bd43bbaa629d2b3b3a9e825edcebb6f6fd
Matadeen Mishra [Tue, 18 Aug 2015 08:01:42 +0000 (13:31 +0530)]
Bluedroid: Fixed Static Analysis Issues
- This fix avoids NULL pointer dereferences
and Array Index Out of Bounds Exceptions
in the bluedroid code space of Bluetooth.
Change-Id: I6ad9f4518896975ff186b41086a8987c7de1eb91
CRs-Fixed: 890309
Srinu Jella [Wed, 18 Dec 2013 06:27:33 +0000 (11:57 +0530)]
Bluetooth: GAP: Serialize the commands during Pairing process
Serialize the Remote version, Remote features, Authentication
requested commands.
This will make sure the above commands doesn't go simultaneously
to the remote device which can't handle the multiple comands
at a time.
Change-Id: I4448c291a60ee637dc5927806547e67f26571d86
CRs-Fixed: 896888
Venkata Jagadeesh [Tue, 21 Jun 2016 10:28:29 +0000 (15:58 +0530)]
Bluetooth: SDP: Syncronize sdp callback functions
Syncronize sdp callback functions in sdp server to
avoid race conditions in create/remove sdp records
CRs-Fixed:
1003295
Change-Id: Idb7a3e0a011c8ecd0d127d110e67e6a9a13a8ee9
Hemant Gupta [Fri, 24 Jun 2016 14:25:52 +0000 (19:55 +0530)]
HID: Re-enable sniff with specific parameters to prevent LAGS
Usecase:
1. DUT Connected to BT Headset and MAgic Mouse
2. Make an outgoing call from DUT
3. Perform inquiry on DUT and check mouse movements.
4. Disconnect call from DUT/remote end.
5. Check Mouse Movements
Expected Result:
No lags should be seen with Mouse after call is disconnected.
Observed Results:
Lags are observed with Mouse after Call is disconnected.
Root Cause:
Remote BT Hid Mouse is not able to work with larger sniff parameters
so does not send Input reports leading to lags on DUT.
Fix:
Update sniff parameters to lower values (<15 ms interval) after call is
disconnected so that remote device works fine. Also as part
of SoC workaround, sniff should be disabled with blacklisted devices
only when DUT is slave on SCO link.
CRs-Fixed:
1039149
Change-Id: Ifa01abcae59b6f87842a763330b3a9f23511a675
Satheesh Kumar Pallemoni [Fri, 24 Jun 2016 06:17:35 +0000 (11:47 +0530)]
HF CLIENT: Change to disable sniff with specific Phones.
When device is configured as hf client and connected to
AG, if AG goes into sniff, there may be disconnection
of hf connection with AG.We get information of AG's
manufacturer and model information using AT+CGMI
and AT+CGMM commands. We should disable sniff if AG's
model is known to have issues with sniff.
CRs-Fixed:
1021809
Change-Id: Iedfb8cbec7f716aadc83d511127834043eccfd57
Satheesh Kumar Pallemoni [Fri, 1 Jul 2016 08:50:57 +0000 (14:20 +0530)]
Fixes for Issues reported by Static Analysis tool.
CRs-Fixed:
1036860
Change-Id: I0f4a69cbb4e47ecd333b14c2ff9fe0861166f858
Ajay Kumar [Fri, 6 Nov 2015 07:43:42 +0000 (13:13 +0530)]
Bluetooth: Kill the BT process immediately on detecting SSR
Kill the BT process immediately on detecting SSR
CRs-Fixed: 801039
Change-Id: Id5007914140aa26c08579ca85f7622c79d73a00f
Umesh Vats [Tue, 21 Jun 2016 21:07:49 +0000 (14:07 -0700)]
aptX audio codec support
Support for a proprietary codec(aptX) based bluetooth audio
streaming added.
CRs-Fixed: 962515
Change-Id: I821875227e168f9b74571c0ca814e577873b2f88
Matadeen Mishra [Tue, 7 Jun 2016 12:41:33 +0000 (18:11 +0530)]
BT: Fixed Static Analysis Issues
- This fix avoids NULL pointer dereferences,
Array Index Out of Bounds Exceptions
and Banned funciton in the Fluedroid code
space of Bluetooth.
Change-Id: If389820b427f39e1030013f14d5538d7c99ce9c6
CRs-Fixed:
1025718
Manu Viswanadhan [Wed, 25 May 2016 06:47:20 +0000 (12:17 +0530)]
Bluetooth: Introduced new interface for handling VS implementations
Introduced new interface for handling vendor specific implementations
Created an API in the vendor interface that initiates SSR cleanup
that will be called in the case of enable and disable timeout.
SSR cleanup is called when the Bluetooth shuts down abruptly.
It sends vendor power OFF to the controller so that the next
startup occurs properly.
Created an API in the vendor interface that will be called while
transitioning from TURNING_OFF to BLE_ON, which cleanup the BREDR
profiles (from the btif layer). A callback is initiated from btif
layer which is redirected by the interface to the original implementation
of stopping the BREDR profiles. Also, since the cleanup for BREDR
profiles in the btif layer already happened during transition to
BLE_ON , the cleanup during BLE_TURNING_OFF to OFF is limited to
BLE profiles.
CRs-Fixed:
1027432
Change-Id: I4c0e8468aa71e1eeee7e81b39e71ad9f711c7a3e
Sumit Bajpai [Tue, 14 Jun 2016 09:55:37 +0000 (15:25 +0530)]
Misc AV changes in stack
1) Update UI on remote's browsing support.
2) Avoid sending get capability request if Avrcp TG.
3) Use Interop database for Abs vol.
4) Add 30msec uinput delay upon creation.
5) Role switch failure handling.
6) Misc A2dp/Avrcp handling.
CRs-Fixed:
1029888
Change-Id: I2e86285da9e9a0b7c5180fbefeb7665f62ac77cd
AnubhavGupta [Fri, 3 Jun 2016 08:11:39 +0000 (13:41 +0530)]
AVRCP: Fix array index out of bound KW error.
- fix array index out of bound KW error.
Change-Id: Id6531852141bcf53dc2132aa106a84179ec008e2
Satheesh Kumar Pallemoni [Tue, 7 Jun 2016 10:20:05 +0000 (15:50 +0530)]
Fix issues reported by Static analysis tool
CRs-Fixed:
1025718
Change-Id: Ie1f32028226f4f8e89e545bb75ef1a2a65a3b846
Venkateshwarlu Domakonda [Wed, 1 Jun 2016 13:28:05 +0000 (18:58 +0530)]
Enable Sink with multicast
Enable support for sink with multicast.
Change-Id: Ie9cb33ba102e585387a908fe821f93520ad8a860
Hemant Gupta [Mon, 24 Aug 2015 11:21:38 +0000 (16:51 +0530)]
AVRCP(T): Add support for AVRCP 1.6
This patch adds supports for following AVRCP 1.6 target features:
- Get Total Number of Items
- Cover Art Feature
CRs-Fixed: 715683
AVRCP1.6: Reset Cover Art supported feature bit
Reset Cover Art supported feature bit in SDP record if
fallback to lower version.
Change-Id: I47bdc5dcbc777ba3afb90be1d52b0f6a152dde7b
CRs-Fixed: 956637
Update conf file only if Avrcp 1.5 or 1.6 is enabled
Update conf file only if Avrcp 1.5 or 1.6 is enabled.
CRs-Fixed: 963208
Change-Id: Ib8e81cc57a8060202dbfb2b90b5009f8d504529e
BT-AVRCP: Queue txn labels for same PDU.
If AVRCP CT sends same PDU request multiple times in
quick succession, TG ovewrites the txn label against
that PDU. This causes TG to respond with incorrect
txn labels
Change-Id: I0c9b10f0eb0e7cb695c224d8fe26f5c447ba7d93
CRs-Fixed: 995483
Change-Id: I58ec30ae039f78c59422b5612ebb9ef65a03e2dd
Srinu Jella [Thu, 7 Apr 2016 13:35:44 +0000 (19:05 +0530)]
Cleanup L2CAP socket properly on close
Use case:
1. Sometimes pairing pop up occurs during Android beam
transfer though it is not required.
2. No OPP Tx request over OBEX if we cancel during file transfer.
Steps:
1. Pair and connect from DUT to remote.
2. Go to gallery and send a file.
3. Accept same file and stop it from remote during transfer.
4. Repeat step 2-4 10 times.
Failure:
OPP Tx should not fail.
Root cause:
Close request was not properly handled from BTIF layer.
Fix:
1. Close the request properly from BTIF layer
to close the socket variables and instruct the BTA layer
close from there as well.
2. Clean up L2CAP socket properly on closure to free
the entry registered with security manager to avoid
leak in security manager records.
3. Close the socket for all valid handles including handle 0.
Change-Id: I4e37dcd858af258fbd64fbfb2fbf0083bd743e06
Check ccb state before executing channel state machine events
Use Case: When disconnect response is being executed, timeout
occurs and timeout event gets enqueued in BTU process. When
processing of disc event completes, timout event is received
at csm and is executed. However, by this time the Channel
Control Block is already released during previous event causing
errors.
Steps:
Various connection/disconnection scenario.
Failure: If ccb is already released while processing of
previous event, the occurance of new enqueued event causes
crash.
Root cause: Disconnection response event has already released
ccb and set lcb for this channel to null. The occurance of
timer event after this results in crash because lcb is
dereferenced while header creation to send disc response to
peer device.
Fix: Added check for ccb state for whether it is currently in
use or released before executing events in csm.
Change-Id: I9110e6dd5273fa162b51c8aa15bd0030567d664b
Handle L2CAP disconnection on incomplete connection
- Sometimes before even receiving the connection complete
event from remote device, upper layer might send a
disconnection on incomplete L2CAP connection, and expects
notification of connection failure.
- This chnage notifies disconnection confirmation to upper
layers with error incase L2CAP disconnection is received on
incomplete L2CAP channel.
Change-Id: I4ab675329b3d791a3f68101495a6e6d90b13bde4
L2cap: Handle invalid HCI packets from Test tool
- Handled Buffer over flow for UINT16
- Handled full packet size more than gki buffer case.
- Discard invalid HCI packets from Codenomican test
tool as data length and actual data not matching
during reassembly
Use case: Execute L2CAP test suit from Defensics Codenomican
Steps:
1. Pair and connect DUT to Codenomican tool
2. Execute L2CAP test suit from Defensics Codenomican
Failure: Crash observed on DUT and Codenomican tool stuck in execution.
Root cause: Codenomican tool sending invalid HCI packets to DUT and
there are no checks to handle buffer over flow and other invalid data
from Codenomican tool.
Change-Id: I6f93c80244fc39d607ad285185136bbbca83d7ae
Increasing LE Properties to broadcast.
Use case: Remote BD_NAME is not broadcasted when BLE device
pairing is done by using NFC where we broadcasted only UUID.
steps:
Connect with BLE device by using NFC and check the remote name.
Failure: Remote device name is not available.
Root cause: BD_NAME is not broadcasted when BLE device pairing
is done.
Fix: Added property to broadcast remote BD_NAME also as part
BLE device pairing using NFC.
Change-Id: Ie6cda489aabff15a0ebbc692a16f9428729a7dba
Reset the pairing_cb for BREDR/cross key pairing address
Use case: HID connection stuck during multi pairing.
Steps to reproduce:
precondition:
1 DUT
1 Headset HFP supported -- Pair and Unpair
1 HID mouse -- Pair and Unpair
Steps:
1. Pair and connect HFP remote device HM1700
2. Pair and connect HID remote device Sculpt Touch Mouse
3. Unpair both the remote devices and check them in the available
devices list in settings app.
4. Initiate HFP connection from remote device HM1700 by
resetting the headset.
5. Along with above step, initiate HID connection to the mouse from DUT.
Along with step 5,Power down the HID mouse to avoid another connection.
Failure: At step 5, Observe that HID mouse shows ever connecting state in
the DUT UI.
Root cause: pairing_cb state is reseted for non pairing device and leading
to stuck in pairing to other device.
Fix: Reset the pairing_cb structure for BREDR or cross key pairing address
only. Without this check pairing_cb state can be reset by other non
pairing bd addresses which can lead to stuck in pairing.
Change-Id: I077bebffac9df7a0c7559af58656651467158c14
L2CAP: Allocate sufficient memory for FCS while cloning buffer
Use Case: OPP file transfer using OBEX over L2CAP.
Failure: Crash seen while sending the file using Obex over
L2CAP due to corruption in end canary.
Root Cause: Did not allocate sufficient memory for FCS
while cloning the PDU packet, eventually FCS bytes written
will corrupt the end canary.
Fix: Allocating sufficient memory for the PDU packet which
includes FCS also.
Change-Id: Ie47b9bc07732b02f774d1dce474d488fe063f50b
Don't process pair request when controller is not ready
Use case: when one application is trying to pair and
other application is turning off bluetooth.
Steps: when one application is trying to pair and
other application is turning off bluetooth.
Failure: Bluetooth process crashed.
Root Cause: Bluetooth process crashed due to assertion,
as controller module is not ready.
Fix: Made a checks for controller module is ready or not, If
it is ready then only go for pairing.
Change-Id: I72c72f6b5545c845e79874212359854023ffad98
Add null checks for L2CAP socket callback
Use Case: Bluetooth process crashed while sending the file
to remote device.
Steps: Send a file over L2CAP (OBEX over L2CAP) to remote device
Failure: BT process will crash and restarted automatically
Root Cause: L2CAP socket callback reset to null on error
condition, and when other function try to dereference it, this
leads to BT crash.
Fix: Added null checks for L2CAP socket callback
Change-Id: I2e4f20278fcc8a09bd4dbd507a6c4147e0de93c1
Handled pairing state change in collision scenario
Use case: DUT Stuck in pairing state forever with selfy stick
during repair.
Steps:
1. Pair and connect remote devices with DUT.
2. Now un pair selfy stick from DUT.
3. Keep remote in discoverable mode.
4. Start inquiry and try to pair with device.
Failure: Pairing with selfy stick always fails after collision.
Root Cause: As we return from btm_sec_dd_create_conn with out
moving pairing state in connection collision scenario. Pairing
state will remains idle and pairing won't proceed further.
Fix: Move the pairing state in collision scenario so that pairing
can proceed further.
Change-Id: Ic5c446ad3902b0ce16c7223ec2d8e4a625831446
Conflicts:
stack/l2cap/l2c_fcr.c
Change-Id: Ia83fbcf2477152005dd60cf8344ce1db708b1379
Conflicts:
hci/src/packet_fragmenter.c
Change-Id: I1ebcd267713ee4799cba4f9ab45a2db7300c60da
Ayan Ghosh [Mon, 25 Aug 2014 12:47:48 +0000 (18:17 +0530)]
Bluetooth: Enable A2dp Multicast.
This feature enables the multi
streaming support on BT HOST.
Change-Id: Ic3748c32b30036abd352c9322e30a704b2103fa7
Bluetooth: A2dp MultiCast/ Soft Hands-off.
- Trigger suspend, when new ACL is up during active
multicast
- Initiate suspend on both links when it is initiated by
either connected HS
- Clear remote suspend flag when play is initiated by either
connected HS
- Allocate first free SCB when remote has initiated AVRCP connection
and we are trying to connect to other HS
- Update Encoder when HS2 is connected during
active streaming on HS1
Change-Id: I7ccfb81637688c23c6a2b005f849ac76cc0dbd2a
Bluetooth: Initialize RC handle with proper value.
- Initialize rc_handle with 0xFF
- On disconnect re-set rc_handle to invalid value.
Change-Id: Id507114451701e998f9960aa5dc961ff16f2d1bf
Bluetooth: Do not register for Volume change.
- When absolute volume is not supported by any
of connected HS do not register for volume change
notification on connected HS.
Change-Id: I3b29ac5929989bc7c45b1b0f8cbe75b3082e66d3
Bluetooth: Use SCB handle for Sniff.
- Use scb handle for making entry for sniff instead
of audio count.With Multi A2dp audio count denotes
number of A2dp devices connected.Due to this stale
entries were created for AV power entries, due to
which links did not go to sniff after max entries
in table is reached.
Change-Id: I051017991c7d3d7d42c4822efdad2b2aa1b0e2b2
Bluetooth: Use free SCB for Incoming connections.
- In connection race conditions, check for
first free SCB to allocate for incoming
connection.
- Initiate disconnect for incoming connection when
no free SCB is available.
- Check for max. possible connections before initiating
suspend for new link up-event.
- Clear all flag on AVRCP disconnect.
Change-Id: Ic605b0470ca88aac856cefe54bf6c9ec5320bd5a
A2DP Multicast: Allow outgoing connections for scatternet
- As there is fallback to soft handoff incase of
scatternet scenarios, allow the outgoing
connections in case of role switch failure for
existing slave connection.
- Reject the incoming connection from BTA while
processing another incoming connection.
Change-Id: Ib8a087eea5e9845a6e2ef758757f941c1bdf7b52
A2DP Multicast: Disable multicast if BR HS is connected
- Disable multicast if BR headset is connected
- Use scb index for AV Busy and Idle state updates
Change-Id: If7310be4f47cbe0775eb35c0b81122d524be25f5
Dual A2DP: Avoid blocking Play key event
- Send play key event for PLAY sent from non playing device
to be compliant with default behavior for single connection.
Change-Id: Ie07fc10d3a946ca4e3f9643b2ae5e556358fd0b8
A2DP Multicast: Update multicast state after AV state update
- multicast state update checks the AV state for updating
multicast condition. Need to make sure that AV state
is updated in OPEN state before calling the API.
Change-Id: Ifa0fd1a90ff5d8a05c37dba1590f76176d9899e0
Dual A2DP: Disconnect AVRCP only connection.
- AVRCP only connection should be disconnected to avoid
confusion to end user in the Dual A2DP/Multicast scenarios.
- Proper check for RC connections before closing uinput.
Change-Id: Id515c3f29499a3ada02b8e45cc2189276152a461
Conflicts:
btif/src/btif_av.c
Dual A2DP: Allocate free SCB for incoming connection
- SCB allocated to incoming connection should be idle.
If not, ongoing connection handling will be affected.
Change-Id: Ideaab85b928f08b37c7a284644fd3a62926b15ec
Dual A2DP: Initiate outgoing connection only if the state is Idle
- A2DP connection also could be triggered from remote device
before the AVRCP timer expires. Check the state before initiating
connection for the device.
Change-Id: Id538de6ce829a388a4c052769177319cd5c217fc
Dual A2DP: Don't suspend if stream is started for other device
- Avoid sending suspend for remote initiated START if
stream is started for other device. IOT issues are seen with
specific devices if gap between SUSPEND and START is less.
Change-Id: I64d768aa8246101687bbc98b4ae0be97645bb5b1
A2DP Multicast: Update multicast state during role change
- Role change can be triggered at any point of time
during the connection. Update the multicast state
upon getting role change event.
Change-Id: I60a17e955b6fdc4379d571c59d8527ec023e9531
Revert "Bluetooth: Do not register for Volume change."
This reverts commit
c87e747f40b870b9a540902595524b34a5436b43.
Change-Id: I4752486979366f67e9109bd61df54dc48786f564
Dual A2DP: Set the flush only when there is no play in progress
- When connected to two devices update the flush state only
if there is no play on any connected device.
Change-Id: Ic13b7285625c49350334c35eed878407b6e78821
Dual A2DP: Handle connection inconstencies during stress scenarios
- Avoid removal of connect nodes in profile connect queue
- Dual Handoff flag cleanup during START failure
- Reject the A2DP connection from remote device if it is
initiated on the same endpoint where outgoing connection
is being attempted.
CRs-Fixed: 835641
Change-Id: I4cc0d680e5cabb003dd11c8ba232d1fc70f41780
Dual A2DP: Mark the AVDTP busy during outgoing connection
- AVDTP incoming connection cannot be handled when there is
outgoing connection in progress as per the base design.
Reject the incoming AVDT connection so that other
connection can happen and A2DP connection is always
attempted from connectOtherProfile path.
CRs-Fixed: 839392
Change-Id: Iff801a7e4f170aa85cd06278c7d62dfc81464b5a
Dual A2DP: Acknowledge the SUSPEND after both streams stop
- Avoid on_suspended call when other stream is not yet
suspended as it unblocks the audio process to send
further commands.
- Handle RC close to cleanup the BTIF RC block even if
the current AV connections are for different devices.
This was seen because of not getting AVCT disconnection
response and later this event is received after getting
ACL disconnection complete.
CRs-Fixed: 842690
Change-Id: I7eb95a9ddfc7be06af4521af1567e4e166630317
Dual A2DP: Disconnect the AVRCP only connection
AVRCP only connection has to be disconnected when it is evaluated
for A2DP connection and no free AV blocks are available in BTIF.
Change-Id: I3f6b731ed6701c739defbfd8e011bbb6a1aeb3ba
Conflicts:
btif/src/btif_rc.c
A2DP Multicast: Check for both streams for stream ready
- Stream ready should succeed only after both streams
are suspended during multicast, otherwise audio data
coming will trigger inconsistent behavior for stream
starting.
Change-Id: Ia8794dbed7dbe5f55cf7139b200fcdf2eb5ee45f
A2DP Multicast: Handle suspend for both streams
In race conditions, it is seen that ACL is established while
stream is being started for both devices for multicast.
Since the multicast state is updated after stream start when
suspend is initiated we need to check if both streams are
started and suspend them accordingly.
Change-Id: I23f64174914350b476022f7bfbfb553a55d12902
Dual A2DP: Clear the RC priority information while disconnect
RC priority information has to be cleared during disconnection
to avoid improper usage during start even after initiating
disconnection.
Change-Id: Ia52c04ea2bfecbf390aae12400073adb0f327718
Dual A2DP: Interface to query active device for handoff
During Handoff case, check the playing device and device to
start playback to provide state for given device.
CRs-Fixed: 856063
Change-Id: I3a326d9f0c6221cfc4cdcc3fad037f22a29ff90e
Dual A2DP: Connection failure handling for proper cleanup
- Cleanup BTA AV block for the outgoing connection if
it fails because of no resources
- Reject the incoming connection if there is outgoing
connection in progress
Change-Id: I44d3dd6bbff93d38c1c22260056897e42d915ffa
Conflicts:
stack/avdt/avdt_msg.c
Change-Id: Ie74102d0254fa73061b6baea9811d834fae64358
Nitin Arora [Wed, 6 Apr 2016 00:10:37 +0000 (17:10 -0700)]
Bluetooth: Add Dialog mouse & KB to blacklist for LE secure connections
This change allows the host to mask the Cross key bit in
the key distribution fields of the pairing request and
response while pairing with the Dialog keyboard and mouse
to prevent the remote from rejecting the DUT's pairing request.
CRs-Fixed:
1033619
Change-Id: I888b5ce8c12652ef5c393b304bed8948c4e6b444
Ayan Ghosh [Fri, 25 Jul 2014 12:21:32 +0000 (17:51 +0530)]
AVRCP 1.5 Implementation
AVRCP 1.5 Implementation
Change-Id: Ia35dc4344b05584cf5ab3b463815c9e6297d24ab
Proper check to ensure attributes are populated properly
Incorporated proper check to ensure if memory is allocated properly
then all requested attributes are populated in response from DUT
CRs-Fixed: 753309
Change-Id: Iead549635cd2059bc8cf33585a5d87ae023149d4
Reset Browsing Bit if carkit is blacklisted
- Reset Browsing bit if carkit is blacklisted for avrcp 1.5.
- Not to send 1.3+ specific supported events if carkit is blacklisted.
CRs-Fixed: 762470
Change-Id: I32ac80c0549b2b89dd2522dbb0dea89d255d33dc
Free Browse packet
Free Borwse packet in AVRC layer once the same is
copied to BTA for further processing.
CRs-Fixed: 785286
Change-Id: I8037a649cff5a1e527c28ba36999a1bed34d315a
BTIF-AV: Use valid memory for AVRCP message
After the context switch to BTIF for META message processing
the buffer allocated for tAVRC_MSG will be freed, hence allocate
the required memory and free that after handling the META
message
Crs-Fixed: 651506
Bluetooth: Change cleanup sequence.
- Clear btif_rc_cb before setting callback to null.
- do not initiate callback if rc address is null.
Change-Id: Ief15f21e40a36cf894b7c2e14e3236fc3ecf7701
Dynamic AVRC version change based on Remote's capability
- Update DUT's adevertised AVRCP version as 1.4 or more if remote
is capable of Avrcp File browsing with feature supported as 1.4 or more.
- For other remote DUT always displays Avrcp version as 1.3.
- For browsing capable remote, browsing feature works when remote does
SDP after repair.
Change-Id: I00679397559cfb3b9efffeb92fc6b2755b851fea
Remove redundant entries from Browse structure
Remove redundant entries from Browse structure
Change-Id: Iff961f91693a2c7a32e9a22273c5e3c2b7ba4b96
Avrcp: Do not initialize transactions if cleanup done already.
In case of BT turn off, if avrcp cleanup happens earlier than
rc disconnection, then initialize_transaction gets blocked on
locking mutex which got destroyed during cleanup. Do not initialise
transaction and close uinput if done already during cleanup
Change-Id: Ib3fd61275bc918872a80a70b3d7ba66309b23ab6
BT-AVRCP: Cache set_addressed_player request while in active call.
When set addressed player is requested by avrcp controller while
in ongoing call, we fail to cache the request. Because of this
we do not send reject response to set addressed player request.
The change properly caches request and send reject response
Change-Id: I4cb02c8cb78c26fcbe22dda57cf9009e4b20be96
CRs-Fixed: 988856
Avoid updating conf file if Avrcp 1.5 is not enabled.
Avoid updating conf file if Avrcp 1.5 is not enabled.
Change-Id: I9088d0804f69a8a0a2369e97f07ce74bf750f966
Change-Id: Icbf61776a6fb63fac1555bf25d3700beccf2b67a
AnubhavGupta [Thu, 28 Apr 2016 06:24:30 +0000 (11:54 +0530)]
A2DP Sink: Changes to support A2DP Sink in N MCL
- changes to enable A2DP Sink in N MCL.
Change-Id: I281f435ce5c55a2e2440f124e034cf478e7624e7
Satheesh Kumar Pallemoni [Tue, 10 May 2016 12:00:06 +0000 (17:30 +0530)]
Bluetooth: IOP: Allow more time for AG connection to go through
Fix inter-operability issue by increasing connection timeout for
AG profile
Change-Id: I565d72fa23012c683f83a025b41c20e236864dc7
Hemant Gupta [Tue, 7 Jun 2016 09:22:11 +0000 (14:52 +0530)]
HID: Fix following IOT issues
- Add HID keyboard to sniff blacklist, to disable sniff when SCO
is active and re-enable sniff when SCO is disconnected.
- Add Game Controller to sdp blacklist.
CRs-Fixed:
1025271
Change-Id: Idab33ca9326c7e0724113cb8db29691b2a65ea12
Hemant Gupta [Tue, 18 Aug 2015 10:52:06 +0000 (16:22 +0530)]
HID: Disable sniff for some particluar remote devices
This patch disables sniff on hid link for certain remote devices in
presence of SCO/esCO to prevent IOT issues of ACL disconnection on
HID link.
CRs-Fixed: 892083
Change-Id: Ia9fe1d8f5578b55c0e708e8791c5c37c3dbc48ff
Hemant Gupta [Mon, 4 Apr 2016 06:56:41 +0000 (12:26 +0530)]
HID: Fix IOT issue with Motorolla KZ499 Keyboard
Fix IOT issue with Motorolla KZ500 Keyboard, which claims
support for multiouch functionality in SDP repord descriptor, but this
functionality doesn't work because of issues in usb hid kernel driver.
To handle this keyboard, digitizer record in report descriptor is removed
and the remaining descriptor is passed to kernel usb hid driver during
connection, which interprets the keyboard as generic keyboard instead of
multitouch keyboard and normal functioning of keyboard works fine thereafter.
Change-Id: I888b4a8997296ebbf3d9d23dd1c52ade230f984e
CRs-Fixed: 776647
Hemant Gupta [Sun, 26 Apr 2015 05:02:57 +0000 (10:32 +0530)]
HID: Enhance blacklist logic for restricting SDP
Enhance existing blacklist logic for restricting SDP
for HID devices, by adding BD address and name support in addition
to manufacturer id. Also blacklist logic is added for HID devices not
supporting authentication.
- Targus mouse does not support authentication, so blacklist logic
added to disable authentication for such HID devices.
- Many HID mice return an out of resource error for incoming connections
when more than 1 SDP connection is made to them. Current implementaion
in BD stack performs SDP from 2 layers HID BTA layer to determine HID
desritors for HID device and btif layer for determining uuid's supported.
Blacklist logic is enhanced for such devices to not perform SDP from btif
layer after authentication and directly inform upper layers that SDP is
complete by adding support for BD address and name based addition to
blacklist.
Change-Id: I4fe1e016549bb55ad176cd014bf1d5da85b38353
CRs-Fixed: 465421, 568114
Matadeen Mishra [Thu, 30 Jun 2016 09:21:31 +0000 (14:51 +0530)]
Bluetooth: Fix to decrease power during OPP TX/RX
Refactor the original Fix.
Used 1000 milli second instead of 1 second, as API
changed to millisecond.
Change-Id: I0ecac707751f990eeabc63e56ad79e54b06e7a73
CRs-Fixed:
1036350
Balraj Selvaraj [Wed, 21 Oct 2015 14:14:04 +0000 (19:44 +0530)]
Bluetooth: Gap: Adding NULL check in HAL interface
When the HCI_RAW_CMD support is included, adding
NULL check for bt_hal_cbacks and hci_event_recv_cb
in btif_hci_event_cback to avoid ASSERT message
continuosly which is consuming more power.
CRs-Fixed: 922611
Change-Id: I995e6411012fe515ca725267045a97076b692b7d
Gurpreet Ghai [Tue, 8 Mar 2016 18:09:55 +0000 (23:39 +0530)]
BT: ACL and l2c out if sync after connection collision
Problem: Remote device can't be removed from paired list.
Cause: After connection collision, lcb is removed after
connection request is rejected by soc but acl entry is not
removed. So, for upper layer, acl connection always remains
up.
Fix: Removed acl connection and acl entry when connection
complete is received and lcb is not present.
CRs-Fixed: 987968
Change-Id: Ie2049217e436704262f06d0c0dc51611697cc29a
venkata Jagadeesh [Mon, 16 Nov 2015 09:22:02 +0000 (14:52 +0530)]
Bluetooth: GAP: Accept incoming connection in slave role
Accept incoming connection in slave role for blacklisted remotes
Change-Id: I7acda5f794fa53dd270b31c048f5e85a0ed7ce94
CRs-Fixed: 943689
venkata Jagadeesh [Tue, 16 Jun 2015 09:59:04 +0000 (15:29 +0530)]
SDP: Restricted invalid attr len in sdp delete
Restricted invalid attr len in SDP_DeleteAttribute as
pointer is trying to access invalid memory when attr_len
is invalid
Registering PNP record before PAN profile as PNP record
should be registered before profiles.In some cases PAN and
PNP SDP registration colliding and leading to memory
corruption in SDP DB.
Change-Id: Ib6d2120c7ef1d10633fa905d6b853281efaf0ecd
Bluetooth: Cleanup ACL link during restarting pending ACL connection
This fix removes the previously held ACL link with the BR_EDR
device before trying to create a new pending connection with the
same device.
Change-Id: Iac941794e2fc86c48781edc86492146ab5c21eae
Bluetooth: Cleanup the lcb variables properly on reuse
- Cleanup all relevant link control block variables
like send_not_acked, partial_segment_being_sent
and stop the info response timer to reuse the same
LCB.
- L2cap layer will reuse the same lcb if the link is
disconnected and wants to re-establish the link.
Change-Id: I822b0ee350574bbeb5b3c86a349d1471fa45761a
Change-Id: I15f83b5c1a88d248d29080123ebbf4652f2cb340
CRs-Fixed: 885782
venkata Jagadeesh [Tue, 27 Oct 2015 11:46:18 +0000 (17:16 +0530)]
Bluetooth: Dont initiate rnr from pinreq if rnr in progress
Dont initiate rnr from pinreq if rnr from security module is
in progress
Change-Id: I129044dca030bcf28495c30f4536bda5936e79a2
CRs-Fixed: 944764
Nitin Arora [Mon, 25 Apr 2016 22:11:35 +0000 (15:11 -0700)]
Bluetooth: Use correct transport to check ACL connection
This change corrects the transport type used to verify if
the ACL connection for LE exists for a specific bda during
the cancel connection routine. This cancel connection routine
is triggered by advertiser connection complete, if the connection
to the same remote is pending as a scanner as well.
The process above leads to connection cancel and releasing the
link blocks. The correct check used in this change prevents the
release of link block due to the connection cancel.
Also, safety check has been added to the LE notification
routine to prevent the use of link blocks if it does not exist
CRs-Fixed:
1033641
Change-Id: If2f923e6a39974f01c62f1cbdbca6372a3082821
Nitin Arora [Wed, 13 Apr 2016 00:09:37 +0000 (17:09 -0700)]
Revert "Fix bug where a bonded device could enter BONDING and BONDED states again."
This reverts commit
0b7fc589089ce4a96daa668b9d293ce01982424d.
Conflicts:
btif/src/btif_dm.c
CRs-Fixed:
1033628
Change-Id: I1b7ccf0ff4eaebe1c947ee81e50e4587a1bdbb47
Nitin Arora [Thu, 16 Jun 2016 22:27:59 +0000 (15:27 -0700)]
Bluetooth: Prevent multiple register of service change indication
Use Case:
Pair DUT to a remote LE device. The host registers for the service
change indication twice, once when the connection callback is
received and another time, when the SMP process completes
Failure:
There are a few issues caused by this.
First, the duplicate action of service change indication registeration
is unnecessary.
The registeration that follows the SMP process adds a gatt_if to the
apps holding the current link. This gatt_if (=1) never disconnects
after registeration failure or success. And hence the host can never
physically disconnect the link.
Fix:
This change removes the service change registeration at SMP
process completion
CRs-Fixed:
1033611
Change-Id: I0d7566e2b4a9d01aa7926cdbe9f528c3941fcfeb
Manu Viswanadhan [Tue, 25 Jun 2013 11:04:00 +0000 (16:34 +0530)]
Bluetooth: Do not go for inquiry in BONDING State
This patch fix a special case where DUT is paired & connected
with only one device, which has capbility to intiate paring as
soon as DUT unpair same remote device. As DUT is paired with
only one device, In this case Once DUT unpair remote device. DUT
goes for inquiry & at same time remote device initiates pairing
if Bludroid stack recieve pairing request before the inquiry
start then DUT should not go for inquiry, As DUT is already in
BONDING state.
CRs-Fixed: 481263
Change-Id: I0e1ec0fdb963921629e5c52f495ae2013e679a03
SDP: Fix for SDP query in certification test with Invalid PduSize
Bluedroid stack is only checking parameter length and input data length.
Added an extra logic to handle invalid data after getting last valid data.
Change-Id: I47eafb2c24e73b472c31a2fb47e02d48c5e04f6c
CRs-Fixed: 491693
Bluetooth: GAP: Update name as part of Discovery of services
Update the remote device name to upper layers as part of
discovery of remote device services.
CRs-Fixed: 593306
Change-Id: I24d899c1f5ccc81d8b0c4257abae16a7bf5d4682
Bluetooth: Handled delayed info rsp from remote during SDP
DUT initiates connection with out waiting for information response
from remote device during SDP.
Change-Id: Iee0251f8f81923b1291983b66b31c78e14d21af0
CRs-Fixed: 635697
Bluetooth: GAP: Changing the security to general bonding
Changing the security from non bonding to general bonding
in BTM_SEC_OUT_AUTHENTICATE condition.
Change-Id: I65d2ec4466e2bd81df2cc7e2936e05159a8645ed
CRs-Fixed: 676532
Bluetooth: Store local and remote io caps before RNR
Stores the loc_io_caps nad rmt_io_caps when the remote
name request is called, and these will be retrieved
in the function bta_dm_pinname_cback.
CRs-fixed: 535245
Change-Id: I4b2156d7101acabb1ded65bd21d49a9c4551f8db
Bluetooth: GAP: Handle security failure with invalid handle
Return NULL incase of invalid handle when finding a device
based on the handle. This will make sure to avoid giving
a invalid entry from the device list.
Also send authentication failure in case of invalid handle.
Change-Id: Ia95d10ae95cfa1750386233ee90f01899061294e
CRs-Fixed: 592545
Change-Id: I71b902ae201e32a0fb18fd3bce52fd86e8cbcdd5
CRs-Fixed: 902577
Satheesh Kumar Pallemoni [Mon, 20 Jun 2016 11:26:04 +0000 (16:56 +0530)]
Fix for Compilation Issue
We build our system/bt code by setting BLUETOOTH_QTI_SW macro always to TRUE.
But Customer wants to build by setting BLUETOOTH_QTI_SW macro to FALSE,
Which leads to compilation Issue.When SCO open was initiated by AG
and failed for mSBC,then Fallback to CVSD settings which has not done in
else condition.
So, we should add falling back to CVSD in else condition.
CRs-Fixed:
1031600
Change-Id: I7ed33cc20374dd899b21e3fa12abe622ddc84eff
Satheesh Kumar Pallemoni [Tue, 14 Jun 2016 12:51:33 +0000 (18:21 +0530)]
Fixes for Static analysis tool reported.
CRs-Fixed:
1028649
Change-Id: If86dc1766f225a097e4dcdcb68bf6ea6bec50a2a
Nitin Arora [Thu, 23 Jun 2016 01:04:08 +0000 (18:04 -0700)]
Bluetooth: Modify logic to ignore HID notifications
This change reverts the previous logic and delays the
ignoring of indications for HID devices, after the processing
of service change indications.
This is needed for keeping the update count equal to the
number of apps registered, so that service change indications
can be properly confirmed and followed by remote service
discovery.
This reverts commit
a85bd580013944b321d88c3c5515a015c9f67f72.
CRs-Fixed: 982471
Change-Id: Iabba84aac1af6847bb44fd2169bd0870d8d14a55
Matadeen Mishra [Sat, 6 Feb 2016 12:07:38 +0000 (17:37 +0530)]
Bluetooth: Increased the command buffer length to 128.
Increased the command buffer length to 128.
In align with the incoming buffer size.
Change-Id: I2dba02a4c5b40925b4d9ddcd2babd432859e93b6
CRs-Fixed: 973303
Satheesh Kumar Pallemoni [Tue, 21 Jun 2016 04:57:13 +0000 (10:27 +0530)]
AG: Accept '-' character in dial number string.
Some Headsets storing Number from CLCC response and sending
ATD<number with special Char '-'> for redial.We do not accept
special char '-' in number string and sending Error reponse.
We should add check for accept this special char '-' in
string for redial.
CRs-Fixed:
1031997
Change-Id: I7dfc6c98fdd902361e40752b10d0c41d7ca8fe7b
Gurpreet Ghai [Thu, 9 Jun 2016 09:06:35 +0000 (14:36 +0530)]
BT: Rectify size passed to copy service name to secu records
Use case: Services having name length greater than max lenght
always take new slot in security records. So, after few enable
disable cycles in BLE ON scenario, the record gets completely
occupied making further connection impossible.
Steps:
1. Install a BLE App to create BLE always ON scenario.
2. Run a few cycles of Bluetooth(bredr) enable-disable.
Failure: Once security records are completely occupied, new
connections are not possible because of socket creation
failure due to unavailability of security id.
Root cause: Size passed to copy service name does not include
bit for null termination. So, for services having name size
greater than that size have their last bit truncated for null
termication. So, during next enable, the comparision with
same size always fails causing service to take new slot in
security records array.
Fix: Increased the size passed to copy service name by 1 after
considering null termination.
Change-Id: I3527df6610932f60fd85bcdd14d5b8a527c79722
CRs-Fixed:
1026359
Venkata Ramana Rao K [Tue, 21 Jun 2016 12:27:31 +0000 (17:57 +0530)]
Bluetooth: GAP: Reject incoming pairing if already in progress
- This patch properly rejects incoming pairing request from remote device
if already in pairing state. Without this patch it was observed that in
some corner cases pairing was auto accepted for remote device while
pairing was in progress with another remote device leading to inconsistent
behaviour.
Change-Id: I19a2a98e4ceb51cabaef279a2e3f8224fbed9ea1
CRs-Fixed:
1032165
Nitin Shivpure [Wed, 16 Dec 2015 11:17:42 +0000 (16:47 +0530)]
Bluetooth: Fix to decrease power during OPP TX/RX
Due to alarm timer implementation, bta_sys_idle OR bta_sys_busy call
was the overhead(eg. 7ms) on every OPP packet(TX/RX), which was causing
high power. Below optimization have been done in JV to decrease
power during OPP TX/RX
- If particular JV acl link is in sniff, only then use bta_sys_busy to
trigger unsniff request.
- Start intermediate idle timer(1s) before starting actual idle sniff
timer(bta_sys_idle).
CRs-fixed:
1028625
Change-Id: Ied1173776f9bf2dc89b8e84e68d6217932a01607
Gurpreet Ghai [Wed, 10 Feb 2016 14:51:39 +0000 (20:21 +0530)]
BT: Checking for stack status before removing sdp
Based on appliaction implementation, this api
can be called during undesirable state like
when stack is being cleared. This causes ANR
and tombstone in Bluetooth.
Checked for status of stack and returned without
processing if stack is already cleared.
Change-Id: Ib5447402f9c28e010a74700927be54db44f9ca65
CRs-Fixed: 975088
Venkata Ramana Rao [Wed, 15 Jun 2016 09:57:12 +0000 (15:27 +0530)]
Use Local ccb variable in loop to check GAP CCB pool
File Receiving fails on DUT after 3 file transfers using OOL from DUT.
steps:
Transfer the files between two devices which supports OOL after pairing.
After 3 files transfer from DUT, send a file from remote to DUT.
File transfer fails.
Failure: File transfer from remote to DUT fails always after 3 opp
client connections
Root cause: File transfer is failing always because no RCB's available.
RCB's were not cleaned up after use.
FIX: RCB's were not cleaned up because there is an extra check has been
added with transpo for the CCB.And wrong CCB is passed to check transport
to clean up.Using another local variable for the p_ccb will solve the issue.
Change-Id: I06a8f237047ffb212118b4239e9856fe5c89acb1
Hemant Gupta [Fri, 3 Jun 2016 12:31:44 +0000 (18:01 +0530)]
HID:PAN: Fix issues reported by Static Analysis Tool
Fix issues reported by Static Analysis Tool.
CRs-Fixed:
1025718
Change-Id: Ie0347307d7536f18bf8f32a2dfeda593a41933bf
Subramanian Srinivasan [Tue, 14 Jun 2016 01:15:31 +0000 (18:15 -0700)]
Delete GATT cache file from NVRAM when device is unpaired
GATT cache file is created for each remote device when
service discovery is performed. This file is not removed
when a device is unpaired. Hence even after performing a
fresh pairing, the subsequent service discoveries end up
retrieving the attribute list from the GATT cache instead
of fetching the results over the air.
The service discoveries for non paired devices also are
not performed over the air for the reconnection attempts.
This change deletes the GATT cache NVRAM file when a device
is unpaired and also resets the GATT cache structures
during disconnection of non paired devices.
Change-Id: I35ec4d0a53820c671fe94cb83927548b9be53d28
Dibyendu Roy [Wed, 25 May 2016 09:24:43 +0000 (14:54 +0530)]
Bluetooth: Select bluetooth transport dynamically
Select bluetooth transport dynamically on the basis of
qcom.bluetooth.soc property. This patch removes the use of board
configuration option QCOM_BT_USE_SMD_TTY and uses dynamically
detected SOC type to choose required transport.
Change-Id: Iae1ee900362af95c42bffcc444b56267cbbae92d
Dibyendu Roy [Mon, 9 May 2016 09:24:25 +0000 (14:54 +0530)]
Bluetooth: Select bluetooth HCI driver dynamically
Select bluetooth HCI driver dynamically on the basis of
qcom.bluetooth.soc property. This patch removes the use of board
configuration option BLUETOOTH_HCI_USE_MCT and uses dynamically
detected SOC type to choose required HCI driver.
Change-Id: Idecb2fd74fbc9d361c2877e9b3a47606667e0229
Matadeen Mishra [Thu, 12 May 2016 04:16:09 +0000 (21:16 -0700)]
Revert "Revert "Initial commit for rfcomm test tool""
Added strict_mode boolean parameter in enable function.
This reverts commit
007093f5aded6eb02501602996e2f2883b3923c7
Change-Id: I37a282e80fa6e884fbdf51de283d3e9c2761a7c4
CRs-Fixed:
1014526
Matadeen Mishra [Fri, 14 Nov 2014 14:16:19 +0000 (19:46 +0530)]
Btsnoop write from external process
- Write btsnoop from external process
Introduced a new proces to dump snoop packets into file.
Snoop packet can be send to the remote process using local
socket as writing to file from BT process can cause A2DP
choppyness.
- Avoid btsnoop file write if btsnoop client is connected
Existing implementation writes it to file though the packet is
sent over network socket. This chnage will make sure to avoid
writing it to file if any of the network/local socket is
connected.
- Generalized the mechanism to use same code irrespective of
what type of socket it is. Otherwise having thread for each
socket is not preferrable.
- Adjust the GMT offset to match with logcat logs.
- Limit the block of snoop write to 10ms and drop the packet.
- Memcpy issue single write to eliminate multiple I/O.
- Enable snoop by default on userdebug build.
- Option to override snoop config for userdebug build.
Change-Id: I13749dc348baf88af57e3ebec1ec7acd5e999c04
Hemant Gupta [Thu, 3 Sep 2015 09:19:18 +0000 (14:49 +0530)]
HID: Add support for set report and get report
Add support for set report and get report in HID user
space because of changes in uhid kernel driver with kernel changes
for kernel 3.18. Without these changes issues are seen with hid devices
that uses vendor usb hid drivers and send specific set and get report
to hid devices for their proper functioning.
Following are the new flags added in uhid driver of kernel, for which
support is required in hid user space.
UHID_GET_REPORT
UHID_GET_REPORT_REPLY
UHID_SET_REPORT
UHID_SET_REPORT_REPLY
Also update __FUNCTION__ to __func__ in API's where changes are made.
Change-Id: I90230b76d68e9275dcacd9f46f03e312ddf2fa30
CRs-Fixed: 963213
Srinu Jella [Tue, 15 Dec 2015 14:22:32 +0000 (19:52 +0530)]
Bluetooth: Disable eager reader threads in RX path
- Disabled eager reader threads in RX path for both
ROME and PRONTO targets.
- Exising machamisn is to poll for incoming data
(event, ACL data) using dedicated thread called
eager reader thread.
- Now the responsibility of polling for data moved
to existing HCI worker thread.
- Enhanced the read mechanism from hci hal interface.
CRsFixed: 934414
Change-Id: Icfd27b7b93f83033b2230e61a23df69aa3c33bdf
Bluetooth: Optimize the L2cap FCR tx timer
- Optimize the L2cap Flow control tx timer
to avoid frequent start and stop of same
timer.
- it will restart the timer instead of stop
and start.
- Changes made in btm timer functions also
to avoid scheduling of next timer in queue
though is not required as the same timer
is supposed to start.
CRsFixed: 934414
Change-Id: Idd43a71617a27c6d70fafa4e31c16f735a1a9425
Bluetooth: Handle the SSR timeout case properly
- Kill the bluetooth process in case of SSR timeout,
otherwise it will try to read the invalid data
that might lead to crash.
- Also corrected the data type to check when error
occurs on read call.
CRs-Fixed: 978009
Change-Id: I42f6c9f4a437f7b143fe1e1beb3b6ef39533f4d7