OSDN Git Service
Pavlin Radoslavov [Mon, 19 Jun 2017 19:44:11 +0000 (12:44 -0700)]
Add a mechanism to avoid using AVDTP RECONFIGURE for blacklisted devices
Some carkits report SUCCESS for AVDTP RECONFIGURE commands when
changing A2DP codec configuration. However, there is no audio coming
from the carkit.
Bug:
37625892
Test: Manual - A2DP Codec reconfiguration while streaming audio
Change-Id: I01f37a2514e490986a20e96ace78c92463403396
Merged-In: I01f37a2514e490986a20e96ace78c92463403396
(cherry picked from commit
e91297a4d1a77ae0c367fbe756090b7357e9893a)
Pavlin Radoslavov [Tue, 20 Jun 2017 04:12:37 +0000 (21:12 -0700)]
Disable 48.0kHz sampling rate for AAC - update the unit test
Some carkits have issues playing A2DP audio using AAC with 48.0kHz
sampling rate, while playing AAC with 44.1kHz sampling rate is fine.
Bug:
38443632
Bug:
62301376
Test: manual
Change-Id: I5a8b72e86fb1a2cbf92f85e7a6c340cee58dadb5
(cherry picked from commit
858b6a15f528468e2b1b497dba27337f40220f7b)
Jakub Pawlowski [Tue, 13 Jun 2017 21:16:57 +0000 (14:16 -0700)]
Fix HID crashing on no descriptor
Bug:
62461796
Test: compilation test
Change-Id: Ic7b1fcc4b6f3c8680f1810679ed609f2691fa4aa
Martin Brabham [Mon, 1 May 2017 23:30:40 +0000 (16:30 -0700)]
bta_dm: Stop copying garbage
After we reach 7 ACL connections we have 7 peer device records.
Once we reach this then we lose a connection and shrink the list we
copy garbage into the last peer device record. This can cause the flag
remove_dev_pending to be set to something > 0 thus true which causes the
stack to remove the device and its bonding information on the next
acl change event.
ACL Connections can happen from any connection (pairing, SDP, etc...)
Bug:
36598959
Test: Manual
Change-Id: Ifbaa4098edba442274ffde183960ef53169988e7
Merged-In: Ifbaa4098edba442274ffde183960ef53169988e7
Jack He [Wed, 7 Jun 2017 23:44:30 +0000 (16:44 -0700)]
eSCO: Limit number of retries after mSBC connection failure
* When peer device supports mSBC and codec negotiation, Fluoride stack
will try to do the following when establishing a eSCO/SCO connection:
1) Negotiate to mSBC by sending +BCS:2
2) Try establishing eSCO/SCO connection using mSBC T2 settings
3) If that failed, downgrade to mSBC T1 settings and retry
4) If that failed, re-negotiate codec to CVSD, by sending +BCS:1
5) Retry using CVSD S4 (HFP 1.7 and above) or S3 settings
6) If this failed stop trying and report failure to upper stack
* Retry is achieved by:
* Retry is only possible when inuse_codec = BTA_AG_CODEC_MSBC
* Set codec_msbc_settings to BTA_AG_SCO_MSBC_SETTINGS_T1 when T2
failed to connect in step 3 above
* Set codec_fallback to true when T1 failed so that CVSD is used
in step 4 above
* Retry stop is achieved by:
* Set inuse_codec = BTA_AG_CODEC_CVSD
* Set codec_msbc_settings back to BTA_AG_SCO_MSBC_SETTINGS_T2
* Set codec_fallback to false and codec_updated to true so that
the stack is ready for the next application triggerred SCO
connection attempt
* Removed retry_with_sco_only as both Setup Synchronous Connection
Command (0x0028) and Enhanced Setup Synchronous Connection Command
(0x003D) fall back to SCO connection if eSCO is not supported.
See page 858/2772 and 895/2772 of BT4.2 specification document
* Besides both code paths are the same for retry_with_sco_only after
eSCO changes went in
Bug:
62426841
Test: make, HFP regression, testplans/91406
Change-Id: I205311c55e8763c48b6eb43c27f242927384036e
(cherry picked from commit
e82e56bb2a1e5565b73333b60dc6b30936f52e80)
Pavlin Radoslavov [Thu, 8 Jun 2017 22:22:52 +0000 (15:22 -0700)]
Ignore the Class Of Device if the value is invalid
If a Bluetooth Device is dual-mode and is discoverable as both
a Classic and a LE device, ignore unknown "zero" values
triggered by the LE advertisements. Otherwise, those could overwrite
a valid (previously discovered) Class Of Device.
Bug:
37615863
Test: Manual with LG HBS1100 headset
Change-Id: I5a0f6ef56248b41d973b850a5542475e45e0312d
(cherry picked from commit
a052757882927c042399d614bc298f9704ce07a3)
Jakub Pawlowski [Wed, 7 Jun 2017 18:26:36 +0000 (11:26 -0700)]
Fix GATT over BREDR not connecting
For BREDR connections, the upper stack always sends the request with
transport type DUMO, and this should be treated as BREDR if the device
is not known as LE only.
Bug:
62387078
Test: pts GattOverBrEdrTest
Change-Id: I726252e85e78bff2c9585332d2748a0d92a9f6d3
Pavlin Radoslavov [Fri, 2 Jun 2017 17:45:43 +0000 (10:45 -0700)]
Disable 48.0kHz sampling rate for AAC
Some carkits have issues playing A2DP audio using AAC with 48.0kHz
sampling rate, while playing AAC with 44.1kHz sampling rate is fine.
Bug:
38443632
Bug:
62301376
Test: manual
Change-Id: I50de2db1d5386d41bfe361fbac99fc7ebbbd3640
(cherry picked from commit
3d268331ae32bd70f60984c9553db1c961073c42)
Jakub Pawlowski [Sat, 3 Jun 2017 23:39:04 +0000 (16:39 -0700)]
Fix order of parameters to BTA_GATTC_Open
Different order of parameters in different flavours of method caused
bug in btif_gatt_client.cc, where every client would be started as
opportunistic. This issue was introduced in commit
16bb48b320cde54a1a06a525f4d9be1421689649
Bug:
34951749
Test: sl4a GattReadTest was flaky without this patch
Change-Id: I243b11bd8e2c0da9f01cbd3eab95dc808bd54006
Sunny Kapdi [Thu, 1 Jun 2017 21:34:03 +0000 (14:34 -0700)]
Fix params of SetPeriodicAdvertisingParameters
Fix the sequence of SetPeriodicAdvertisingParameters
in the hci_cmd
Bug:
62268713
Change-Id: Ibdcd362458e9d7ee2f95106a2aefa76e1c264103
TreeHugger Robot [Thu, 1 Jun 2017 22:36:18 +0000 (22:36 +0000)]
Merge "GATT: Fixed typo while notifying connection update" into oc-dev
TreeHugger Robot [Thu, 1 Jun 2017 20:50:11 +0000 (20:50 +0000)]
Merge changes I90a48db4,I8b9815a0 into oc-dev
* changes:
HCI: Improve timeout handling
HCI: Get debug info from the firmware on timeout
Avish Shah [Wed, 31 May 2017 05:13:57 +0000 (10:43 +0530)]
GATT: Fixed typo while notifying connection update
Current conditions checks whether the app registered for
PHY_UPDATE instead it should check for CONN_UPDATE.
Bug:
62206018
Test: Manual
Change-Id: Ie9d068a24d13ea0b186b0ca874531aa4ffd1121f
(cherry picked from commit
44a1c7eafb2db9012c26dd622726655f19fbc0b7)
Yamei Du [Thu, 1 Jun 2017 07:49:58 +0000 (07:49 +0000)]
DO NOT MERGE ANYWHERE HOGP mouse connect failed during OPP TX am:
dae59d3b83 -s ours
am:
0d0e9514ad -s ours
Change-Id: I37e10ab29d083a8d16e756caf3b094c188692d73
Yamei Du [Thu, 1 Jun 2017 07:47:29 +0000 (07:47 +0000)]
DO NOT MERGE ANYWHERE HOGP mouse connect failed during OPP TX
am:
dae59d3b83 -s ours
Change-Id: I2c48b9c67afda8ba35bfac258031de6909d1af12
Yamei Du [Wed, 18 Nov 2015 09:28:07 +0000 (17:28 +0800)]
DO NOT MERGE ANYWHERE HOGP mouse connect failed during OPP TX
FW ACL buffer overflow.
One more ACL packet was sent to FW which is unexpected.
fix l2cap TX control defect.
Call fixed channel TX complete cb after packets is send to lower.
Bug:
26763700
Tested: manual
Change-Id: Iaba14a11c1583da2a72769ebd096e0baedf857c3
CR-Id: ALPS02404396
TreeHugger Robot [Wed, 31 May 2017 22:54:03 +0000 (22:54 +0000)]
Merge "HSP: Use peer_version during SCO setup" into oc-dev
Myles Watson [Wed, 24 May 2017 20:16:40 +0000 (13:16 -0700)]
HCI: Improve timeout handling
Remove pending commands before enqueueing new ones and log all
pending commands when there is a timeout.
Bug:
37298084
Test: set the timeout to 20ms
Change-Id: I90a48db46a78f75dd78e468ee2d5c948afc1850e
(cherry picked from commit
4788821a0b3c47645deacb3b0047addf192956e2)
Myles Watson [Tue, 9 May 2017 23:50:00 +0000 (16:50 -0700)]
HCI: Get debug info from the firmware on timeout
Bug:
37298084
Test: set the timeout to 20ms
Change-Id: I8b9815a03a15dcb6ce78c0692874b55cb4fc07bc
(cherry picked from commit
2bfb56a2a92c897c8c0648674c51197fa8fe7f0a)
TreeHugger Robot [Wed, 31 May 2017 01:51:34 +0000 (01:51 +0000)]
Merge "GATT: Interop fix for service changed indications" into oc-dev
Ruina Liu [Wed, 31 May 2017 00:42:10 +0000 (00:42 +0000)]
DO NOT MERGE ANYWHERE Fix connect second BLE fail while BREDR coexist am:
e90e72bb82 -s ours
am:
c139d021b2 -s ours
Change-Id: I5c70d7e288f401cfef7de9f93ed9ed8366ee7914
Ruina Liu [Wed, 31 May 2017 00:38:38 +0000 (00:38 +0000)]
DO NOT MERGE ANYWHERE Fix connect second BLE fail while BREDR coexist
am:
e90e72bb82 -s ours
Change-Id: Iee3ecc2a5c6d81a4fc2e72e8e21cd0d898199624
Ruina Liu [Thu, 24 Sep 2015 02:04:16 +0000 (10:04 +0800)]
DO NOT MERGE ANYWHERE Fix connect second BLE fail while BREDR coexist
In scenario where BREDR/BLE links coexist, and BLE
transport is doing round-robin but BREDR transport is
not use round-robin, when uplayer trigger to transmit
BLE data, the BREDR lcb_pool with smaller array index
will break the for loop firstly. This can block the
L2cap packets transmission of the following BLE lcb_pool
even though there is available BLE controller buffer.
If BLE_INCLUDE is TRUE, then BREDR/BLE links maybe
coexist, change break to continue statement, so the
data transmission will not be blocked by the other
transport type in round-robin case.
Change-Id: I7ca739dfbf02acd2e30527c16ca616a7bad70c51
CR-Id: ALPS02303646
Andre Eisenbach [Tue, 30 May 2017 21:10:55 +0000 (21:10 +0000)]
Merge "DO NOT MERGE ANYWHERE Remove incorrect assert in btm_read_rssi_cb" into cw-f-dev am:
b044bae800 -s ours
am:
310ce8b220 -s ours
Change-Id: Ic13bec3228eebc49d2cf82ecc6f2eee4156a31ef
Andre Eisenbach [Tue, 30 May 2017 21:06:25 +0000 (21:06 +0000)]
Merge "DO NOT MERGE ANYWHERE Remove incorrect assert in btm_read_rssi_cb" into cw-f-dev
am:
b044bae800 -s ours
Change-Id: Ic7314f6710c10c670ea3a4a24b4865661ee1451e
TreeHugger Robot [Tue, 30 May 2017 21:00:28 +0000 (21:00 +0000)]
Merge "DO NOT MERGE ANYWHERE Remove incorrect assert in btm_read_rssi_cb" into cw-f-dev
Andre Eisenbach [Thu, 3 Nov 2016 21:53:49 +0000 (14:53 -0700)]
DO NOT MERGE ANYWHERE Remove incorrect assert in btm_read_rssi_cb
|data| may be NULL if the RSSI request times out.
See btm_read_rssi_timeout implementation for details.
Bug:
32587130
Test: manual
Change-Id: Ide9dee819e1db24a39c05b086cd4c0b558ca23ef
Jack He [Tue, 23 May 2017 02:23:04 +0000 (19:23 -0700)]
HSP: Use peer_version during SCO setup
* HSP profile should use peer_version obtained through SDP search to
determine its behavior during SCO setup instead of a local version
during initialization
* Added a WARNING message if SDP search failed to get remote HSP
version, the default behavior is to use HSP 1.0
* Changed SDP search initialization to look for one UUID at a time
* See Bluetooth Erratum 3507
Test: make, HSP PTS test
Bug:
38210042
Change-Id: I67ce615a785b25a2e9304613a29d9be66a656c54
(cherry picked from commit
a3745c645f3ab5b80a7325092bd6bb14accc265f)
Myles Watson [Fri, 26 May 2017 00:24:49 +0000 (17:24 -0700)]
GATT: Interop fix for service changed indications
The Pixel C Keyboard disconnects if it receives an indication
for which it hasn't registered.
Test: Add a GATT service with Pixel C connected
Bug:
34352677
Change-Id: I1f717db40b2ba9ec21feac5fd9e339c09f140d51
(cherry picked from commit
43c7f9f4775e589d8fd0604ef4717996696a0321)
TreeHugger Robot [Fri, 26 May 2017 17:34:54 +0000 (17:34 +0000)]
Merge "Fix crashes when GAP operation is interrupted by disconnection" into oc-dev
Jakub Pawlowski [Thu, 25 May 2017 16:09:12 +0000 (09:09 -0700)]
Fix GATT Server disconnecting for no reason
Connections created by GAP profile should be ephemeral, and not
interfere with the connection timeout.
When a device is bonded, listing services through DM would cause a
DM APP to create a connection, and later to disconnect. This causes
connection to timeout. In case a device was already connected, this
should not happen.
Bug:
34951749
Test: manual
Change-Id: Iad04fd9eed4c664f35131442e3f83a704497a067
(cherry picked from commit
16bb48b320cde54a1a06a525f4d9be1421689649)
Jakub Pawlowski [Thu, 25 May 2017 15:21:53 +0000 (08:21 -0700)]
Fix crashes when GAP operation is interrupted by disconnection
Also fixes potential issue while allocating control blocks.
Test: none
Bug:
38499153
Change-Id: I5101ac97476953cdfece45c3fa9b909e38b9d2dd
(cherry picked from commit
feec106412c54dbbfdb0e13d62d744f8fec6fd52)
Jack He [Sat, 13 May 2017 20:52:12 +0000 (13:52 -0700)]
MCAP: Add test interface for PTS test (2/2)
* PTS tests requires MCAP APIs to be called at protocol level
* This CL creates a test interface to enable the above functionality
Bug:
37867299
Test: make, no user visible effect
Change-Id: I15cc6cc613ce8f7c57564296e45077ab877c269b
(cherry picked from commit
722ce12babbd3d1e814f6e704860699a0b726e4f)
Jack He [Thu, 18 May 2017 05:22:18 +0000 (22:22 -0700)]
MCAP: Fix bugs in MCAP stack
* Fix error response message for clock sync opcodes
* Fix error response message for CREATE_MDL opcode
* Fix logging in the MCAP stack
Bug:
37867299
Test: make, PTS MCAP test
Change-Id: I7a37ac04806bca20d732357f00b4761577b4be19
(cherry picked from commit
b3a8dc2ece90770b41f4bc0555fabb2742093176)
Jack He [Mon, 8 May 2017 00:27:47 +0000 (17:27 -0700)]
eSCO: Format changes to original vendor patch (4/5)
* Format changes to original vendor patch
* Re-order part of SCO creation code to improve readability
* Make log more concise and usefull
Bug:
19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: Ie0199519afb30f56568c04fef728fce44a172063
(cherry picked from commit
fe695a557a92053d4c44428ba08c0b8e945d4711)
Jack He [Mon, 8 May 2017 00:26:02 +0000 (17:26 -0700)]
eSCO: Additional fix to get eSCO working for HFP and HSP (3/5)
* Removed vendor specific call after codec negotiation and before eSCO
command is sent to Bluetooth chip
* Removed vendor specific call after a SCO connection is requested by
the peer
* Removed vendor specific save audio state methods
Bug:
19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: I899405a8eaa2f38ee0de04949c5288f9eefa74df
(cherry picked from commit
400ac497f45181d3c64f6a19687992de9b69b094)
Myles Watson [Fri, 10 Feb 2017 00:26:34 +0000 (16:26 -0800)]
eSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)
All of our platforms support WBS.
Bug:
19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: I384d49f73935ebb35b17132e71c85174797c435e
(cherry picked from commit
3e634d6c1e83f053005c9abdbd89e662ad81c4d4)
Mudumba Ananth [Thu, 9 Feb 2017 17:05:48 +0000 (09:05 -0800)]
eSCO: BT 4.1 Enhanced SCO command (1/5)
Added support for BT 4.1 enhanced SCO feature on the stack.
This feature allows the stack to create a SCO connection with
remote device by using Hci_Enhanced_Setup_Synchronous_Connection
command after checking the controller (4.1) support for
enhanced SCO command.
Added the command parameters to use the command in both wide band
speech(WBS) and narrow band speech(NBS) scenarios.
Number of Broadcom vendor specific commands(VSCs)that are needed
to be sent to Broadcom controllers along with this command have
also been updated accordingly
NOTE: This change would also need a firmware patch for
the feature to work on Broadcom contollers which will
be delivered to Google in a separate change set.
Bug:
19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: I1014d81be5cbe91078a4484dd072ac3957bfdfe4
(cherry picked from commit
57f6508cf7b22788fa2e7a739cec241b785718fb)
TreeHugger Robot [Mon, 22 May 2017 22:54:35 +0000 (22:54 +0000)]
Merge "Remove logspam when initializing logging for Bluetooth" into oc-dev
Ajay Panicker [Wed, 17 May 2017 05:43:51 +0000 (22:43 -0700)]
Remove logspam when initializing logging for Bluetooth
Bug:
37803501
Test: Code still compiles
Change-Id: I9326e58aff0d80e441cb92c41e0e4a7d70e32b1b
(cherry picked from commit
5dd1e2de4a7411870d7ca13f549690a6498a6452)
Ajay Panicker [Wed, 17 May 2017 01:46:22 +0000 (18:46 -0700)]
Remove logspam when adding GATT attributes
Bug:
37905488
Test: Code still compiles
Change-Id: I479fc82a15f977b7e3d50b07302241909efc8856
(cherry picked from commit
60177e01c4644d1194d75248e8d2a6b1b40f7670)
TreeHugger Robot [Mon, 22 May 2017 18:17:41 +0000 (18:17 +0000)]
Merge "Reject LE COC if cid is duplicated" into oc-dev
Jakub Pawlowski [Wed, 17 May 2017 22:23:22 +0000 (15:23 -0700)]
Protect concurrent access to local state used during BLE scanning
Make sure that all access happens on jni thread
Bug:
38298938
Test: Code compilation
Change-Id: I38246626d2c6390586b314b27889dd9ba905f406
(cherry picked from commit
eb43e9cf12139aeb227e26a8201a80974129c553)
Pavlin Radoslavov [Wed, 17 May 2017 01:50:43 +0000 (18:50 -0700)]
Protect the message loop from accesses after HCI shutdown
Bug:
38330724
Test: Manual: enable/disable Bluetooth
Change-Id: Iaece4cd608c67b28b436ded9fcc51c0bf28f4098
(cherry picked from commit
7277f39540fefe551dc2120fc4db787a9ed57646)
Marie Janssen [Wed, 17 May 2017 01:40:45 +0000 (18:40 -0700)]
Blacklist Kinivo BTC350 for Absolute Volume
The volume is erratic on the speakers when the speaker is reporting
linear increase, with decreases for higher volumes.
Test: check that absolute volume not used for Kinivo Speakers
Bug:
37872586
Change-Id: Ic5f409e8631bece66a75372b916faa9c104e2024
(cherry picked from commit
e1fca1bacd76bd4e2c6c00ea3e292633e0eae0ec)
Pavlin Radoslavov [Tue, 16 May 2017 23:20:23 +0000 (16:20 -0700)]
Disable MONO channel mode for LDAC
Bug:
38351937
Test: A2DP streaming to LDAC headset and switching MONO/STEREO in Settings
Change-Id: I20c5069fd5d104b9ebe767ae2728af7d7b2ae1d9
(cherry picked from commit
f7e48dff99ffbce639c37379976b8cd9519e1d06)
Jakub Pawlowski [Tue, 16 May 2017 17:47:54 +0000 (10:47 -0700)]
Discover primary service by UUID for PTS tests (1/4)
Bug:
38123054
Test: manual
Change-Id: Ic97a964ca2a25a84c6abcf41acb0f3fb583488a2
(cherry picked from commit
45aebe75f75c1f93c396118bc39748fc0f4054c7)
Jakub Pawlowski [Mon, 15 May 2017 07:58:07 +0000 (00:58 -0700)]
Fix crash on GATT service unregistration
When SDP_MAX_RECORDS were reached in SDP db, which usually happen by
registering big number of GATT services, unregistration of a service was
causing a crash. This was because we moved from memory after the array
into last element.
Bug:
38265174
Test: manual
Change-Id: I7b0235213fb07c85dcc1245f1c840b41267521d5
(cherry picked from commit
0d892120359af4cd1af7f9c13897c1002eac59f3)
Pavlin Radoslavov [Fri, 12 May 2017 10:02:08 +0000 (03:02 -0700)]
Don't ignore the A2DP Sink preferred SBC codec config
If the A2DP Sink device sends "Set Configuration" with its preferred
SBC configuration, try using that configuration when selecting
the codec parameters instead of the A2DP Sink SBC capability.
Test: A2DP streaming, PTS AVDTP Tests: TC_ACP_SRC_SIG_SMG_BV_18_C,
TC_ACP_SRC_SIG_SMG_BV_20_C, TC_ACP_SRC_SIG_SMG_BV_22_C
PTS A2DP Tests: A2DP/SRC/SET/BV-04-I, A2DP/SRC/SET/BV-06-I
Bug:
37723311
Bug:
35664023
Change-Id: I48e2aa664b899c1cda5df4d1f86f9cfa3a9a67f6
(cherry picked from commit
d62e522131e8646830f846fdcb292870d7fb9d7b)
Pavlin Radoslavov [Fri, 12 May 2017 08:16:10 +0000 (01:16 -0700)]
Set the RTP Header Marker bit selectively per A2DP codec
Add a mechanism to set the RTP Header Marker bit per codec.
Currently, the Marker bit is set only for AAC.
Test: A2DP streaming, PTS AVDTP tests: TC_ACP_SRC_TRA_BTR_BV_01_C,
TC_INT_SRC_SIG_SMG_BV_17_C, TC_INT_SRC_TRA_BTR_BV_01_C
Bug:
37723283
Change-Id: I9b8e77d44c750746c169df9628d5539ad2406b92
(cherry picked from commit
3b8391cd47dd0ea3e399f99a888f029de8c7d8c8)
TreeHugger Robot [Fri, 12 May 2017 20:03:14 +0000 (20:03 +0000)]
Merge changes I1620be68,Ide2c2110 into oc-dev
* changes:
Improve GATT Server database handling.
GATT Server: check UUID
TreeHugger Robot [Fri, 12 May 2017 18:50:35 +0000 (18:50 +0000)]
Merge "Disable output_sample.pcm" into oc-dev
Jakub Pawlowski [Tue, 9 May 2017 12:02:38 +0000 (05:02 -0700)]
Improve GATT Server database handling.
- use references instead of pointers where possible. Thanks to it we can
remove some reduntant null checks and simplify the code.
- use directly allocated memory instead of own buffers. Thanks to it the
stack uses around 12kb less of memory after startup.
- use list and vector from std library, instead of some hand-written
implementations.
This patch is a prerequisite for further server refactoring, that will
further reduce the space used, make unit-testing possible, and enable
proper handling of PTS GATT tests.
Test: sl4a GattReadTest
Bug:
38225928
Change-Id: I1620be682259ccb8f0c02754806e355e3f1ad0c1
(cherry picked from commit
6395f1547ed6179dcdeed392bd9909d18772fb25)
Jakub Pawlowski [Wed, 10 May 2017 11:39:26 +0000 (04:39 -0700)]
GATT Server: check UUID
Characteristic and descriptor can't use UUID equal to GATT Attribute
Types. Using such UUID would result in invalid GATT database, and
crashes during service discovery.
Test: manual
Bug:
38134693
Change-Id: Ide2c21109f885cbc79287452b1dabd3f532de385
(cherry picked from commit
671ad6679ce4b8edcdb7eaaee96bc5c66b557441)
Joseph Pirozzo [Thu, 11 May 2017 16:36:47 +0000 (09:36 -0700)]
Disable output_sample.pcm
Update include files to include bt_target.h as it has the necessary
defines to correctly allow bdroid_buildcfg.h to enable and disable
dumping to output_sample.pcm.
Bug:
38180732
Test: Stream Bluetooth audio to device and observe that
output_sample.pcm does not get written or appended to.
Change-Id: Ia7926f93a47489686d315e3c9abd1618cb8adda3
Jacky Cheung [Thu, 11 May 2017 23:24:02 +0000 (23:24 +0000)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation am:
0ce25115e9 -s ours
am:
6ba79a8618 -s ours
Change-Id: Ibc77d01e1b480d60b04da5355242ba4071a9b064
Jacky Cheung [Thu, 11 May 2017 23:19:01 +0000 (23:19 +0000)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation
am:
0ce25115e9 -s ours
Change-Id: I105198593ba9994002205567038778162dc9e6d0
Jacky Cheung [Wed, 10 May 2017 21:23:06 +0000 (14:23 -0700)]
DO NOT MERGE ANYWHERE Check ACL link on non-opportunistic connection creation
At the time of connection, the idle timeout could have been set to a fixed
value, which is likely to be related to the completion of service discovery
after bonding. A check on ACL link allows the idle timeout to be reset to no
timeout, which would eliminate local host disconnections observed due to
idle timeouts.
Bug:
37352720
Test: manual
Change-Id: Ie0b24b83020d502cf7c55421a27659215253b4d2
TreeHugger Robot [Thu, 11 May 2017 01:03:30 +0000 (01:03 +0000)]
Merge "btif: GetItemAttributes can return no attributes" into oc-dev
Jaganath Kanakkassery [Tue, 2 May 2017 10:54:16 +0000 (16:24 +0530)]
Reject LE COC if cid is duplicated
This is for PTS test TP/LE/CFC/BV-20-C.
The scenario is there is already one COC between DUT and PTS.
Then PTS tries to establish one more COC with same cid which
should be rejected.
Test: PTS test TP/LE/CFC/BV-20-C done by Intel (originator
of this change).
Change-Id: I094a4058ac0e7bb9d7344e66d9feafee17bc3d53
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
(cherry picked from commit
a252e78152f27ed07285ecf187ace83a12bca06b)
Jack He [Thu, 4 May 2017 20:27:25 +0000 (13:27 -0700)]
Fix broken linux build
* Generic linux does not have property_get_int32. Instead,
osi_property_get_int32() is created to handle OS_GENERIC cases
* Some linux header have sigevent.sigev_notify_attributes typed as
(pthread_attr_t *) whereas others typed it as (void *), as any pointer
can be implicitly casted to (void *), the current casting to (void *)
is unncessary and will break build on systems using (pthread_attr_t *)
Test: make, unit test, no user visible effect
Change-Id: I24b33da453dc9d40656168a3bcd900d9c99219ce
(cherry picked from commit
2b59c4a0843c9f2782cf4163f921eddb31dd6ff9)
Marie Janssen [Fri, 14 Apr 2017 21:07:19 +0000 (14:07 -0700)]
btif: GetItemAttributes can return no attributes
If there are no attributes available, it's possible to return zero
attributes from a GetItemAttributes request.
This is triggered by some carkits who are unhappy when they only get
titles back (the only required item) and ask for the rest of the
attributes (which we don't have).
Test: connect to honda carkit and get snoop logs to confirm
Bug:
36055995
Bug:
35956792
Change-Id: I5a31e206565d212e456111d8c6b542c7a1569e5a
(cherry picked from commit
840f4f3de98c7d6c83abae89f0b41990bc56fef4)
Jack He [Wed, 10 May 2017 19:05:25 +0000 (12:05 -0700)]
Remove include for log/log.h in l2c_main.cc
* log/log.h is not supported by linux build and is handled by
osi/include/log.h
* Thus, it shouldn't be included in l2c_main.cc, which breaks the linux
build
Test: make on both linux and Android, no functional effect
Change-Id: I0c974b754b43d7b73adea2a91078b85e22b3b14e
Jakub Pawlowski [Fri, 28 Apr 2017 21:59:46 +0000 (14:59 -0700)]
LE advertise data parsing refactor
* merge BTM_CheckAdvData and BTM_CheckEirData into GetFieldByType
* check wether AD data is properly formatted when the packet is
received. Some controllers were returning malformed data that
resulted in stack crashes for BT5 packets.
* add tests to verify the helpers work as expected
Test: added net_test_stack_ad_parser
Bug:
37671082
Change-Id: I49e43d7cf7d0a8ace1ee45d9b14b2b8440096b05
(cherry picked from commit
103b2c44d3db6172a2dc9319e215eeece504316e)
Jakub Pawlowski [Fri, 28 Apr 2017 12:15:16 +0000 (05:15 -0700)]
Check device name length
BT spec limits the length of device name to 248 bytes. With the new
LE advertising packets, that can go up to 1650 bytes long, we must check
the length of device name received.
Bug:
37671082
Test: manual
Change-Id: Iad309d638003c2391014c9764605d84ed5717cb1
(cherry picked from commit
3a4e7622ff07772a512052c23cada59f5830941f)
TreeHugger Robot [Fri, 5 May 2017 22:17:39 +0000 (22:17 +0000)]
Merge "Revert "Revert "Make Bluetooth audio threads use RT scheduling""" into oc-dev
Ajay Panicker [Fri, 28 Apr 2017 22:26:38 +0000 (15:26 -0700)]
Move hci_thread to a message loop and prevent thread from spinning
Before this patch, if there was a message on the command queue and
there were no command credits, the thread reactor would spin trying
to process the message on the command queue and would continue until
a credit was received. This led to a bug where upon switching users,
hci_thread would spin and try to use 100% of the CPU. This is fixed
by moving over to a message loop and queue system. The message loop
processes all the messages. If there aren't enough command credits,
command messages are deferred to the command queue and popped off
whenever more credits are aquired. The deferred queue has priority
to credits over recently posted messages.
Bug:
37733903
Test: Swap users with the real time scheduling patch applied, and
general Bluetooth usage.
TestTracker: 86249
Change-Id: Ib775e47f6d4810d3d7d8af5b3ba84adc4ada3da5
Sridhar Vashist [Fri, 5 May 2017 01:21:52 +0000 (01:21 +0000)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links. am:
7d3de37da0 -s ours
am:
6c0de854a3 -s ours
Change-Id: I1461d75a0cdf2fb5a209b094df02830092c05141
Sridhar Vashist [Fri, 5 May 2017 01:17:20 +0000 (01:17 +0000)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.
am:
7d3de37da0 -s ours
Change-Id: I90f535c99d45ebf0def0b2b08031a21f998c1c2e
Sridhar Vashist [Fri, 28 Oct 2016 18:37:49 +0000 (13:37 -0500)]
DO NOT MERGE ANYWHERE Disable 3Mbps packets for AVDT ACL links.
3DH packets have a lower tolerance to background noise. A2DP requiring higher
bandwidth & realtime playback is especially suscepitble in this scenario.
Bug:
37515006
Test: oem manual
Change-Id: Id4d7452a86fe864eceb88a9fb16a40dc921a1e13
Ajay Panicker [Thu, 4 May 2017 22:56:16 +0000 (22:56 +0000)]
Merge "Limit btsnoop file size (5/9)" into oc-dev
Jakub Pawlowski [Thu, 4 May 2017 20:22:57 +0000 (20:22 +0000)]
Merge "Add supervision timeout workaround for Nexus Remote" into oc-dev
Jakub Pawlowski [Tue, 28 Mar 2017 19:58:34 +0000 (12:58 -0700)]
Add supervision timeout workaround for Nexus Remote
The Nexus Remote would report 100ms supervision timeout in its preferred
connection parameters. In some noisy environments, this might cause
connection to be dropped. As a workaround, set the timeout to 3s for the
remote.
Test: manual
Bug:
36645397
Bug:
37717216
Change-Id: I665a854e9d55067ec1aca273c31d06c6114c48be
(cherry picked from commit
9e6747537a4a2c0143c26ab31e4597a017372e5f)
Pavlin Radoslavov [Thu, 4 May 2017 05:48:28 +0000 (22:48 -0700)]
Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability
The A2DP AAC Source capabilty should not include 96.0 and 88.2 kHz
sample rate - those were included unintentionally without being tested.
Bug:
37968743
Test: A2DP AAC streaming
Change-Id: Ia3228d4d14d3288acfda42fbaf8ab248ae530b48
(cherry picked from commit
4b93aeb450c4e42a80d8519528dc8fcfacc1d964)
Philip Cuadra [Wed, 3 May 2017 04:00:02 +0000 (21:00 -0700)]
Revert "Revert "Make Bluetooth audio threads use RT scheduling""
This reverts commit
feb2d84f4b69392b5f37ae1ec9d53ac728514275.
Bluetooth threads that are used in audio have deadline
requirements for glitchless playback. Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.
Bug
37518404
Test: play Bluetooth audio, check for RT with systrace
(cherry picked from commit
96c42e70f5c6a74a737739aa9c297cd93540f43e)
Andy Hung [Mon, 1 May 2017 22:04:57 +0000 (15:04 -0700)]
audio_a2dp_hw: fix fd leak on open
Open hal fds can be checked by
adb shell lsof | grep audio@2. | grep socket | wc
Test: connect and disconnect BT, check open fd.
Bug:
37726871
Change-Id: Id446c43515eceb0828cfb33807a4c0b4c6145a6d
Jacky Cheung [Mon, 17 Apr 2017 20:38:39 +0000 (13:38 -0700)]
Do not GATT_ERROR on MTU change
Bug:
37305498
Test: manual on MSM8909
Change-Id: I07389620efc914d0ece52262edc2c35b498d5564
(cherry picked from commit
f271c9109e5608acb393c9bef0bca9d2b0177f5d)
TreeHugger Robot [Sat, 29 Apr 2017 21:06:54 +0000 (21:06 +0000)]
Merge "Move ad2p back to system." into oc-dev
Jacky Cheung [Sat, 29 Apr 2017 03:55:00 +0000 (03:55 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev am:
b055f8b68a -s ours
am:
f67b6bfa1b -s ours
Change-Id: I94a81ea270037bd5fc7420a52819421125fc5b5b
Jacky Cheung [Sat, 29 Apr 2017 03:52:59 +0000 (03:52 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev
am:
b055f8b68a -s ours
Change-Id: I7b31a9bb0a09d3e7bbb2b666331f4ac47a93efff
Jacky Cheung [Sat, 29 Apr 2017 03:48:18 +0000 (03:48 +0000)]
Merge "DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing" into cw-f-dev
Jakub Pawlowski [Thu, 27 Apr 2017 11:52:34 +0000 (04:52 -0700)]
DO NOT MERGE ANYWHERE Fix LE disconnecting right after pairing
When a device connect to android over LE, the default policy is to keep
this connection. If any app "claims" this connnection, and then stop
using it, we'll disconnect from the device after a short timeout.
If pairing is triggered to such device, that is connected but not used
by any app, it will cause disconnect after the pairing is finished. This
is because using SMP over fixed LE L2CAP channel is conseidered as
connecting, using, and disconnecting a channel by the stack. This is
obvious logic error - using fixed channels should not require
"connecting" to them.
As a temporary workaround, do not trigger a timeout when a fixed SMP
channel is closed over LE.
For LE only devices, this means they will stay connected after the
pairing until some app starts using them or they disconnect. For dual
mode devices, Classic connection will be established and SDP will be
performed. The classic connection will be disconnected if no app will
use it, and the LE connection to the device will stay up.
Bug:
37352720
Test: manual
Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6
(cherry picked from commit
7c8bab231328956d3b7569280cb162be4e345422)
Steven Moreland [Thu, 27 Apr 2017 21:14:35 +0000 (14:14 -0700)]
Move ad2p back to system.
Test: built to vendor
Fixes:
37681782
Change-Id: I08542090d6b371e3c6de2e65d5c68d0f14c76737
Philip Cuadra [Fri, 28 Apr 2017 01:31:47 +0000 (01:31 +0000)]
Merge "Revert "Make Bluetooth audio threads use RT scheduling"" into oc-dev
Philip Cuadra [Fri, 28 Apr 2017 01:27:09 +0000 (01:27 +0000)]
Revert "Make Bluetooth audio threads use RT scheduling"
This reverts commit
eaa42774f393eb3ccaee91a958e8df6a8fb09b91.
http://b/
37733903
Test: confirmed switching users does not hang.
Change-Id: Ic54e4ed2dda057e681df225a37a574c221cd8fc3
Jakub Pawlowski [Thu, 27 Apr 2017 22:20:37 +0000 (22:20 +0000)]
Merge changes from topic 'bt5-cherry-pickerry-3' into oc-dev
* changes:
Fix LE disconnecting right after pairing
Handle remote not supporting LL_SLAVE_FEATURE_REQ
Expose LE advertiser address for easier PTS tests (4/6)
Read by UUID for PTS tests (4/5)
Ajay Panicker [Tue, 18 Apr 2017 03:53:24 +0000 (20:53 -0700)]
Limit btsnoop file size (5/9)
Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.
Bug:
35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: Ia8741223cb31b2c20d9ef5607e9204cc3946b165
Change-Id: Ia8741223cb31b2c20d9ef5607e9204cc3946b165
Jacky Cheung [Wed, 26 Apr 2017 17:27:41 +0000 (10:27 -0700)]
Fix issue with BLE advertising not started when local privacy is not enabled
Bug:
37282500
Test: manual
Change-Id: I44657d0b3315bc241373c8cbaf6a2b6a6e49f31d
Jakub Pawlowski [Thu, 27 Apr 2017 11:52:34 +0000 (04:52 -0700)]
Fix LE disconnecting right after pairing
When a device connect to android over LE, the default policy is to keep
this connection. If any app "claims" this connnection, and then stop
using it, we'll disconnect from the device after a short timeout.
If pairing is triggered to such device, that is connected but not used
by any app, it will cause disconnect after the pairing is finished. This
is because using SMP over fixed LE L2CAP channel is conseidered as
connecting, using, and disconnecting a channel by the stack. This is
obvious logic error - using fixed channels should not require
"connecting" to them.
As a temporary workaround, do not trigger a timeout when a fixed SMP
channel is closed over LE.
For LE only devices, this means they will stay connected after the
pairing until some app starts using them or they disconnect. For dual
mode devices, Classic connection will be established and SDP will be
performed. The classic connection will be disconnected if no app will
use it, and the LE connection to the device will stay up.
Bug:
37352720
Test: manual
Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6
(cherry picked from commit
7c8bab231328956d3b7569280cb162be4e345422)
Jakub Pawlowski [Mon, 24 Apr 2017 13:34:11 +0000 (06:34 -0700)]
Handle remote not supporting LL_SLAVE_FEATURE_REQ
Test: for PTS
Change-Id: I3030a068c1c4980fa7cbb23b478afbe441584869
(cherry picked from commit
341b6db90d67e76ea9262c5e9f3ba5063cb93598)
Jakub Pawlowski [Wed, 19 Apr 2017 14:05:00 +0000 (07:05 -0700)]
Expose LE advertiser address for easier PTS tests (4/6)
This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.
Bug:
35147497
Test: manual
Change-Id: I5ad554d872f2b772f2bf91642a9648c4018d935c
(cherry picked from commit
779b4fd786c571cb8013f4d94ddacfe7116fb05f)
Jakub Pawlowski [Fri, 14 Apr 2017 14:27:49 +0000 (07:27 -0700)]
Read by UUID for PTS tests (4/5)
Add a hidden api for reading characteristic by UUID for PTS.
Bug:
35150313
Test: sl4a GattReadTest.byUuid
Change-Id: I072473c5f7b761707774efd89f8a22bfdf012135
(cherry picked from commit
7dd34f52bc950bae2fb1b30b17da0ff34ee016aa)
Philip Cuadra [Thu, 23 Mar 2017 17:10:34 +0000 (10:10 -0700)]
Make Bluetooth audio threads use RT scheduling
Bluetooth threads that are used in audio have deadline
requirements for glitchless playback. Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.
Bug
37518404
Test: play Bluetooth audio, check for RT with systrace
Merged-In: I4505fbce55e5a4fe18d00dbda23646a60e482efd
Change-Id: I4505fbce55e5a4fe18d00dbda23646a60e482efd
(cherry picked from commit
96c42e70f5c6a74a737739aa9c297cd93540f43e)
TreeHugger Robot [Tue, 25 Apr 2017 17:39:47 +0000 (17:39 +0000)]
Merge "Add missing library dependency when compiling the unit tests" into oc-dev
Pavlin Radoslavov [Tue, 25 Apr 2017 00:37:20 +0000 (17:37 -0700)]
Add missing library dependency when compiling the unit tests
This fixes a compilation issue when compiling with ASAN enabled.
Bug:
37624756
Test: make -j 40 SANITIZE_TARGET='address coverage' tests
Change-Id: I9caa3d404e60ee105435539744ed2b8ccf353700
(cherry picked from commit
044921b223868595a6f96709020b46349b05fa45)
Hemant Gupta [Wed, 12 Apr 2017 18:26:15 +0000 (23:56 +0530)]
AVRCP 1.6: Limit GetFolderItemResponse
Usecase:
1) Connect from AVRCP Controller supporting browsing
having low L2CAP MTU eg 672.
2) Request for get folder items with large request items,
response for which will exceed MTU size.
Expected Result:
As per AVRCP 1.6 Spec, section 29.20 pg 178, response should be
limited to number of completed get folder items that can fit in
single AVCTP Browsing channel MTU even if the completed items
are less than actually requested by AVRCP Controller.
Observation:
DUT responding with Internal Error.
Root Cause:
When there is no space to fill complete Get Folder Item response
within MTU size, DUT was returning error.
Fix:
Send max completed items which can fit in single MTU packet.
Test: Checked if the remote device can receive the truncated
response and get folder items succeeds when remote device
reissues get folder item request with updated start list count.
Frequency: 5/5
Bug:
37304477
Change-Id: I1963f97075382fc8333038e3efffaf61a9d84a28
(cherry picked from commit
a7c7437bbffe133f9192b9ca82b5b4e1f6d9835a)
Stanley Tng [Tue, 18 Apr 2017 05:38:38 +0000 (22:38 -0700)]
Allow the Bluetooth MAC address to be updated asynchronously (3/3)
There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.
Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug:
36709382
Change-Id: I7b1c526ee227897c003ac921078f317f96b92604
(cherry picked from commit
7dc0525365025e17e289869288b1b7d5146306cc)
Zach Johnson [Fri, 21 Apr 2017 21:07:06 +0000 (21:07 +0000)]
Merge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev am:
b53535d61b -s ours
am:
1238329f28 -s ours
Change-Id: I5995614654f92977a6118ea365f1575e97acfbc1
Zach Johnson [Fri, 21 Apr 2017 21:06:23 +0000 (21:06 +0000)]
DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy am:
c61ef79a79 -s ours
am:
31dfa53ba0 -s ours
Change-Id: Ic94d0bb3152b25c3d4c4b4d033c9a80a358727f3
Zach Johnson [Fri, 21 Apr 2017 21:04:06 +0000 (21:04 +0000)]
Merge "DO NOT MERGE ANYWHERE Allow blocking AG SCO connects by policy" into cw-f-dev
am:
b53535d61b -s ours
Change-Id: I2399d1832fe643ef0057c2c4d0b0fa4bf860e760