OSDN Git Service

android-x86/system-bt.git
7 years agoeSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)
Myles Watson [Thu, 11 May 2017 01:59:29 +0000 (01:59 +0000)]
eSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)
am: 3e634d6c1e

Change-Id: I99fff15789f389fe71f140db81bceac3bac42b71

7 years agoeSCO: BT 4.1 Enhanced SCO command (1/5)
Mudumba Ananth [Thu, 11 May 2017 01:59:16 +0000 (01:59 +0000)]
eSCO: BT 4.1 Enhanced SCO command (1/5)
am: 57f6508cf7

Change-Id: Ic45dc0c4bae5c40f3d144246efe1d3e2603e8b4b

7 years agoMerge "HID: Add support for Set Idle and Get Idle commands (2/4)"
Andre Eisenbach [Thu, 11 May 2017 00:44:03 +0000 (00:44 +0000)]
Merge "HID: Add support for Set Idle and Get Idle commands (2/4)"
am: 642e53b17f

Change-Id: I6087d0517494ff36810c71c5e3ffa1d337c4f9f2

7 years agoMerge "HID: Add support for Set Idle and Get Idle commands (2/4)"
Andre Eisenbach [Thu, 11 May 2017 00:37:42 +0000 (00:37 +0000)]
Merge "HID: Add support for Set Idle and Get Idle commands (2/4)"

7 years agoeSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)
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

7 years agoeSCO: BT 4.1 Enhanced SCO command (1/5)
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

7 years agobtif: GetItemAttributes can return no attributes
Marie Janssen [Wed, 10 May 2017 20:05:22 +0000 (20:05 +0000)]
btif: GetItemAttributes can return no attributes
am: 840f4f3de9

Change-Id: I6f63ea40bfd90552ad32ae2c25a3576676e42b0b

7 years agobtif: GetItemAttributes can return no attributes
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

7 years agoGATT Server: check UUID
Jakub Pawlowski [Wed, 10 May 2017 17:31:35 +0000 (17:31 +0000)]
GATT Server: check UUID
am: 671ad6679c

Change-Id: I54da771e90d8d206f7fd0d4118072199a046eadb

7 years agoGATT Server: check UUID
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

7 years agoHID: Add support for Set Idle and Get Idle commands (2/4)
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)

Provides an interface for application to send Set Idle
and Get Idle commands to remote HID Device. Support for these
two commands was missing from existing code, so existing code
design is reused to add support for these two commands.

Without this support following mandatory PTS test cases for HID 1.0
cannot be passed, TC_HOS_HID_BV_05/06.

Test: Executed PTS tests TC_HOS_HID_BV_05/06 and confirmed if they can
pass

Bug: 34344715
Change-Id: I14bc2dc349354fd87ef8aba25357514398532e87

7 years agoFix broken linux build
Jack He [Wed, 10 May 2017 02:37:03 +0000 (02:37 +0000)]
Fix broken linux build
am: 2b59c4a084

Change-Id: I2acaae3044cba1e50647e21c1104218211294b79

7 years agoFix broken linux build
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

7 years agoMerge "Swap BTA and HCI queues with message loops"
Ajay Panicker [Mon, 8 May 2017 19:34:28 +0000 (19:34 +0000)]
Merge "Swap BTA and HCI queues with message loops"
am: f5db809606

Change-Id: I499fd6260777c054fa1763d1febf9be01234f1bc

7 years agoMerge "Swap BTA and HCI queues with message loops"
Treehugger Robot [Mon, 8 May 2017 19:27:33 +0000 (19:27 +0000)]
Merge "Swap BTA and HCI queues with message loops"

7 years agoMerge "Reject LE COC if cid is duplicated"
Andre Eisenbach [Mon, 8 May 2017 19:19:57 +0000 (19:19 +0000)]
Merge "Reject LE COC if cid is duplicated"
am: 95e3c5ac39

Change-Id: I16e1c8bc032df0215f72187639fe9e8a31444192

7 years agoMerge "Reject LE COC if cid is duplicated"
Andre Eisenbach [Mon, 8 May 2017 19:13:56 +0000 (19:13 +0000)]
Merge "Reject LE COC if cid is duplicated"

