OSDN Git Service
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
Bandari Ramesh [Tue, 7 Jun 2016 13:46:52 +0000 (19:16 +0530)]
Bluetooth: Separated initialize and re-initialize of bta_dm_cb control block
-Added bta_dm_deinit_cb function to re-initialize of
bta_dm_cb control block
-Modified the condition to set disable timer in case of any active
ACL connections
Change-Id: I872944c39912bc8a534eba080a0ade7ced942bec
CRs-Fixed:
1025769
Venkateshwarlu Domakonda [Tue, 12 Jan 2016 07:04:45 +0000 (12:34 +0530)]
Set DUT role as slave for outgoing connection
Do not send role switch while accepting incoming connection
for Roman R9020 which delays responding to AVDTP_DISCOVER
and AVDTP_OPEN when in Slave role.
Change-Id: I1ba5bc0f1f88fe8ef7f4c186fbdfacd6726d3720
Manu Viswanadhan [Fri, 29 Jan 2016 06:37:19 +0000 (12:07 +0530)]
Add debug log to track Negative reply
- Added logs to provide the negative reply
information of
- Pin code reply
- Link key reply
- Pass key reply
- IO capability reply.
Change-Id: I7a25a53bf2dd7b69ecd9d0b30d49a163af731ee1
CRs-Fixed: 970954
rakesh reddy [Thu, 14 Aug 2014 06:28:45 +0000 (11:58 +0530)]
BT: Audio: Enhance default stack logging for AUDIO
Make default logging for upstream events,
statemachine state transitions, sco state
transitions, call state transitions etc.
Change-Id: Ia0dcb22e2efb99f186166ae4af2a8cb73f87616d
Bluetooth: A2DP Sink Logging.
- logs for state transition.
- Latency logs with sequence Number.
Change-Id: Iedabccd97d1118406f43b7ba494bdec5935b60b9
Print delay logs during A2dp streaming
- Log systrace during A2dp streaming. This logging is not
enabled by default.BT_AUDIO_SYSTRACE_LOG needs to be defined in
applicable files to turn this logging on.
- Properly name threads.
- Log A2dp write delays.
- Log pcm dump before writing to media socket to mediatask.
This logging is not enabled by default. BT_AUDIO_SAMPLE_LOG needs
to be dfined to enable this logging
Change-Id: If081480b29f02126a1d48b9d0d9f855a3a605cc5
Enable required AVRCP Logging by default
Enable required AVRCP Logging by default.
Introduce additional logging whereever required.
Change-Id: Ie2e88de06254257af3b77b4f8b06401273f29262
Arusha Goyal [Wed, 1 Jun 2016 06:21:48 +0000 (23:21 -0700)]
Revert "Bluetooth: Proper gatt disconnection after ccc process"
This reverts commit
73d92fd3a7a40536add8d25f30a9c4eb8a6948b8
Change-Id: I38a8e8f8a96eb5e68598126117607543f181b29e
Ayan Ghosh [Thu, 5 Nov 2015 13:25:26 +0000 (18:55 +0530)]
A2dp logging enhancement for media task
Enabling important mediatask logs to be printed
with TRC level set to default.
Change-Id: I4bf1eb2f130b136cc1b3987ba2c042a4bc268020
Conflicts:
btif/src/btif_media_task.c
Change-Id: I68b34253821a5a5f6ff9a87b6353e6bbbbfe718d
Ayan Ghosh [Fri, 6 Dec 2013 11:41:11 +0000 (17:11 +0530)]
Restart sniff timer on AVDTP signalling channel establishment
VolksWagan UHV Preminum takes time to initiate AVDTP media channel
after AVDTP signalling channel is up. If mentioned duration exceeds
7 seconds then ACL link goes into sniff due to which A2dp Connection
fails.
With this change we make sure that when AVDTP signalling channel
is up and media channel is not connected we do not go to sniff,
which is achieved by restarting sniff timer on signalling channel up
so that link does not go to sniff in between ongoing connection.
Change-Id: Ic3f268703067155ffd55a43f320ce199641c6b3f
Sai Aitharaju [Fri, 19 Jun 2015 03:44:00 +0000 (09:14 +0530)]
QLogKit: Enable FW Logging and Set Stack Trace Level
- Enables FW Logging during BT On and disables
the FW Logging during BT Off in userdebug
builds only.
- Provides an interface to set trace level for
all the stack layers of bluedroid.
CRs-Fixed: 866285
Change-Id: Ib12d220e0aa4845d04b05b7fbea079d30c308004
Bluetooth: Disable SOC logging for ROME targets
Disable SOC logging for ROME targets
Change-Id: Ifbb99900d8596932e514582619aaf775dacd3c33
Srinu Jella [Fri, 6 Dec 2013 09:55:26 +0000 (15:25 +0530)]
Bluetooth: Add support to send/receive raw command/event
Bluetooth: Add support to send/receive raw command/event
Support added to send/Receive raw command/event.
Change-Id: I194e9ceed29d60de492427784ae340691e4254e7
CRsFixed: 598650
Bluetooth: Support to send HCI raw command to stack.
Provide an interface in stack to send
HCI raw commands to stack.
Change-Id: Id70d419c19a2b983450ebc113b8d0cca2b36ecf9
CRs-fixed: 751111
Nitin Arora [Fri, 6 May 2016 22:26:13 +0000 (15:26 -0700)]
Bluetooth: Proper gatt disconnection after ccc process
This change allows for an operation complete of the client
configuration registeration process.
In the current code, the successful completion of the
process where host writes the client configuration
descriptor of the service changed characteristic of the
remote device, the connection id (1) is never disconnected.
Hence, for those remote devices with the service changed
characteristic that allows Indications, there will always
be a remaining connection which will prevent disconnection
of the remote device.
This change fixes that issue and also the issue related
to early notifications/registerations causing disconnects
of HOGP devices
CRs-Fixed:
1014919
Change-Id: I04273f6a1ab5e2d74f49687c9a70670e40db9d39
Ashwini Munigala [Tue, 10 May 2016 10:56:38 +0000 (16:26 +0530)]
DUN: Squashed commit of the following:
commit
fc3b33bbee0f9e0ae62dc922baae5fd5e8c9e307
Author: Nitin Shivpure <nshivpur@codeaurora.org>
Date: Tue Dec 8 18:38:20 2015 +0530
Dun: Don't add Obex protocol descriptor in SDP
Don't add Obex protocol descriptor in DUN SDP record.
CRs-fixed: 949818
Change-Id: Id108722eafdf146228636412d087220da24af91c
commit
5f726cef997ee8400e0761f60e6a72f74f999ad6
Author: Srinu Jella <sjella@codeaurora.org>
Date: Mon Oct 21 11:19:44 2013 +0530
DUN: Add DUN SDP record to the Bluedroid stack.
Add DUN server SDP record in Bluedroid stack.
CRs-Fixed: 557180
Change-Id: I432496079ae0d7325805b1b1cf684629bbf51035
Change-Id: I21ca2b1396de77611b55e34ce3d875b960f9b6d7
Satheesh Kumar Pallemoni [Mon, 9 May 2016 12:43:05 +0000 (18:13 +0530)]
Fix for issues reported by Static analysis tool.
Fixed issues in reported by static analysis tool.
Change-Id: I5a3ca9070ef21d2d86060b25f4282acf113a0987
Srinu Jella [Mon, 21 Oct 2013 06:11:15 +0000 (11:41 +0530)]
Socket: Add Get/Set socket option to the Rfcomm socket.(2/4)
Introduced Get/Set socket option support to the Rfcomm socket.
Currently Rfcomm socket supports get/set modem bits socket
options.For other sockets it will return error.
CRs-Fixed: 557180
Change-Id: Ia1779293b643c22d3f754c7f405646d42eb94963
Satish kumar sugasi [Thu, 17 Dec 2015 20:26:03 +0000 (12:26 -0800)]
Add support for FM vendor operations such as ON/OFF
This adds FM ON/OFF and HCI init operations
Change-Id: I476a8017343f9bc8dd8f30cc5ce14c8d05515caf
Matadeen Mishra [Fri, 29 Apr 2016 15:15:34 +0000 (20:45 +0530)]
Bluetooth: GAP: Don't update short name if the device paired
Don't notify the BT APP about the shortened device name which
will be part of EIR response,incase of device is already
paired.
Incase if the alias name present for that device, it
will notify th BT APP alias name as the actual device name.
CRs-Fixed: 576911
Change-Id: Ia64e1e90aae8c4e0cc52643ce3bbbb1332fe5b66
Satish Kodishala [Wed, 9 Mar 2016 13:27:01 +0000 (18:57 +0530)]
AG: Disable HSP profile durning BT turn off.
When BT Turns ON we are enabling HSP and HFP profile.
When BT Turns OFF we are disabling only HFP profile.
So,When BT Turns ON unable to connect HSP profile.
So,Add Disable for HSP profile also once BT Turn OFF.
CRs-Fixed: 987527
Change-Id: Ied8bef7eee8a20530ceedea636fcc1000ee7bb3a
Matadeen Mishra [Sat, 30 Apr 2016 11:46:12 +0000 (17:16 +0530)]
Bluetooth:CoreStack: DUT Stack Logging.
DUT stack information logging:
-L2CAP configuration parameter,
-Device role information
-L2CAP flow control and congestion information
-L2CAP State machine and events
-RFCOMM credits count
change-id: I6e74bdb1cda4455c50314f67bbcd19accd3c31e4
CRs-Fixed:602294
Bluetooth:CoreStack: DUT Stack Logging set2
DUT stack information logging:
-L2CAP CIDs, PSM and MTU
-removed RFCOMM credits count from default logs
change-id: I7a25d751b200e8ece87f9e5fd79ab48d736087cb
CRs-Fixed: 602294
Bluetooth: Add debug logs for the remote device information
change-id: I857016c056635907586d8a9d0d577edde4efc34a
Add logs to provide the below remote device information
- Remote device features
- Service class
- LMP version, subversion, manufacturer
- Role changed event
CRs-Fixed: 602291
Change-Id: I99f51841716e27ef7170b7566379b975c99a65e0
Arusha Goyal [Mon, 9 May 2016 11:06:09 +0000 (16:36 +0530)]
Revert "Initial commit for rfcomm test tool"
This reverts commit
3d4f014eb0595ff41393c0c1e259b8941737cb0c.
Change-Id: I21701af4cea0cfdcd23819a400e9c09f1f50008b
Ajay Kumar [Wed, 25 Nov 2015 06:52:46 +0000 (12:22 +0530)]
Bluetooth: Fix module cleanup.
if module does not start fully its state will either NONE
OR INITIALIZED. While module_shut_down if module state is
not STARTED, it will exit without shutting underlying
layers which will give issues or ASSERT in next cleanup.
In this specific issue hci module stucks in USERIAL_OPEN
and startup timer expires and module exits with the error.
Since there is no error check on hci module fail it goes
ahead and enables BT(that might give issues later) but
fails to cleanup and does not call USERIAL_CLOSE while
hci module_shut_down as part of disable.Now this will
ASSERT in next enable as USERIAL lib handle is not NULL.
even if we call module_shut_down that is not going to
help as it will exit without calling lifecycle function
:shutdown. Adding module error state will solve the issue
CRs-Fixed: 939575
Change-Id: I0f448eb438881a9df46d07eab44d809bae740ab5
Anubhav Gupta [Tue, 22 Mar 2016 18:03:33 +0000 (23:33 +0530)]
AVRCP: Update sdp record correctly for CT or TG
- pass sdp version as parameter
- update sdp records for avrcp controller in case of client
profiles being enabled
- BTA_AV_FEAT_BROWSE flag was incorrecly set during AV registration
causing AVRCP TG version to upgrade to 1.4 even though browsing
feature is not supported.
- Use AVRC_CTLR_INCLUDED feature flag instead of AVRC_ADV_CTRL_INCLUDED
for guarding Avrcp controller code in build/parse apis for
command/response
Change-Id: I3ff4082453a2624a72d8f152d75af83a8efb4937
Hemant Gupta [Tue, 19 Jan 2016 15:48:15 +0000 (21:18 +0530)]
HID: Return error when hid host is disabled
This patch returns error when hid host service is disabled.
Without this patch thre could be potential UI synchronization
errors when hid host service is disabled.
Change-Id: Ida9e4c91015c8b0e4d36db5f58c0a65b7630a259
CRs-Fixed: 964404
Hemant Gupta [Fri, 22 Apr 2016 07:23:02 +0000 (12:53 +0530)]
HID: Fix issues in stack reported by static analysis tool
This patch fixes issues for hid profile in BD stack reported
by static analysis tool.
Change-Id: I8d765e8e7662781266b73344dee3dd1766930799
CRs-Fixed: 740857
Hemant Gupta [Tue, 4 Nov 2014 14:49:01 +0000 (20:19 +0530)]
HID: Fix corner case state machine handling for HID Host
This patch fixes the following issues for HID Host state machine handling
- Retry timer was never stopped in stack in case l2cap channel was refused
by remote device, and l2cap connection was made before timer could expire.
This was leading to some variable corruption in collision cases.
- UHID driver is also closed in case open failed to fix some corner case
issues of uhid driver not closed in some cases.
- Handling of virtual cable unplug in waiting for connection state. Without
this some IOT issues were seen with some hid mouse which used to send
VC unplug while connection setup was still ongoing for hid host because of
SDP.
- Fix corner case race condition when remote device closes the l2cap while
DUT is about to send Virtual cable unplug control command. Without this change,
it was seen that in above scenario state machine of hid host moved to idle on
reception of close event from remote device, and was unable to handle device
unpairing on successful completion of virtual unpulg event which never came
in above scenarios.
- Some extra debug logs are added in code flow.
Change-Id: I851b73068a801f637eac94533a60150946d257f6
CRs-Fixed: 750415
Hemant Gupta [Fri, 21 Feb 2014 13:20:41 +0000 (18:50 +0530)]
HID: Set sniff subrate with optimize latency value on HID Link.
Current HID design disables sniff on HID Link in presence of SCO/eSCO, which
was leading to many IOT issues, as HID links work in sniff mode, and disabling
sniff on hid leads to issues of connection timeout if anchor points are missed
during sco/esco concurrent usecases. This design is changed as below:
- If HID is connected & SCO is active, then disabling Sniff subrate
to fix connection timeout on HID link.
- If HID is connected & SCO is not active. Setting sniff subrate with
optimize value based on the remote parameter to fix connection
timeout on HID link to avoid HID IOT issues.
- Adds behaviour of host disabling SSR for JW MT002 and prevents
Host from sending Sniff subrating command to SoC for BORND mouse
so as to avoid IOT issues of disconnection and slow mouse movements
respectively with these device.
- Updates SSR parameters for HID Link to have a minimum
Max latency value for SSR, to have better trade off between power
consumption as well as performance of HID.
Change-Id: I6d60df88ea33e00b0fb173447351da4874dc97e5
CRs-Fixed: 635632
Hemant Gupta [Tue, 30 Jul 2013 10:41:33 +0000 (16:11 +0530)]
HID: Add support for Set Idle and Get Idle commands (2/4)
This patch adds support for sending set idle and get idle commands to
remote HID device, on receiving the function call from upper layers.
Also on reception of get idle time from remote device, upper layers
are infrmed using registered callback.
Without this support TC_HOS_HID_BV_05/06 PTS test cases for HID 1.0
cannot be passed.
Change-Id: I14bc2dc349354fd87ef8aba25357514398532e87
CRs-Fixed: 522511
Srinu Jella [Fri, 29 May 2015 11:33:08 +0000 (17:03 +0530)]
Initial commit for rfcomm test tool
- Initial commit for rfcomm test tool.
Change-Id: I2c00ea88030d6494acb368da08f81be87ef411d7
Rfcomm test tool for rfcomm protocol certification
- Interface provided from BT-If layer to interact
with rfcomm.
- This tool covers all rfcomm PTS test cases.
Change-Id: I129fbabdbdd80c87f0867c90e472e65bd1611af2
Initial commit for mcap test tool
- Initial commit for mcap test tool
Change-Id: I8657c941603728f6681000a904d96368c6f1f2cc
Initial commit for l2cap test tool
- Initial commit for l2cap test tool
Change-Id: Ia989c59f16d3cb2f314083e4436249f38dc93e7e
Mcap test tool for mcap protocol certification
- Interface provided from BT-If layer to interact
with mcap
- This tool covers all mcap PTS test cases.
Change-Id: I07f1eb8dc3d98c95b82ee67554c1a846e71c4bfc
L2CAP test tool for L2cap layer certification
- Interface provided from BT-If layer to interact
with l2cap
- This tool covers all l2cap 4.0 PTS test cases
whcih includes basic, ertm and streaming mode
test cases.
Change-Id: Ifacd0b99974c28788926e0f901c37ee2c12ff97b
Bluetooth : Cert tool compilation
Change-Id: I7eaf1ce9ccd2872ba614152ee34f53e6a6fc897b
Qual tools: L2CAP Add support for window size
MCAP Delay MDP Handling
Change-Id: Ic7a99e89a956a95a882caa829925cda08d642232
Gaurav Asati [Mon, 9 Jun 2014 12:34:10 +0000 (18:04 +0530)]
Bluetooth: Check for NULL String.
When JNI checks are enabled it checks for
NULL, so check for empty string for ATD.
CRs-Fixed: 676866
Change-Id: I8b0cdafeb34737b95041ed6a6ec117fa32effa36
Satish Kodishala [Thu, 7 Apr 2016 10:26:34 +0000 (15:56 +0530)]
Don't unset the HF indicators and S4 Settings for PTS
PTS Test Case HFP_AG_SLC_BV_10_I failed due to PTS HFP version is 1.5.
If there is HFP Version less than 1.7 we are unsetting the HF indicators
and S4 settings in BRSF.So,regardless of PTS HFP version we should not
unset the HF indicators and S4 settings in BRSF.
Also for HSP Profile some PTS Test cases failed because when there is
HSP connection we are checking for callsetup indicator which were not
present for HSP profile. So,we should check for HFP connection as well
with the call setup Indicator.
CRs-Fixed:
1000512
Change-Id: I61239a187c2f85b759eb3029c47e6c2fe341c16e
Satish Kodishala [Thu, 5 Nov 2015 06:46:12 +0000 (12:16 +0530)]
Dynamic HF version change based on remote hf version
For remote devices supporting HF specification 1.6 or lower,
advertize phone's HF version as 1.6. For remote devices supporting
HF version 1.7, add them to data base and advertize phone's HF
version as 1.7. User need to re-pair HFP version 1.7 devices
CRs-fixed: 934912
Change-Id: Icd6eeea738b19a9ca74214cb33b0bcaebc5f4b9e
Srinu Jella [Thu, 8 Oct 2015 11:44:16 +0000 (17:14 +0530)]
Bluetooth: Implement dynamic blacklist method for role switch
- Blacklist the device if it's rejected the role switch for
max number of times.Same is added to the iot_devlist.conf
file.
- Maximum number of failed (BTM_MAX_SW_ROLE_FAILED_ATTEMPTS)
attempts set to 3 and it is configurable.
- Same blacklisted device is referred by the BTM module when
any other module like profile is requesting for role switch
and BTM module returns BTM_REPEATED_ATTEMPTS as the switch
role status.
- There is option to retry for role switch even though the
device is blacklisted and it can be controlled by feature
flag BTM_SAFE_REATTEMPT_ROLE_SWITCH. And by default it is
enabled
CRs-Fixed: 831542
Change-Id: I570e1539578e60901794941ca46f0722e368a954
Hemant Gupta [Wed, 8 Jul 2015 18:23:15 +0000 (23:53 +0530)]
FTP: Add FTP SDP record in Bluedroid stack.
Add FTP SDP record registeration in Bluedroid Stack.
Change-Id: I7b3c3d85c5c6a7ac20a0a9361a646d2d494f8fec
CRs-Fixed: 504049
Satish Kodishala [Tue, 6 Oct 2015 15:42:14 +0000 (21:12 +0530)]
HF Client: Handle errors for CGMI, CGMM in the stack
AT+CGMI=? and AT+CGMM=? commands are sent from stack to
the AG in post SLC sequence. We are upstreaming errors
returned from AG for these commands to
HeadsetClientStateMachine. This leads to state mismatch
in state machine.
CRs-fixed: 919514
Change-Id: I4acb32d3c1dd78ba3de3b60fb029268b307199f7
Hemant Gupta [Wed, 7 Oct 2015 06:38:10 +0000 (12:08 +0530)]
HID: Prevent incoming and outgoing SDP collision
SDP is performed 2 times as part of HID connection in BD stack,
one after successful authentication, and one in hid stack layer
as sdp data is not stored currently in stack. When there is outgoing and
incoming connections, SDP failed message was posted which was resulting
in SDP failure for hid host resulting in improper disconnection of
hid interrupt channel.
Change-Id: I5b4813dc916696e2c0f76be27a85c1a89c2d8be0
CRs-Fixed: 683139
Satish Kodishala [Fri, 1 May 2015 14:23:35 +0000 (19:53 +0530)]
Get AG manufacturer information
Added support for AT+CGMI and AT+CGMM commands.
The commands get manufacturer identification and model
information respectively. Commands are sent post SLC
procedure.
CRs-fixed: 844824
Change-Id: Ie556281eebc7b8511d28b2d56f3519cca312e3c6
Ajay Kumar [Wed, 9 Mar 2016 05:03:33 +0000 (10:33 +0530)]
Bluetooth: Avoid crash while releasing CCB
There are chances that LCB values are not
filled while releasing CCB, putting check
for this ensuring no crash while LCB is NULL.
Change-Id: Iac2fa78d3599431308a030861158efa095bbdbf5
CRs-Fixed: 984983
Satish Kodishala [Fri, 10 Jul 2015 09:36:07 +0000 (15:06 +0530)]
Ignore RFCOMM close event in case of collision
When Multi-hf is enabled, if outgoing and incoming to/from
HF collide, ignore RFCOMM close event if HF is already connected.
CRs-fixed: 869792
Change-Id: I1ed5b17de13ed66c2add4c2377949cdffe968c48
Handle unknown codecs sent by HF
Use case:
1. Connect to headset supporting CVSD, mSBC and other codecs.
2. Verify if headset sending AT+BAC with supported codecs.
3. Check if SCO is established with mSBC codec.
Failure:
SCO is established with CVSD codec.
Root cause:
When parsing AT+BAC command, if unknown codec is received,
we are falling back to CVSD although mSBC is supported in HF.
Fix:
AT+BAC parsing function modified to return correct codecs
supported by HF when it encounters unknown codecs in arguments
of AT+BAC.
CRs-fixed: 861222
Change-Id: Ibc6a72b749280dc70a355270f37f4316468c1a4f
Clear remote BD address if SDP search fails
Use case:
1. Enable multi hf.
2. Pair and connect to a headset.
3. Turn off headset and try connecting to headset from AG.
4. After the connection fails, turn on headset.
5. Make sure headset initiates HF connection to AG.
6. Make MO/MT call, switch from headset to AG, vice versa using headset.
Failure:
When call is transferred from AG to headset, headset initiated
SCO connection request is rejected by AG.
Root cause:
For outgoing connection in step 3, SDP search fails. BD address of
remote headset is stored in scb[0]. BD address of headset with which
we tried to connect is not cleared in scb[0].
When incoming HF connection request is accepted in step 5, BD address
of headset is stored in scb[1]. Now, BD address of the same headset is
stored in both scb[0], scb[1].
When SCO connection request is received from headset, we get scb
information using BD address. However, since BD address in scb[0]
is not cleared, we end up selecting scb[0] for which there is no
headset connected. This makes us think that remote is initiating
SCO connection without SLC and we reject the SCO connection.
Fix:
Clear the BD address of remote when SDP search fails.
CRs-fixed: 861209
Change-Id: Iff3e1f2a25988c3eb55d6914cae6ac8427a7e211
BT: HFP1.7: Do not upstream invalid BIND set event.
Incase remote HS sends incorrect BIND set command during
SLC, do not upstream the event to BT apps to avoid disconnection.
Change-Id: Ie2d52a97ab179174e219ebe0c17f9d1f66545367
CRs-Fixed: 809572
Do not reset SSR parameters on SCO link.
When Headset is connected during active call, HFP is connected
first. Due to active call SCO is also established, when SCO is
established we disable SSR. When a2dp is connected after SCO
connection it enables SSR. This enabling of SSR is causing ACL
disconnect.
When there is new profile connection on same device which has SCO
we should not enable SSR. It should be enabled only when there
is no SCO.
Change-Id: I25263a148a13136174a67867a822ba3497a11f8e
venkata Jagadeesh [Thu, 26 Jun 2014 06:25:41 +0000 (11:55 +0530)]
GAP: Accept incoming connection with slave role
-Define DUT Default desired role as master
-Accept incoming connection with DUT role as slave for
list of carkits and headsets which are blacklisted.
Change-Id: Ie6af63b50debd417ce2d54b28b83d95ef4f695a6
CRs-Fixed: 892194
Bluetooth: GAP: Disallow roleswitch for blacklisted devices
Set link policy to disallow role switch for blacklisted devices
as some devices not starting encryption after role switch
and a2dp connection getting delayed for some devices due to role switch
Change-Id: I75a20b5cda9c4b46d118b12de373c99a25f72012
CRs-Fixed: 892242
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
Change-Id: I41bd78f1d25f1fc2985f1cf226a54d6819be968b
Srinu Jella [Mon, 21 Sep 2015 13:59:50 +0000 (19:29 +0530)]
Bluetooth: Add support to send h/w error event
- Bluedroid stack needs to be reset whenever H/w
chip restarts like Subsytem restart.
- Emulates the hardware error event on detecting
SSR event from PR controller.
CRs-Fixed: 914079
Change-Id: I9248a4e6ad689fc590fd4fd0f7a067cd33bf314f
Bluetooth: Reset bluetooth status to download NVM tags
- Reset bluetooth status to download the NVM tags once
the SSR is detected.
- NVM tags downloaded only once for the first BT on and
downloaded again in case of SSR or command timeout.
- Without this change, there would be diffrence in
BD addr which would lead to pair/connection issues.
CRs-Fixed: 932195
Change-Id: I75a44e7ae7d301ff1c9be8349c1b51d4c80cbf36
BT: Adding check for packet size before allocating buffer
During controller reset, corrupted packet might reach
to host. This packet might indicate length value more
than maximum allowed packet length. This causes crash
during buffer allocation.
Added the correct length check before allocating the
memory.
CRs-Fixed: 978009
Change-Id: I462b9b18e4c9db67d4860509376b0cb38830e56d
BT: Rectify the method to reset host after controller crash
Use case: When controller is forcefully crashed for testing,
the host process should reset itself.
Steps: Testing envolving forceful crashing of controller
to observe recovery and behavior of host in such events.
Failure: Once controller crash was enforced, the host
process was not resetting itself.
Root cause: The packet created to send hw reset event to
stack was getting truncated.
Fix: Changed the logic to first create an empty packet and
later set its type and data to make hw reset event.
CRs-Fixed:
1000446
Change-Id: Ied4e62db0be5bb8e16fac05787b9a071fd86b1e7
Satish Kodishala [Tue, 18 Aug 2015 13:57:39 +0000 (19:27 +0530)]
Add few logs for phone state change updates
Added few logs to get the phone state updates from Telephony.
CRs-fixed: 751733
Change-Id: Ic5553e08f0584fef0705386ba96e0fa852676ba3
Srinu Jella [Wed, 7 Oct 2015 12:31:53 +0000 (18:01 +0530)]
Bluetooth: Add support to read BD address from bt_nv.bin
- Add support to read BD address from bt_nv.bin if no
other BD address is available from other mechanism.
- If the ro.boot.btmacaddr property is set, it will
prioritize this property over bt_nv.bin.
CRs-Fixed: 921979
Change-Id: I8a0d38be7adb93db95eb3618a8f6af4030adf373
Matadeen Mishra [Wed, 23 Sep 2015 16:56:46 +0000 (22:26 +0530)]
Handling Authentication Failure From the lower layer
Use case: DUT unable to do connect with all devices in
Multipairing case.
Steps:
1. pair with HS
2. disconnect HS.
3. reconnect HS from DUT.
Failure: Authentication failure occurred due to LMP
transaction collision DUT not deleting link key which
lead to unable to connect to device.
Root Cause: Not posting the Authentication failure
event to application layer, while removing the link-key.
Fix: Post the Authentication failure event to application
and removing the link-key.
Change-Id: I079d8ce89c1fea66f0624127514cec8405bfdd3d
Add null check to avoid exception after L2CAP psm assigned
Use case: BT will get crash in SNS testing.
steps: SNS testing BT ON/OFF.
Failure: Crash is observed.
Root Cause: If the number of supported services increased,
larger service record array is required. Smaller array is
resulting in out of record error causing L2CAP deregister.
Fix: Check added to avoid null pointer exception if null
is returned while fetching sock from id. Also cleanup of
SDP and security records done during BT turning Off.
Change-Id: I2e77127262119cabf2c372f894427dcdf3350e80
Prevent crash due to second attempt to clean up eager_reader
Null out the eager readers once they are cleaned up, so we
don't try to clean them up later if an error occurs opening
the HAL again later.
Change-Id: I07df1010a1a619cb67b306d64e274d450234a002
Remove bonded device information on pairing rejected
Use Case: Remove bonded device information from the BTIF layer storage
when authentication failed.
Failure: Remote device appeared in the paired list after authentication
failed.
Steps:
1. Create a connection from DUT to remote.
2. Remove linkkey in remote.
3. Create connection from DUT to remote, which is in paired list of
DUT, Remote rejected the connection and authentication failed.
But after BT OFF/ON, remote device appeared in the paired list
Root Cause: Not removing device if remoted rejected the pairing
request with reason pairing not allowed
Fix: Remove bonded device information from the BTIF layer storage
on rejected with pairing not allowed reason from remote
Change-Id: Ic9e5e1ed70d304edd3dbca82a73833753fa0093c
GAP: Save pin code length for incoming legacy SAP connection
Use case: Carkit cannot reconnect to DUT in Sim Access Profile mode
Steps:
1. Pair with a car-kit (Agree all SAP, MAP, PBAP requests)
2. Initiate disconnection on DUT
3. Initiate re-connection on the car-kit.
Failure: SAP profile reconnection failing as dut gives negetive
linkkey reply.
Root Cause: sec_flags not getting updated without pin len and stack
triggering negative link key reply even linkkey is proper for 16 digit
authentication of SAP.
Fix: Save pin length during BTM_PINCodeReply.
Change-Id: I8300dd3ff497058291143313b169190910e0a7c5
Ignore pairing not allowed error when pairing in progress
Use case: Pairing with both devices fails, when there is
clash of pairing from 2 devices
1. Create a link from Test tool to DUT. Remove bonding info in Test tool.
2. Create a link from DUT to magic mouse. Unpair the link from DUT.
3. Click on magic mouse, it creates a link, and we get a pairing
pop-up in DUT.
4. Try to pair from Test tool to DUT.
Failure: Pairing with mouse should success and other pairing
should fail. But both pairing fails
Root cause: Stack sending pairing not allowed error to upper layers
for the second device when already pairing is in progress with
some other device, which is impacting the existing pairing.
Fix: Issue fixed by Ignore pairing not allowed error for the
second device when already pairing is in progress with some
other device.
Change-Id: I20dbd70e7429505a580c9a20d40a8d92318f6c3e
Handled delayed info response from remote during SDP
Use case: DUT is not connecting to windows-7 tablet
Failure: Connection is not successful with windows-7 tablet.
Steps:
1. Turn on BT on DUT
2. Pair and connect from remote device.
Root Cause: DUT initiates connection with out waiting for
information response from remote device during SDP.
Fix: DUT will not wait for information response from the
remote during SDP.
Change-Id: Iee0251f8f81923b1291983b66b31c78e14d21af0
GAP: Update Paging and inquiry busy level seperately
Use case: Bluetooth Search Fail while ACL disconnection.
Steps:
1. Headset(HBS 760) connect
2. Put Headset off
3. BT Search Fail.
Failure: BT search fail after disconnected Headset.
Root cause: While updating the busy level of Paging or inquiry '10'
was used as BL for paging and inquiry,this leads to
1. Ignore the one of them when both of them are active.
2. During ACL disconnection, unexpected inquiry busy level update.
Fix: Sending unique busy level for paging related events and inquiry
related events, so that each event will be notified.
Change-Id: I7bddcb4901061c450555235717b7d49bab922ae8
GAP Write 248 char name length to the chip while BT ON/OFF
Use case: Remote device cannot see local name with 248 chars.
steps:
1. Turn on BT (Default name will come)
2. Change local name to 248 chars
make sure DUT can be successfully searched from remote device.
3. Turn off BT (or phone reboot)
4. Turn on BT
After step.4, the 248 chars name comes to GUI on MTP. However
device search from remote device having DUT "Default name".
Failure: Remote device cannot see local name with 248 chars.
Root cause: DUT not supporting for the 248 char local name
Fix: Writing the exact 248 character local name to the chip
Change-Id: I702af8fa8d0affda509de7a9f17af8922e410286
Failed to re-register APK Configuration for HDP
Use case: register/unregister HDP from third party APK
Test Steps:
1.Install Any Test APK which internally registers/unregister the HDP.
2.Run Test APK.
3.Do initialization of Test APK which internally registers the HDP.
4.Force stop the Test APK.
5.And rerun the APK by going back test APK menu.
6.Now it never perform the re-register the HDP as part of initialization.
Root Cause: HDP registration related counter write operations are done
in JNI main thread, and it's been referenced in BTIF thread.Sometimes,
if the context switch to BTIF thread doesn't happen immediately after
counter increment/decrement, it may not un-register the app if the
counter becomes 0.
Fix: Fixed it by making all operations related to counter in BTIF
thread, so that de-registration happens for all HDP APPs.
Change-Id: I71ace68a5f3d39d81b646f5f40c02ce56b9e93f0
Added check for hci_layer status before processing function calls
Use case: BT will get crash in SNS testing.
Steps: SNS testing BT ON/OFF.
Failure: Crash is observed.
Root Cause: 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.
Fix: Added check within functions to check for hci_layer state
before processing.
Change-Id: I8dbca9893e03dfc500886c5033a79976dc5d23e1
Group BR-EDR related SDP variables under transport
Use Case: Random RNR initiated after HOGP Keyboard disconnection.
steps:
1. keep madcatz in advertisement mode and scan, pair from DUT.
2. keep dailog Keyboard in advertisement mode and scan, pair from DUT.
3. Take Keyboard out of range to initiate disconnection from remote
or initiate disconnection from remote.
Failure: DUT trying to do RNR to random device.
Root Cause: when the disconnection happened for LE device, it sets
the wait_disc to true, that is causing random RNR to go for BR-EDR
device.
Fix: Group all BR-EDR related SDP variables under transport check
so that if some other operation on LE will not corrupt these BR-EDR
variables to mislead.
Change-Id: Ic9003f2b85bbaaa30b201b8a639a9d9b52055ac5
Anubhav Gupta [Tue, 5 May 2015 12:18:24 +0000 (17:48 +0530)]
Enable AVRCP TG feature only when A2dp source is enabled
- Drop Control, Meta and Browse commands when TG is not up.
- Not to call AVRCP app callbacks when mentioned service is down.
- Advertise AVRC CT category 2 support in CT SDP record.
Change-Id: Ib54c104e87c735b55d6c6ec07c08d2149acc1a6d
Anubhav Gupta [Wed, 21 May 2014 14:33:00 +0000 (20:03 +0530)]
Reject Metadata command with invalid length
This change ensures that DUT rejects AVRCP Meta command
having invalid data length to avoid crash while processing
the invalid command further.
This crash was seen while running codenomicon test suit.
Change-Id: I8a591d601636a0fce268b5b965f2bd691c24c319
Anubhav Gupta [Tue, 5 May 2015 14:54:47 +0000 (20:24 +0530)]
Enable incoming connection for AVRCP Controller
- Start listening for incoming AVRCP connection if we have
only AVRCP Controller
- Update default peer_features based on feature mask. In case
of incoming AVRCP connection, SDP will be done later.
In such a scenario default peer features sent to btif should
be based on features-set selected during initialization.
Change-Id: Ied8ac0673288a4423bd41500985366ddc2c567a8
Anubhav Gupta [Tue, 24 Sep 2013 06:01:16 +0000 (11:31 +0530)]
Initiate Sniff on A2DP/HFP links
With Plantronics headsets it has been seen that sometime
it takes upto 30s to initiate SNIFF. With these devices
ACL is in active mode for that duration. Though there is
no user observable impact but power consumption will
be more as link does not go to SNIFF.
Changes are done in Handsfree Power Manager table such that
once Handsfree PM state Machine goes to idle state, SNIFF
timer is started. In addition to that extra power mode entry
for AV is avoided by passing correct app_id to sys methods.
This avoids sending app_open from SDP for A2DP. Instead uses
conn_open while starting SDP and conn_close on SDP complete.
Change-Id: I25608db3e2b8cfe8f44b10894d5d3a7388b54ed5
c_sdamga [Mon, 20 Jul 2015 13:47:04 +0000 (19:17 +0530)]
Handle Disconnect request in Opening State.
When A2dp is unchecked from settings UI and remote has
initiated a2dp connection and initiated AVRCP play music
gets started on DUT. Since A2dp connection is disconnected
music continues to play on DUT.
As A2dp connection was not completed, btif state was still
in opening state.Hence handle disconnect in opening state
so that we disconnect A2dp before AVRCP cmd is processed
Change-Id: If1cda5b78100419fdc60c97349efafdd4a18d40c
Sumit Bajpai [Tue, 9 Jun 2015 12:55:20 +0000 (18:25 +0530)]
BT:[1/3]Send VSC to SOC for VOIP connectivity network type.
- Handle voip network type wifi command from BT app.
- Prepare VSC in BTIF.
- Handle command complete for VSC.
CRs-Fixed: 821566
Change-Id: Ia74e1f0f1e0fb37f952b736b1546ed2de5aee5af
Gaurav Asati [Tue, 18 Aug 2015 13:39:57 +0000 (19:09 +0530)]
Bluetooth: update both connected HS.
- When VR is launched/closed from connected HS, update other
HS for VR state change.
- When VR is launched/closed from UI, update both connected
HS for VR state change.
Change-Id: I652557abe6983e60b7d2ace305b5418f4fba3c70
Satish Kodishala [Fri, 31 Jul 2015 13:09:01 +0000 (18:39 +0530)]
Read HFP version property on BT4.0 or older BT devices
If reading local supported codecs command is not supported,
read HFP version property to set MSBC codec.
Change-Id: Ifc44d1b63e454c8c0212eca47d763c6bb16e2034
Sumit Bajpai [Fri, 9 Jan 2015 09:19:00 +0000 (14:49 +0530)]
BT-HFP: HFP1.7 AG support in bluedroid
Added HFP 1.7 support in BT stack.
CRs-fixed: 715684
Change-Id: I315c723cb956a566a8c248a34959a18d177d166e
Satish Kodishala [Wed, 22 Jul 2015 10:27:31 +0000 (15:57 +0530)]
Enable WBS
Enable compile time flag BTM_WBS_INCLUDED in the stack to enable
the WBS codec negotiation code in the stack.
All changes in stack are guarded using BLUETOOTH_QCOM_SW feature flag.
Initiate codec negotiation process only for those remote
devices which support it
start codec negotiation procedure after AT+BCC command is received from HF
requesting to start codec negotiation.
SCO state machine moves to proper state to reinitiate SCO connection.
Avoid sending codec negotiation for HF devices not supporting
WBS in such error cases.
CRs-fixed: 878963
Change-Id: Ia3641bfad60b4087cf99250a7ea190ec700547bf
Satish Kodishala [Fri, 5 Feb 2016 07:05:54 +0000 (12:35 +0530)]
AG: Clear the memory before using it
Initialize memory with 0s before copying the arguments
of AT commands received from headset. If buffer is not
initialized to 0s, when we encounter any unknown character
while parsing the arguments, we return error.
CRs-Fixed: 972767
Change-Id: Ia107ccd140b7bbc9e5963920d34fad22664c7519
Sumit Bajpai [Wed, 16 Sep 2015 13:08:43 +0000 (18:38 +0530)]
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
Ayan Ghosh [Thu, 29 Jan 2015 12:04:48 +0000 (17:34 +0530)]
Disconnect AVRCP if A2DP does not connect to same device
Disconnect existing AVRCP if A2DP connects to other peer device.
This fix is required as we do not have separate UI to disconnect
AVRCP profile. So unless AVRCP is disconnected this way this orphan
connection will exist for ever.
Change-Id: I1113de2d40e7596095fd7e7fbca600dfaf0b551e
Ayan Ghosh [Wed, 6 Aug 2014 10:34:42 +0000 (16:04 +0530)]
Synchronize encoder init and encoder update
Ensure encoder init and encoder update are executed
from same BTIF context which ensures sequential
execution of encoder init and update functions.
Change-Id: I0945737497f87e450a6c9959eb5f163e932db7d4
Ayan Ghosh [Thu, 3 Mar 2016 13:04:48 +0000 (18:34 +0530)]
Increase number of semaphores for media workqueue
As mediatask allows only 128 pending workqueue enqueue semaphores
to be created hence on Suspend confirm delay alarm callbacks run
out of that semaphore count and 129th instance of it gets blocked
and corresponding alarm_callback gets stuck.
Now later on receiving suspend ack, mediatask goes for freeing the
media alarm which eventually waits for pending callback to come out.
But as that never happens as callback is stuck so eventually mediatask
also gets blocked and SUSPEND ACK to Audio HAL also gets blocked.
So this phenomenon eventually leads to deadlock and later whosoever
tries to make use of audio therad runs into ANR.
This fix ensures that the current proposed value of semaphore/ workqueue
element cound is made so big that is capable of handling delay of 15s
(Max delay entertained for any AV signalling commands) for
suspend confirm case.
Change-Id: I917e2e0651cfc93837c483cd6f4f94d8aa933fa8
Satish Kodishala [Mon, 16 Nov 2015 17:16:51 +0000 (22:46 +0530)]
HFP-AG: Cleanup when incoming and outgoing connections collide.
- When incoming and outgoing connections from/to same device collide,
clean up outgoing path after incoming connection is accepted.
- Abort outgoing connection to the same device if collision is detected
before making RFCOMM connection.
- Choose the connected device to send response for AT commands.
Change-Id: If5c86356ce0496ab63d6445257bdc1977d2cb56b
Gaurav Asati [Tue, 5 May 2015 10:46:15 +0000 (16:16 +0530)]
Bluetooth: Enable WBS for HFP 1.6 and above
- Enable WBS feature for HFP versions 1.6 and above
Change-Id: I971e5c89e31142c4aec84aae9b92c0e26a00800e
Satish Kodishala [Wed, 13 Jan 2016 13:53:04 +0000 (19:23 +0530)]
AG: Check MT call setup state before starting ring timer
If the MT call is accepted, we should not send ring to
connected headset. If ring timer expires at the same time
when the call gets accepted, we end up stopping and starting
the ring timer.
CRs-Fixed: 961730
Change-Id: I84fe460318a0c10a90a89979e3e0e0ba4fdaa0bd
Bhakthavatsala Raghavendra [Wed, 23 Sep 2015 21:28:27 +0000 (14:28 -0700)]
Bluetooth: Update hf structure on phone state change only if SLC is up
Update hf structures on phone state change only if the perticular
SLC is connected. Updating it regardless of the states causes hf state
to indicate wrong status
CRs-fixed: 913024
Change-Id: I360677306b46e914f939b9034305d4b89dabd79b
Bhakthavatsala Raghavendra [Wed, 2 Sep 2015 23:27:42 +0000 (16:27 -0700)]
Bluetooth: Proper removal of item from connect queue in AG
Remove the connect queue item when RFCOMM connection for HFP is
up instead of while SLC is up, so that Profile state machine
wouldn't allow simultaneous CONNECT requests
Change-Id: Ie913f552d428d40fae1f8cded169c1cc49c822c8
Mallikarjuna GB [Tue, 23 Jun 2015 12:00:03 +0000 (17:30 +0530)]
Move SCO state properly
Due to sudden SCO disconnect along with ACL disconnect,
DUT's SCO state didn't move to proper state.Due to this,
next attempts to open SCO is failed and user was not
able to route call audio to BT headset.
This change attempts to handle this bad behaviour from
the remote and makes sure that SCO state is proper.The
change calls sco disconnection callback even in collision
case to allow SCO statemachine move to proper state.
Change-Id: I077b4b9c795bb8130bde5fe1cff98c88d570de44
Manu Viswanadhan [Tue, 7 Jun 2016 10:51:18 +0000 (16:21 +0530)]
BT: Initializing the SDP event message pointer before sending
In case of SDP_ServiceSearchAttributeRequest failure, garbage value
might be sent for discovery result structure, leading to crash.
Initializing the structure to zero to avoid this scenario.
Change-Id: I46d92d6262bae3b5def5401270465a3a06468c1a
CRs-Fixed:
1023388