7 years agoAdd additional failure modes for SMP PTS test cases
ravishankar srivatsa [Mon, 8 May 2017 18:01:51 +0000 (18:01 +0000)]
Add additional failure modes for SMP PTS test cases
am: fd102ca161

Change-Id: Ie808ef38dcd0367b54eee0f66362e4c2dac04407

7 years agoSwap BTA and HCI queues with message loops
Ajay Panicker [Wed, 1 Mar 2017 18:00:30 +0000 (10:00 -0800)]
Swap BTA and HCI queues with message loops

Swapping out the queues with base::MessageLoop allows for an easier refactor
of alarms as we can just replace them with an instance of base::Timer. Also
refactored out the data_dispatcher as most of the code wasn't being used.

Bug: 37245162
Test: Bluetooth sanity test and listening to music
      added net_test_btu_message_loop
Change-Id: I73c359f07a225733dc89f51422a6a24ce807c593

7 years agoReject LE COC if cid is duplicated
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.

Change-Id: I094a4058ac0e7bb9d7344e66d9feafee17bc3d53
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
7 years agoAdd additional failure modes for SMP PTS test cases
ravishankar srivatsa [Thu, 4 May 2017 04:43:58 +0000 (10:13 +0530)]
Add additional failure modes for SMP PTS test cases

SM/MAS/SCJW/BI-01-C [Just Works, IUT Initiator, Secure Connections -Pairing Failed
For Lower tester to handle step 15.
Lower Tester responds with a Pairing Failed command in phase 2 with reason code
0x0C (Numeric Comparison Failed).

Bug: 37707831
Change-Id: Ia7103330d1d1ecb06e39502c2a0976585b203ba5
Signed-off-by: Ravishankar Srivatsa <Ravishankar.Srivatsa@intel.com>
Test: manual

7 years agobta_dm: Stop copying garbage
Martin Brabham [Sat, 6 May 2017 03:00:31 +0000 (03:00 +0000)]
bta_dm: Stop copying garbage
am: 36d19de1aa

Change-Id: Ie723a15c8f9f9280dd93beaccbada8a1458b8717

7 years agobta_dm: Stop copying garbage
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

7 years agoMove hci_thread to a message loop and prevent thread from spinning
Ajay Panicker [Sat, 6 May 2017 00:27:09 +0000 (00:27 +0000)]
Move hci_thread to a message loop and prevent thread from spinning
am: 48294531bf

Change-Id: I4b1e3da909a4cd6125c17f4dc56a0d73aad31f70

7 years agoMove hci_thread to a message loop and prevent thread from spinning
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
(cherry picked from commit ffee0ee8a102101ded1d3fa398f20c4215e0c441)

7 years agoLE advertise data parsing refactor
Jakub Pawlowski [Fri, 5 May 2017 22:05:19 +0000 (22:05 +0000)]
LE advertise data parsing refactor
am: 103b2c44d3

Change-Id: I467cf2628393c11d316ad12664aa04f19106f036

7 years agoLE advertise data parsing refactor
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

7 years agoCheck device name length
Jakub Pawlowski [Fri, 5 May 2017 08:51:50 +0000 (08:51 +0000)]
Check device name length
am: 3a4e7622ff

Change-Id: Ie5935fa0bb9b15c2a3caae3db43fdaebf4a83002

7 years agoCheck device name length
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

7 years agoMerge "Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability"
Pavlin Radoslavov [Thu, 4 May 2017 18:27:24 +0000 (18:27 +0000)]
Merge "Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability"
am: d861719531

Change-Id: Iee78e052c01a772f30c6dcf19a9bf97036751f5c

7 years agoMerge "Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability"
Treehugger Robot [Thu, 4 May 2017 18:23:50 +0000 (18:23 +0000)]
Merge "Remove 96.0 and 88.2 kHz sample rate from A2DP AAC capability"

7 years agoAdd supervision timeout workaround for Nexus Remote
Jakub Pawlowski [Thu, 4 May 2017 16:49:44 +0000 (16:49 +0000)]
Add supervision timeout workaround for Nexus Remote
am: 9e6747537a

Change-Id: I89970cc9eaf72cbbbae294dc1a6816b612ed7579

7 years agoAdd supervision timeout workaround for Nexus Remote
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

7 years agoRemove 96.0 and 88.2 kHz sample rate from A2DP AAC capability
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

7 years agoaudio_a2dp_hw: fix fd leak on open
Andy Hung [Wed, 3 May 2017 01:44:11 +0000 (01:44 +0000)]
audio_a2dp_hw: fix fd leak on open
am: 2ae1ddbb73

Change-Id: Ieed84c659c4b10d126ab31cf0d2fe1ad15083e27

7 years agoaudio_a2dp_hw: fix fd leak on open
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
(cherry picked from commit cef156574c9928164b7a5e263a5494cf61ca39d8)

7 years agoPrevent buffer overflow caused by decrementing past zero
Ajay Panicker [Fri, 28 Apr 2017 00:20:40 +0000 (00:20 +0000)]
Prevent buffer overflow caused by decrementing past zero
am: 882db61b73

Change-Id: I1de124b2baf7dd3c691df95680c20600680841c0

7 years agoPrevent buffer overflow caused by decrementing past zero
Ajay Panicker [Tue, 13 Dec 2016 18:51:12 +0000 (10:51 -0800)]
Prevent buffer overflow caused by decrementing past zero

Bug: 33555809
Test: Sanity test with Bluetooth
Change-Id: I4c82d3c162ffdc9436f9cd8985061655a055774b

7 years agoFix LE disconnecting right after pairing
Jakub Pawlowski [Thu, 27 Apr 2017 19:30:24 +0000 (19:30 +0000)]
Fix LE disconnecting right after pairing
am: 7c8bab2313

Change-Id: I22b794624d6f3b51d1e0089802cbf53c64305b51

7 years agoFix LE disconnecting right after pairing
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

7 years agoLimit btsnoop file size (5/8)
Ajay Panicker [Thu, 27 Apr 2017 17:39:55 +0000 (17:39 +0000)]
Limit btsnoop file size (5/8)
am: 99c3422442

Change-Id: I015663966b19215d7ea4c3add0ed93948430df64

7 years agoLimit btsnoop file size (5/8)
Ajay Panicker [Tue, 18 Apr 2017 03:53:24 +0000 (20:53 -0700)]
Limit btsnoop file size (5/8)

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

7 years agoFix issue with BLE advertising not started when local privacy is not enabled
Jacky Cheung [Wed, 26 Apr 2017 22:27:57 +0000 (22:27 +0000)]
Fix issue with BLE advertising not started when local privacy is not enabled
am: afdd081b4b

Change-Id: I22817c79ffc0d7749261b18bcbd608fad70c20d3

7 years agoFix issue with BLE advertising not started when local privacy is not enabled
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

7 years agoMake Bluetooth audio threads use RT scheduling
Philip Cuadra [Wed, 26 Apr 2017 17:02:11 +0000 (17:02 +0000)]
Make Bluetooth audio threads use RT scheduling
am: 96c42e70f5

Change-Id: Idcea625a9ca29fe5f5b4c0cc81e74e28d3670b04

7 years agoMake Bluetooth audio threads use RT scheduling
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
Change-Id: I4505fbce55e5a4fe18d00dbda23646a60e482efd

7 years agoMerge "Handle remote not supporting LL_SLAVE_FEATURE_REQ"
Jakub Pawlowski [Tue, 25 Apr 2017 10:40:29 +0000 (10:40 +0000)]
Merge "Handle remote not supporting LL_SLAVE_FEATURE_REQ"
am: e3caefe394

Change-Id: I15ab18d2f7aec748287c0420f143c4a57e8a0e4f

7 years agoMerge "Handle remote not supporting LL_SLAVE_FEATURE_REQ"
Treehugger Robot [Tue, 25 Apr 2017 10:35:03 +0000 (10:35 +0000)]
Merge "Handle remote not supporting LL_SLAVE_FEATURE_REQ"

7 years agoAdd missing library dependency when compiling the unit tests
Pavlin Radoslavov [Tue, 25 Apr 2017 05:06:37 +0000 (05:06 +0000)]
Add missing library dependency when compiling the unit tests
am: 044921b223

Change-Id: I491edb09f445b5aca0948c134cb78a0334804043

7 years agoAdd missing library dependency when compiling the unit tests
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

7 years agoAVRCP 1.6: Limit GetFolderItemResponse
Hemant Gupta [Tue, 25 Apr 2017 00:08:46 +0000 (00:08 +0000)]
AVRCP 1.6: Limit GetFolderItemResponse
am: a7c7437bbf

Change-Id: I6e0eedf6a7486aadcb6fabf214f1bafa2efd2233

7 years agoHandle remote not supporting LL_SLAVE_FEATURE_REQ
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

7 years agoAVRCP 1.6: Limit GetFolderItemResponse
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

7 years agoAllow the Bluetooth MAC address to be updated asynchronously (3/3)
Stanley Tng [Fri, 21 Apr 2017 01:25:06 +0000 (01:25 +0000)]
Allow the Bluetooth MAC address to be updated asynchronously (3/3)
am: 7dc0525365

Change-Id: Ia26ccf1307446e2ea3dc9cbe3d90fc07fa7b168c

7 years agoAllow the Bluetooth MAC address to be updated asynchronously (3/3)
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

7 years agoExpose LE advertiser address for easier PTS tests (4/6)
Jakub Pawlowski [Wed, 19 Apr 2017 21:38:22 +0000 (21:38 +0000)]
Expose LE advertiser address for easier PTS tests (4/6)
am: 779b4fd786

Change-Id: Ic8fc5e79e6f74aaf778b0c5e39e2308dceb583be

7 years agoMerge changes from topics 'bt-a2dp-ldac-abr-adjustments', 'bt-a2dp-ldac-dropped-count'
Pavlin Radoslavov [Wed, 19 Apr 2017 21:35:10 +0000 (21:35 +0000)]
Merge changes from topics 'bt-a2dp-ldac-abr-adjustments', 'bt-a2dp-ldac-dropped-count'
am: 71cb1b834e

Change-Id: If9fd4741055889e2c81720cdceb65889570a66c3

7 years agoExpose LE advertiser address for easier PTS tests (4/6)
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

7 years agoMerge changes from topics 'bt-a2dp-ldac-abr-adjustments', 'bt-a2dp-ldac-dropped-count'
Pavlin Radoslavov [Wed, 19 Apr 2017 21:27:56 +0000 (21:27 +0000)]
Merge changes from topics 'bt-a2dp-ldac-abr-adjustments', 'bt-a2dp-ldac-dropped-count'

* changes:
  Print the LDAC adaptive bit rate adjustments
  Fix/update the computation of the total dropped packets for LDAC and AAC

7 years agoMerge "Remove libbt-vendor from system/bt/main/Android.bp"
Myles Watson [Wed, 19 Apr 2017 20:36:37 +0000 (20:36 +0000)]
Merge "Remove libbt-vendor from system/bt/main/Android.bp"
am: 285b7035f5

Change-Id: I5dc76c1ca7c6fa7a5124707242aa80d9b8394fe4

7 years agotest_vendor: Remove unused libbt-vendor files
Myles Watson [Wed, 19 Apr 2017 20:36:24 +0000 (20:36 +0000)]
test_vendor: Remove unused libbt-vendor files
am: 10b43d2fa0

Change-Id: I657ea0ebe5ed278c543d6bad6fa924332df32092

7 years agoMerge "Remove libbt-vendor from system/bt/main/Android.bp"
Treehugger Robot [Wed, 19 Apr 2017 20:31:45 +0000 (20:31 +0000)]
Merge "Remove libbt-vendor from system/bt/main/Android.bp"

7 years agotest_vendor: Remove unused libbt-vendor files
Myles Watson [Mon, 17 Apr 2017 20:43:05 +0000 (13:43 -0700)]
test_vendor: Remove unused libbt-vendor files

Bug: 36810308
Test: builds
Change-Id: I50b4a3efaac622959dbf25c0f854d455057e6f3e

7 years agoRemove libbt-vendor from system/bt/main/Android.bp
Myles Watson [Tue, 7 Mar 2017 12:57:03 +0000 (04:57 -0800)]
Remove libbt-vendor from system/bt/main/Android.bp

Platforms that need libbt-vendor, which is deprecated, should include the
build dependency in device.mk.

Bug: 36810308
Test: Angler Bluetooth starts/stops
Change-Id: I0e37bf48536ca134493aaa3a496bafb3b80cd882

7 years agoMerge "bta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0"
Bailey Forrest [Wed, 19 Apr 2017 20:11:28 +0000 (20:11 +0000)]
Merge "bta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0"
am: 27a9864f9f

Change-Id: I57a83cb501da230abaabacb35c3c6562f6c3a1f3

7 years agoMerge "bta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0"
Treehugger Robot [Wed, 19 Apr 2017 20:07:46 +0000 (20:07 +0000)]
Merge "bta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0"

7 years agoFix line formatting per clang-format
Pavlin Radoslavov [Wed, 19 Apr 2017 19:20:23 +0000 (19:20 +0000)]
Fix line formatting per clang-format
am: ce48fc7525

Change-Id: I4a8916a40ca92b6baaee1199f7d568fb597d6783

7 years agoFix line formatting per clang-format
Pavlin Radoslavov [Wed, 19 Apr 2017 18:44:19 +0000 (11:44 -0700)]
Fix line formatting per clang-format

The fix is needed to resolve a merge conflict.

Test: Code compilation
Change-Id: I41cd79db1750b526fafa33e097c56a7cb46ba6af

7 years agoPrint the LDAC adaptive bit rate adjustments
Pavlin Radoslavov [Wed, 19 Apr 2017 17:50:16 +0000 (10:50 -0700)]
Print the LDAC adaptive bit rate adjustments

A2DP LDAC State:
  ...
  LDAC quality mode                                       : ABR
  LDAC transmission bitrate (Kbps)                        : 990
  LDAC saved transmit queue length                        : 0
  LDAC adaptive bit rate encode quality mode index        : 0
  LDAC adaptive bit rate adjustments                      : 4

Test: A2DP streaming to headsets that support LDAC
Bug: 37287785
Change-Id: Ife8017ca129fa9b06ea85f6029c553a52a306cc2

7 years agoFix/update the computation of the total dropped packets for LDAC and AAC
Pavlin Radoslavov [Wed, 19 Apr 2017 03:05:39 +0000 (20:05 -0700)]
Fix/update the computation of the total dropped packets for LDAC and AAC

Also:
 * Print the "LDAC transmission bitrate (Kbps)"
 * Print the "LDAC adaptive bit rate encode quality mode index"
   when the LDAC quality mode is ABR

A2DP LDAC State:
  ...
  LDAC quality mode                                       : ABR
  LDAC transmission bitrate (Kbps)                        : 990
  LDAC saved transmit queue length                        : 0
  LDAC adaptive bit rate encode quality mode index        : 0

Test: A2DP streaming to headsets that support LDAC
Bug: 37287785
Change-Id: I83b22090b087eb8a1e49d1853468b7dbbf9d9ad3

7 years agoManually merge commit '08215a3375a1e79fc9c1b2d12eba2ff26298910d' into stage-aosp...
The Android Automerger [Wed, 19 Apr 2017 15:35:44 +0000 (15:35 +0000)]
Manually merge commit '08215a3375a1e79fc9c1b2d12eba2ff26298910d' into stage-aosp-master

7 years agoRead by UUID for PTS tests (4/5)
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

7 years agoMerge "Read by UUID for PTS tests (4/5)"
Treehugger Robot [Wed, 19 Apr 2017 06:08:48 +0000 (06:08 +0000)]
Merge "Read by UUID for PTS tests (4/5)"

7 years agobta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0
Bailey Forrest [Wed, 19 Apr 2017 04:04:10 +0000 (21:04 -0700)]
bta_gattc_cache: Initialize gatt_db_elemement_t permissions to 0

Previously this value was uninitialized. Attribute permissions are not
discovable via the attribute protocol.

Bug: None
Test: Build. permissions are 0.
Change-Id: I5fdac3b90683245a0af0d6e27a2873499ca90e6c

7 years agoMerge "AVRCP TG: Get Item Attribute command not working"
Hemant Gupta [Wed, 19 Apr 2017 00:48:18 +0000 (00:48 +0000)]
Merge "AVRCP TG: Get Item Attribute command not working"
am: d2aa2fc95b

Change-Id: I674de144b19bc97c540d7f806c16cb3f29cb3f95

7 years agoMerge "AVRCP TG: Get Item Attribute command not working"
Treehugger Robot [Wed, 19 Apr 2017 00:41:26 +0000 (00:41 +0000)]
Merge "AVRCP TG: Get Item Attribute command not working"

7 years agostack: AVRCP: add missing debug arguments
Hemant Gupta [Tue, 18 Apr 2017 22:15:03 +0000 (22:15 +0000)]
stack: AVRCP: add missing debug arguments
am: 2dc048b0ed

Change-Id: I11e19332f16c577353f811ab87bcc384d9cdfcac

7 years agostack: AVRCP: add missing debug arguments
Hemant Gupta [Fri, 14 Apr 2017 06:37:37 +0000 (12:07 +0530)]
stack: AVRCP: add missing debug arguments

Fixes a crash while sending AVRCP Get Item Attribute response due to missing
function arguments.

Test: test with BMW kit, Crysler kit which trigger this bug

Bug: 37334553
Fixes: 37474772
Change-Id: Ie129e22e427896028a50e6b0ae8c2cdd151b0ea1

7 years agoRead by UUID for PTS tests (4/5)
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

7 years agoDo not GATT_ERROR on MTU change
Jacky Cheung [Tue, 18 Apr 2017 01:03:02 +0000 (01:03 +0000)]
Do not GATT_ERROR on MTU change
am: f271c9109e

Change-Id: Iab8d8d1c770b8d93fb62ff2210b55b23cd08d990

7 years agoDo not GATT_ERROR on MTU change
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

7 years agoAdd missing NULL pointer assignment after fixed_queue_free and alarm_free
Pavlin Radoslavov [Mon, 17 Apr 2017 22:27:50 +0000 (22:27 +0000)]
Add missing NULL pointer assignment after fixed_queue_free and alarm_free
am: 86ae6c0200

Change-Id: I611bb32f00f1665707d810f7355b20ec696cb2b9

7 years agoAdd missing NULL pointer assignment after fixed_queue_free and alarm_free
Pavlin Radoslavov [Fri, 14 Apr 2017 10:45:18 +0000 (03:45 -0700)]
Add missing NULL pointer assignment after fixed_queue_free and alarm_free

Bug: 37285767
Test: Code compilation
Change-Id: I53f759ea477079b0b6aed4bcbeefb645886263d6

7 years agoFix a race condition during HCI module shutdown
Pavlin Radoslavov [Fri, 14 Apr 2017 07:13:59 +0000 (07:13 +0000)]
Fix a race condition during HCI module shutdown
am: a3292051d9

Change-Id: I2116b3d5e0c992a4fbd35745ee5c9b3f14fdb1a9

7 years agoFix a race condition during HCI module shutdown
Pavlin Radoslavov [Thu, 13 Apr 2017 21:33:30 +0000 (14:33 -0700)]
Fix a race condition during HCI module shutdown

If an HCI event (e.g., incoming event) happens during
HCI module shutdown, and the processing of that event
calls update_command_response_timer() right after
"alarm_free(command_response_timer)" in the beginning
of hci_module_shut_down(), then update_command_response_timer()
will try to schedule an alarm on command_response_timer that is NULL.

Test: Enable/disable Bluetooth, added unit tests
Bug: 37241256
Change-Id: I7fd58446caedc135e906953644201f88b5df32bb

7 years agoDo not remove device security record on LMP timeout
Andre Eisenbach [Fri, 14 Apr 2017 00:44:32 +0000 (00:44 +0000)]
Do not remove device security record on LMP timeout
am: 1f5ec7304f

Change-Id: I429d8cfb4d048174764400096de655777411410c

7 years agoDo not remove device security record on LMP timeout
Andre Eisenbach [Thu, 13 Apr 2017 21:49:36 +0000 (14:49 -0700)]
Do not remove device security record on LMP timeout

If an LMP timeout is encountered in the middle of authentication, the
link key is removed from the controller (but not from NVRAM). This can
result in a follow up connction triggering a LINK_KEY_MISSING reply,
which in turn can cause a remote device to initiate pairing which will
then finally remove the link key stored in NVRAM as well.

This change prevents the link key from being removed from the Bluetooth
controller in case of a timeout during link authentication.

Bug: 36798442
Test: manual
Change-Id: Ic89a16b45756e3d40b2e374c645c8f245f6ce3fc

7 years agoAVRCP TG: Get Item Attribute command not working
Hemant Gupta [Thu, 13 Apr 2017 14:34:36 +0000 (20:04 +0530)]
AVRCP TG: Get Item Attribute command not working

Usecase:
1) Connect from carkit supporting AVRCP 1.4/1.5 CT to DUT
2) Issue get item attribute command with valid attribute list.

Expected behaviour:
Get item attribute command succeeds and returns the requested
attributes of particular item

Observed result:
Get Item attribute command fails with BAD Param Error

Root Cause:
Wrong structure from tAVRC_COMMAND was being passed to fill_attribute_id_array
which was leading to error being returned.

Fix:
Use get_attrs of type tAVRC_GET_ATTRS_CMD instead of get_elem_attrs of type
tAVRC_GET_ELEM_ATTRS_CMD when remote device requests for get item attributes.

Test: Checked that now bad param error is not returned in response for
get item attribute command from remote device.

Bug: 37302234
Change-Id: I9245f726f37ffd666d143d2232dac868a2cc3268

7 years agoReduce the audio A2DP HAL output audio stream buffer size
Pavlin Radoslavov [Wed, 12 Apr 2017 02:34:25 +0000 (02:34 +0000)]
Reduce the audio A2DP HAL output audio stream buffer size
am: 5e9f56940e

Change-Id: Ib4af0fad802cd629f4008f52b0ec99a9ef1829e3

7 years agoReduce the audio A2DP HAL output audio stream buffer size
Pavlin Radoslavov [Wed, 5 Apr 2017 23:38:42 +0000 (16:38 -0700)]
Reduce the audio A2DP HAL output audio stream buffer size

Reduce the audio A2DP HAL output audio stream buffer size
(per constant AUDIO_STREAM_OUTPUT_BUFFER_PERIODS) from 4 to 2.
After the change, the output buffer size is double the buffer period.

Bug: 35849921
Test: A2DP streaming with various codec settings. Testplans/83305.
Change-Id: I2a15d468e748a03b481bf2117903ab06cddd02a3

7 years agoMerge "HFP: Disable BTRH feature"
Yoshiharu Kurita [Tue, 11 Apr 2017 20:15:12 +0000 (20:15 +0000)]
Merge "HFP: Disable BTRH feature"
am: 59921ffef4

Change-Id: I730e60eed923b20e58667ecafd9f1c268b9559c7

7 years agoMerge "HFP: Disable BTRH feature"
Treehugger Robot [Tue, 11 Apr 2017 20:09:18 +0000 (20:09 +0000)]
Merge "HFP: Disable BTRH feature"

7 years agoFix log record after return
liuchao [Tue, 11 Apr 2017 19:05:55 +0000 (19:05 +0000)]
Fix log record after return
am: 3d38129e2a

Change-Id: I94f3d33e9a9e40e8395e2632db386ce0cda401c4

7 years agoFix log record after return
liuchao [Tue, 11 Apr 2017 12:41:29 +0000 (20:41 +0800)]
Fix log record after return

Put log before the returned BUSY

Test: mm -j8
Change-Id: Ic3fb15a35adac363519cabecfcf8a2d3da60107c

7 years agoMerge "Add support for inband ringing feature"
Jack He [Mon, 10 Apr 2017 23:00:19 +0000 (23:00 +0000)]
Merge "Add support for inband ringing feature"
am: 3523f28d89

Change-Id: I21b543a6eea34b6da45037a8ee87208337551114

7 years agoHFP: Disable BTRH feature
Yoshiharu Kurita [Wed, 25 Nov 2015 09:00:30 +0000 (18:00 +0900)]
HFP: Disable BTRH feature

Fluoride does not notify application layer upon AT+BTRH, and always
sends error response (BTRH is not supported) to remote device.
That is, Fluoride does not support BTRH feature.
But BTRH is enabled by default, so OK is sent to remote device by mistake
before the error response is sent. This makes some carkits unstable.

Bug: 29587048

Change-Id: If1aa32291491982851ecd480c4ba8390f39a27a2

7 years agoMerge "Add support for inband ringing feature"
Jack He [Mon, 10 Apr 2017 22:47:54 +0000 (22:47 +0000)]
Merge "Add support for inband ringing feature"

7 years agoAdd A2DP codec-specific information to dumpsys output
Pavlin Radoslavov [Mon, 10 Apr 2017 22:07:11 +0000 (22:07 +0000)]
Add A2DP codec-specific information to dumpsys output
am: 302113d4e4

Change-Id: I006834b1168daf51027b91f829f9c665afb1d219

7 years agoAdd A2DP codec-specific information to dumpsys output
Pavlin Radoslavov [Thu, 6 Apr 2017 22:13:16 +0000 (15:13 -0700)]
Add A2DP codec-specific information to dumpsys output

Now we print the following information:
 * Current codec name
 * Info for each supported codec:
   - Priority
   - Encoder interval (ms)
   - Codec Config: Sampling rate, Bits per sample, Channel mode (MONO/STEREO)
   - Selectable codec configuration
   - Codec's local capability
   - Packet counts (expected/dropped)
   - PCM read counts (expected/actual)
   - PCM read bytes (expected/actual)
 * LDAC codec-specific info:
   - LDAC quality mode: HIGH/MID/LOW/ABR
   - LDAC saved transmit queue length [used in ABR mode]
 * SBC codec-specific info:
   - Frames counts (expected/dropped)

Sample of the new format is below:

---
A2DP Codecs State:
  Current Codec: LDAC

A2DP LDAC State:
  Priority: 1000000
  Encoder interval (ms): 20
  Config: Rate=96000 Bits=32 Mode=STEREO
  Selectable: Rate=44100|48000|88200|96000 Bits=16|24|32 Mode=MONO|STEREO
  Local capability: Rate=44100|48000|88200|96000 Bits=16|24|32 Mode=MONO|STEREO
  Packet counts (expected/dropped)                        : 596 / 161
  PCM read counts (expected/actual)                       : 2488 / 2488
  PCM read bytes (expected/actual)                        : 2547712 / 2547712
  LDAC quality mode                                       : ABR
  LDAC saved transmit queue length                        : 0

A2DP aptX-HD State:
  Priority: 4001
  Encoder interval (ms): 0
  Config: Invalid
  Selectable: Invalid
  Local capability: Rate=44100|48000 Bits=24 Mode=STEREO
  Packet counts (expected/dropped)                        : 0 / 0
  PCM read counts (expected/actual)                       : 0 / 0
  PCM read bytes (expected/actual)                        : 0 / 0

A2DP aptX State:
  Priority: 3001
  Encoder interval (ms): 0
  Config: Rate=44100 Bits=16 Mode=STEREO
  Selectable: Rate=44100|48000 Bits=16 Mode=STEREO
  Local capability: Rate=44100|48000 Bits=16 Mode=STEREO
  Packet counts (expected/dropped)                        : 0 / 0
  PCM read counts (expected/actual)                       : 0 / 0
  PCM read bytes (expected/actual)                        : 0 / 0

A2DP AAC State:
  Priority: 2001
  Encoder interval (ms): 20
  Config: Rate=44100 Bits=16 Mode=STEREO
  Selectable: Rate=44100|48000 Bits=16 Mode=STEREO
  Local capability: Rate=44100|48000|88200|96000 Bits=16 Mode=STEREO
  Packet counts (expected/dropped)                        : 0 / 0
  PCM read counts (expected/actual)                       : 0 / 0
  PCM read bytes (expected/actual)                        : 0 / 0

A2DP SBC State:
  Priority: 1001
  Encoder interval (ms): 20
  Config: Rate=44100 Bits=16 Mode=STEREO
  Selectable: Rate=44100 Bits=16 Mode=STEREO
  Local capability: Rate=44100 Bits=16 Mode=STEREO
  Packet counts (expected/dropped)                        : 580 / 0
  PCM read counts (expected/actual)                       : 2900 / 2900
  PCM read bytes (expected/actual)                        : 1484800 / 1484800
  Frames counts (expected/dropped)                        : 3724 / 0
---

Bug: 36567128
Test: Stream A2DP and "adb shell dumpsys bluetooth_manager"
Change-Id: Idd86005b842a4e569b7df91b8bbaf0632ed7f7c9

7 years agoBuild fix for BLE_PRIVACY_SPT == FALSE
Jakub Pawlowski [Mon, 10 Apr 2017 21:31:37 +0000 (21:31 +0000)]
Build fix for BLE_PRIVACY_SPT == FALSE
am: b0aca861fe

Change-Id: Iea84f1fd5443fa0954b8023d7e68e9968f79bb27