OSDN Git Service

android-x86/system-bt.git
7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:20:40 +0000 (18:20 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453
am: c80b2fc096  -s ours

Change-Id: I143dcc7f5db0b852b596eeb62ac78f1beda40b3c

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:18:09 +0000 (18:18 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7
am: 5d9bbfe453

Change-Id: I0d39c39b4b573b7df297ed1d93191aff18712fec

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948
Pavlin Radoslavov [Thu, 13 Jul 2017 18:16:08 +0000 (18:16 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948
am: b4cf6c5aa7

Change-Id: I915ceaf816dc806ba91da7791aa1b43460615935

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 18:13:38 +0000 (18:13 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote
am: f7a7f7a948

Change-Id: I5d1c8050de38dde922f9891e70574205422ee7be

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
TreeHugger Robot [Thu, 13 Jul 2017 18:02:23 +0000 (18:02 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 01:39:31 +0000 (18:39 -0700)]
Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per
  Table 1 in PAN Profile v1.0 spec.
* Explicitly disable connections to the local PANU if the remote is
  not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
(cherry picked from commit 9aea2c2f92dd5245f6b35d564ce8e471fec2b4ec)
(cherry picked from commit 3f2ee5b546b65b5b021779588316249276ed3827)
(cherry picked from commit 40c7cefb12ac1a70bf7b1c770c1ab21a5b3f229e)
(cherry picked from commit f7a7f7a948e38195e8ca897785ac5d489082f0cc)

7 years agoAllocate buffers of the right size when BT_HDR is included
Pavlin Radoslavov [Thu, 6 Jul 2017 20:39:02 +0000 (13:39 -0700)]
Allocate buffers of the right size when BT_HDR is included

Bug: 63146105
Test: External script
Change-Id: I1f2c871e3fcf57aabdad9d07905e6dae643bd496
Merged-In: I1f2c871e3fcf57aabdad9d07905e6dae643bd496
(cherry picked from commit d88838a7237cd672d87b6b9cc8d56fff625fd1d5)
(cherry picked from commit b648c7dfe45c57842d58576f558fdf8edff10bec)
(cherry picked from commit 338e0485940ab278e6a2dc12285ba0798b79cfa4)

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 01:39:31 +0000 (18:39 -0700)]
Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per
  Table 1 in PAN Profile v1.0 spec.
* Explicitly disable connections to the local PANU if the remote is
  not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
(cherry picked from commit 9aea2c2f92dd5245f6b35d564ce8e471fec2b4ec)
(cherry picked from commit 3f2ee5b546b65b5b021779588316249276ed3827)
(cherry picked from commit 40c7cefb12ac1a70bf7b1c770c1ab21a5b3f229e)

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:18:07 +0000 (22:18 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf am: 585e0c08f5
am: 005eb1d305

Change-Id: Ic4f826e4f963f969c360fe39c6e720c3fb013d23

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6...
Jack He [Tue, 11 Apr 2017 22:13:06 +0000 (22:13 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6 am: e6620d18cf
am: 585e0c08f5

Change-Id: If70a5f9b56845e758c2a2a3150936a72cac9f438

7 years agoCheck LE advertising data length before caching advertising records am: 1bef3546a6
Jack He [Tue, 11 Apr 2017 22:08:06 +0000 (22:08 +0000)]
Check LE advertising data length before caching advertising records am: 1bef3546a6
am: e6620d18cf

Change-Id: I412c0dd7854d7f6157e1974e285078909543bb41

7 years agoCheck LE advertising data length before caching advertising records
Jack He [Tue, 11 Apr 2017 22:03:05 +0000 (22:03 +0000)]
Check LE advertising data length before caching advertising records
am: 1bef3546a6

Change-Id: Ibbf6183833d7f00937742fa337a04569c4ef3c2f

7 years agoCheck LE advertising data length before caching advertising records
Jack He [Thu, 6 Apr 2017 00:59:58 +0000 (17:59 -0700)]
Check LE advertising data length before caching advertising records

Bug: 33899337
Test: make, receive LE advertising
Change-Id: I06b249ac5cabdef64528deda07b8bae749e1d2fd
(cherry picked from commit d57adbc350fdee4f27b82c9e39a14bd745d92320)

7 years agoresolve merge conflicts of a3ee2e35 to nyc-dev
Pavlin Radoslavov [Tue, 14 Mar 2017 21:46:15 +0000 (14:46 -0700)]
resolve merge conflicts of a3ee2e35 to nyc-dev

Bug: 34946955
Change-Id: Ieff690edd3aa527a0639483ec8e1e3b661f0ecc4
Merged-In: I0b6f50dee05a58db8c043b4d01fb58c9acbeede9

7 years agoCheck the HCI length before extracting the L2CAP length and CID am: 33c68c82c1 am...
Pavlin Radoslavov [Tue, 14 Mar 2017 21:10:16 +0000 (21:10 +0000)]
Check the HCI length before extracting the L2CAP length and CID am: 33c68c82c1 am: 172f0d8f7c
am: ca64d3d38b

Change-Id: I239b72b4cc81728c3e859b7f4efcb820c9d8fef9

7 years agoCheck the HCI length before extracting the L2CAP length and CID am: 33c68c82c1
Pavlin Radoslavov [Tue, 14 Mar 2017 21:05:16 +0000 (21:05 +0000)]
Check the HCI length before extracting the L2CAP length and CID am: 33c68c82c1
am: 172f0d8f7c

Change-Id: Ifb002936f93d85d635ab76ddf52c0ddb44cb9d3e

7 years agoCheck the HCI length before extracting the L2CAP length and CID
Pavlin Radoslavov [Tue, 14 Mar 2017 20:59:46 +0000 (20:59 +0000)]
Check the HCI length before extracting the L2CAP length and CID
am: 33c68c82c1

Change-Id: I1f94530ef90162747ef6a62c3a601856ea1d6672

7 years agoCheck the HCI length before extracting the L2CAP length and CID
Pavlin Radoslavov [Wed, 8 Mar 2017 02:48:21 +0000 (18:48 -0800)]
Check the HCI length before extracting the L2CAP length and CID

Bug: 34946955
Test: A2DP streaming to a headset
Change-Id: I0b6f50dee05a58db8c043b4d01fb58c9acbeede9
(cherry picked from commit ecc0835114cbae3033d8b0e25bd8b443880d5077)

7 years agoMerge "Disable auto-pairing for hands-free devices" into nyc-dev
TreeHugger Robot [Mon, 29 Aug 2016 21:51:21 +0000 (21:51 +0000)]
Merge "Disable auto-pairing for hands-free devices" into nyc-dev

7 years agoaudio_a2dp_hw: Always update frame counter in out_write
Andy Hung [Thu, 28 Jul 2016 17:45:54 +0000 (10:45 -0700)]
audio_a2dp_hw: Always update frame counter in out_write

Required now that we always return success.

Bug: 30025777
Change-Id: I7db51321672c128039545cc0fb604c615f169bc3
(cherry picked from commit f4a37b255d1d6fa4cf7cefe2aeb1c3f4fdf33f3c)

8 years agoDisable auto-pairing for hands-free devices
Andre Eisenbach [Thu, 7 Jul 2016 16:58:59 +0000 (09:58 -0700)]
Disable auto-pairing for hands-free devices

Fixes: 30004157
Change-Id: Id170856fbee5ea345f02f55d3a6e3376d846c2de
(cherry picked from commit e8b81851c33095fe3b3ac78329073309be5421e1)

8 years agoAdd Subaru and Nissan car kits to auto pair blacklist
Andre Eisenbach [Mon, 27 Jun 2016 22:49:53 +0000 (15:49 -0700)]
Add Subaru and Nissan car kits to auto pair blacklist

Bug: 29157087
Change-Id: If227963b939a9b0ed55e6d900364c71932d3cfe8

8 years agoA2DP media task: Flush full TX queue on congestion
Andre Eisenbach [Thu, 23 Jun 2016 23:14:53 +0000 (16:14 -0700)]
A2DP media task: Flush full TX queue on congestion

Currently, our TX queue does not allow for quick recovery of minor
congestion. As we only clear as much room in the queue as is needed to
fix the news frames needed for a given timer tick, any minor congestion
on the TX path can result in single frames to be dropped over an
excessively long amount of time.

From the "just rip the band-aid off" school of thought, drop the whole
queue instead to cause a single drop-out on congestion and catch up to
the live stream immediately, hoping that the stream recovers...

Bug: 29601962
Change-Id: I482c3cfef6d8b51143e54733eb2da5f70663636f

8 years agoMerge "Remove SBC frame scrambling" into nyc-dev
Andre Eisenbach [Fri, 24 Jun 2016 17:16:52 +0000 (17:16 +0000)]
Merge "Remove SBC frame scrambling" into nyc-dev

8 years agoRemove SBC frame scrambling
Andre Eisenbach [Thu, 23 Jun 2016 22:25:44 +0000 (15:25 -0700)]
Remove SBC frame scrambling

Bug: 29601962
Change-Id: I30ce09f1c7550a1be9fd1c8ed70745f9aa0cdb44

8 years agoRemove log spam in btif_gattc_update_properties
Andre Eisenbach [Thu, 23 Jun 2016 21:22:35 +0000 (14:22 -0700)]
Remove log spam in btif_gattc_update_properties

Bug: 29601962
Change-Id: I4a86b786609b0203a72b750a1c4a38c82fcc5f97

8 years agoresolve merge conflicts of 1f433cb to mnc-dr-dev am: f15ca6d21d -s ours am: 8e80a26078
Sharvil Nanavati [Wed, 22 Jun 2016 01:19:12 +0000 (01:19 +0000)]
resolve merge conflicts of 1f433cb to mnc-dr-dev am: f15ca6d21d  -s ours am: 8e80a26078
am: edb7ce120e

Change-Id: Ie7ea41474e11479b54ba526294977dfaa60c8cd7

8 years agoresolve merge conflicts of 1f433cb to mnc-dr-dev am: f15ca6d21d -s ours
Sharvil Nanavati [Wed, 22 Jun 2016 01:16:24 +0000 (01:16 +0000)]
resolve merge conflicts of 1f433cb to mnc-dr-dev am: f15ca6d21d  -s ours
am: 8e80a26078

Change-Id: I54a690024ccd316058d9d59ff7b16206f7fcd543

8 years agoresolve merge conflicts of 1f433cb to mnc-dr-dev
Sharvil Nanavati [Wed, 22 Jun 2016 01:13:44 +0000 (01:13 +0000)]
resolve merge conflicts of 1f433cb to mnc-dr-dev
am: f15ca6d21d  -s ours

Change-Id: Ic1a23e2c6d0284b9fdf346a681f59cdcbaa599e0

8 years agoresolve merge conflicts of 1f433cb to mnc-dr-dev
Sharvil Nanavati [Tue, 21 Jun 2016 22:56:42 +0000 (15:56 -0700)]
resolve merge conflicts of 1f433cb to mnc-dr-dev

Change-Id: I7278875d21c59316217cb1b99d902f4fc248ca06

8 years agoDO NOT MERGE Fix potential DoS caused by delivering signal to BT process
Sharvil Nanavati [Tue, 21 Jun 2016 02:16:12 +0000 (19:16 -0700)]
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process

Bug: 28885210
Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360

8 years agoL2CAP: Handle invalid HCI packets
Matadeen Mishra [Wed, 3 Feb 2016 12:43:39 +0000 (18:13 +0530)]
L2CAP: Handle invalid HCI packets

- Handled Buffer over flow for uint16_t
- Discard invalid HCI packets from Codenomican test
  tool as data length and actual data not matching
  during reassembly

Use case:
Execute L2CAP test suit from Defensics Codenomican

Steps:
1. Pair and connect DUT to Codenomican tool
2. Execute L2CAP test suit from Defensics Codenomican

Failure:
Crash observed on DUT and Codenomican tool stuck in execution.

Root cause:
Codenomican tool sending invalid HCI packets to DUT and
there are no checks to handle buffer over flow and other invalid data
from Codenomican tool.

Bug: 29498064
Change-Id: I6f93c80244fc39d607ad285185136bbbca83d7ae

8 years agoAdd missing NULL pointers assignments
Pavlin Radoslavov [Thu, 16 Jun 2016 23:37:57 +0000 (16:37 -0700)]
Add missing NULL pointers assignments

Each pointer that was freed by one of the following functions should
be reset to NULL:
 - config_free()
 - data_dispatcher_free()
 - fixed_queue_free()
 - list_free()

Bug: 29421693
Change-Id: Ie55a04ed986393994564edcf872d7413b0767a85
(cherry picked from commit 8cbc291080730cd7d04990a8fc0e11249b06aa08)

8 years agoImprove BT HAL write response to BT server reads
Andy Hung [Wed, 15 Jun 2016 02:58:58 +0000 (19:58 -0700)]
Improve BT HAL write response to BT server reads

By polling, we ensure the socket buffer is nearly always full,
as blocking socket writes may not wake in time to avoid underflow.

Bug: 28286313
Change-Id: I056768dbd860993c41d44c33a4846d62c50db933

8 years agoMerge "HOGP: Clear pending operations for a given device on connect" into nyc-dev
TreeHugger Robot [Wed, 15 Jun 2016 00:28:58 +0000 (00:28 +0000)]
Merge "HOGP: Clear pending operations for a given device on connect" into nyc-dev

8 years agoMerge "HOGP: Preffer write command over write requests" into nyc-dev
TreeHugger Robot [Tue, 14 Jun 2016 23:28:20 +0000 (23:28 +0000)]
Merge "HOGP: Preffer write command over write requests" into nyc-dev

8 years agoMerge "Use UINT16 for GATT attribute id field" into nyc-dev
Jakub Pawlowski [Tue, 14 Jun 2016 22:03:29 +0000 (22:03 +0000)]
Merge "Use UINT16 for GATT attribute id field" into nyc-dev

8 years agoHOGP: Preffer write command over write requests
Jakub Pawlowski [Tue, 14 Jun 2016 21:40:51 +0000 (14:40 -0700)]
HOGP: Preffer write command over write requests

Some HID devices will accept both write request and write command.
Prefer write commands when possible.

This is due to bug in some hardware, that will not send write response
when too many commands are queued.

Bug: 29184976
Change-Id: I5bafc067f044a48f152c60b8e17722067bc1453e

8 years agoUse UINT16 for GATT attribute id field
Jakub Pawlowski [Tue, 14 Jun 2016 19:47:52 +0000 (12:47 -0700)]
Use UINT16 for GATT attribute id field

Id field is equal to attribute handle, so it must be 16bits.
Otherwise only piece of GATT database can be used.

Bug: 29253825
Change-Id: Ia88e3ad3eb96ca8e97349aa5e852e66c57072b49

8 years agoFix missing GATT Characteristic from last service
Jakub Pawlowski [Tue, 14 Jun 2016 19:23:44 +0000 (12:23 -0700)]
Fix missing GATT Characteristic from last service

GATT Service is contained between start and end handle. If
characteristic definition is at end handle, and it's value definition is
after end handle, it will not be properly discovered. That's because we
use value_handle instead of attribute_handle to identify
characteristics.

As a workaround, increase service boundary if value is defined after
it's definition.

Bug: 29253825
Change-Id: Ib145aea4f5cf38a1fbb977c301136e16f8f900f7

8 years agoHOGP: Clear pending operations for a given device on connect
Jakub Pawlowski [Mon, 13 Jun 2016 17:30:17 +0000 (10:30 -0700)]
HOGP: Clear pending operations for a given device on connect

If there are any HID operations scheduled after disconnect, mark the
device as no longer executing after establishing connection. Otherwise
we'll be unable to send any HID commands to it.

Change-Id: Ie1bb622388a3bcb574dec3dde76ef4518ee1102f

8 years agoHOGP: Clear pending operations for a given device on disconnect
Jakub Pawlowski [Fri, 10 Jun 2016 23:32:26 +0000 (16:32 -0700)]
HOGP: Clear pending operations for a given device on disconnect

If there are any GATT operations interrupted by a disconnect, mark the
device as no longer executing. Otherwise we'll stil receive data from
the device, but we'll be unable to send any HID commands to it.

Bug: 29184976
Change-Id: I489f41c970abad0ff1145005d3250beafa83d27e

8 years agoDo not request AVRC_CAP_COMPANY_ID if A2DP Sink is not enabled
AnubhavGupta [Wed, 6 Apr 2016 06:17:05 +0000 (11:47 +0530)]
Do not request AVRC_CAP_COMPANY_ID if A2DP Sink is not enabled

Also fixed AVRC_PDU_GET_PLAY_STATUS timeout response.

Bug: 28177785
Change-Id: Icde64a5c1806453850abe101f9707fff61566566
(cherry picked from commit 1c512b851d76deac860fce1232e4a1fa1a097f1c)

8 years agoSet disable timer in case of any active ACL connection
Srinu Jella [Wed, 8 Jun 2016 10:20:53 +0000 (15:50 +0530)]
Set disable timer in case of any active ACL connection

Use Case: Disable time out when atleast one active ACL connections

Steps:
1. Turn ON Bluetooth
2. Connect to any Headset
3. Turn OFF bluetooth.

Failure: Turn OFF bluetooth is failed when atleast one active ACL connections

Root Cause:i If we have one or more active ACL links, so it is not notitying
BTA_DM_DISABLE_EVT to upper layer.

Fix: Set disable timer in case of any active ACL connection

Bug: 29217385

Change-Id: Ica47717119f1ab9fa9f4f5244e8483c408276a2a
(cherry picked from commit 3e4f01ada8c1627bd48f31cd0c8269984b8e5f96)

8 years agoMerge "btm: Restrict EXTENDED_INQUIRY_RESULT to 1 result" into nyc-dev
TreeHugger Robot [Wed, 8 Jun 2016 22:03:23 +0000 (22:03 +0000)]
Merge "btm: Restrict EXTENDED_INQUIRY_RESULT to 1 result" into nyc-dev

8 years agoMerge "Fix payload size for GATT Read by type request" into nyc-dev
TreeHugger Robot [Wed, 8 Jun 2016 01:30:28 +0000 (01:30 +0000)]
Merge "Fix payload size for GATT Read by type request" into nyc-dev

8 years agoMerge "Reject L2CAP INFO RSP and ECHO RSP on the LE signaling channel" into nyc-dev
Pankaj Kanwar [Wed, 8 Jun 2016 01:28:49 +0000 (01:28 +0000)]
Merge "Reject L2CAP INFO RSP and ECHO RSP on the LE signaling channel" into nyc-dev

8 years agoFix payload size for GATT Read by type request
Subramanian Srinivasan [Fri, 27 May 2016 23:32:55 +0000 (16:32 -0700)]
Fix payload size for GATT Read by type request

Payload size for GATT Read by type request for UUID32 and UUID128
are incorrectly allocated. This leads to memory overflow when
Read by type request is sent for them and eventually results
in crash during free. This change makes sure that the payload
can accomodate upto 128 bit UUID.

This crash is observed while running TC_GAR_CL_BV_03_C Qual test
case.

Bug: 29011042
Change-Id: Ib2b41b769b394670099f4549f204e2972f7df876
(cherry picked from commit 7da98621a4dfa8196b8d20e8955ad508f540e5d9)

8 years agoReject L2CAP INFO RSP and ECHO RSP on the LE signaling channel
Venkata Jagadeesh [Fri, 27 May 2016 10:06:20 +0000 (15:36 +0530)]
Reject L2CAP INFO RSP and ECHO RSP on the LE signaling channel

Steps:
Execute TC_LE_REJ_BI_02_C

Failure:
PTS stuck after sending INFO RSP, ECHO RSP on the LE signaling channel

Root Cause:
The Bluetooth stack is not rejecting INFO RSP, ECHO RSP even though
these commands are invalid for the LE signaling Channel.

Fix:
Reject the INFO RSP, ECHO RSP with error L2CAP_CMD_REJ_NOT_UNDERSTOOD.

Bug: 27852645
Change-Id: Ie09f658d606206cbdbea928e8cb6d10332743cf4
(cherry picked from commit d35bb40dd563e7f37df0a2fa9c0f61d0958b9601)

8 years agobtm: Restrict EXTENDED_INQUIRY_RESULT to 1 result
Myles Watson [Tue, 7 Jun 2016 23:14:18 +0000 (16:14 -0700)]
btm: Restrict EXTENDED_INQUIRY_RESULT to 1 result

The spec only allows one result per event.
Abort processing and return if the spec is not followed.

Bug: 29141745
Change-Id: Ic414b28adadec274779b0d953d12d499a619aff6
Signed-off-by: Myles Watson <mylesgw@google.com>
8 years agoRemote device changes for SMP certification
Nitin Arora [Tue, 15 Mar 2016 22:00:36 +0000 (15:00 -0700)]
Remote device changes for SMP certification

Use Case:
Certification test cases for SMP require various scenarios
where the remote device needs to show a specific behavior
where it fails the pairing in a certain way, and the DUT is
required to abort the pairing properly.
In abcense of a proper PTS suite to execute these test cases,
we can use another device running the same host by configuring
certain run time property.

Test Cases:
TP/SCJW/BI-02-C
TP/SCJW/BV-02-C
TP/SCPK/BI-03-C
TP/SCPK/BI-04-C
TP/SCPK/BV-02-C
TP/SCPK/BV-03-C
TP/SCJW/BI-01-C
TP/SCCT/BV-01-C
TP/SCCT/BV-02-C
TP/SCPK/BI-01-C
TP/SCPK/BI-02-C
TP/SCPK/BV-04-C
TP/SCPK/BV-01-C

Fix:
Added a property in the bt_stack.conf file. The property name
is "SmpFailureCase". The values 2 to 6(inclusive), are forcausing SMP
failures with various failure reasons.
Failure case 1 and 9 are for producing error "Confirm value failure".
Cases 7 and 8 are for generating specific errors at pair cancel.

Note:
The default use of this feature is controlled using a compile
time flag BTM_BLE_SMP_CERTIFICATION.
The BTM_BLE_SMP_CERTIFICATION = TRUE is needed only while we
wait for the PTS support for the LE Secure connections.

Bug: 27852645
Change-Id: I1f7a8ff2659d85b5978b75870c57162a34d394d0
(cherry picked from commit 0bd0c8fc88a7141691a7ca839b11cb711945ee33)

8 years agoMerge "Revert "DO NOT MERGE Proper construction of AVDTP general reject message"...
Pankaj Kanwar [Tue, 7 Jun 2016 00:09:01 +0000 (00:09 +0000)]
Merge "Revert "DO NOT MERGE Proper construction of AVDTP general reject message"" into nyc-dev

8 years agoMerge "Clear BLE block from device records at unpair" into nyc-dev
Pankaj Kanwar [Tue, 7 Jun 2016 00:07:46 +0000 (00:07 +0000)]
Merge "Clear BLE block from device records at unpair" into nyc-dev

8 years agoClear BLE block from device records at unpair
Nitin Arora [Mon, 25 Apr 2016 21:47:51 +0000 (14:47 -0700)]
Clear BLE block from device records at unpair

Use Case:
Pair and unpair LE remote device repeatedly. The repair
intermittently fails with the error "DHKey Check Failure"

Failure:
Pairing failure is observed when pairing is performed
after unpairing, without performing a BT reset.
Further analysis of the SMP logs indicate that DUT uses the
static address of the remote device for calculation of the
MacKey value. At the time of pairing, the remote RPA should
be used (and the static address has not yet been distributed either).
The problem is caused by the previous dev record which is left in
the stack, and at the time of repair, stack picks the old device
record and reuses it.

Fix:
This change removes the entire BLE block from the device record,
after the unpairing is performed, so that a new device record
is allocated, after the repairing is done.

Bug: 27852645
Change-Id: I8d605d1bb3b1c32061a8d8a7a7fe0fe200030abc

8 years agoRevert "DO NOT MERGE Proper construction of AVDTP general reject message"
JivakDhadse [Fri, 7 Aug 2015 13:28:38 +0000 (18:58 +0530)]
Revert "DO NOT MERGE Proper construction of AVDTP general reject message"

This reverts commit 2ed10d442266eade44be121cd24fd473c85007d0.

Original change needs to be reverted to align with Errata
ESR04 where "Section 8.17, General Reject Page 71" of adopted
AvDTP Spec is changed to have "Invalid Signal Identifier"
in first 6 bits of Octet 1.
This change helps passing PTS case TP/SIG/SMG/ESR04/BI-28-C

Bug: 27852645
Change-Id: Idfc960ce00662e8aacc26f3b3fdca9deca8a2aff

8 years agoFix for issue introduced due to rebase of LE L2CAP COC
Navin Kochar [Fri, 18 Mar 2016 06:34:30 +0000 (12:04 +0530)]
Fix for issue introduced due to rebase of LE L2CAP COC

During 6721232 patch, some code got missed while doing manual rebase.
This patch is adding that missing code.

Bug: 27852645
Change-Id: I2525908c29e3288e0ace1ee26c5f2aa6cfd59d68
Signed-off-by: Navin Kochar <navin.kochar@intel.com>
8 years agoHID: Check for EINTR in uhid_event() and fix return value evaluation
Andre Eisenbach [Mon, 30 May 2016 19:00:46 +0000 (12:00 -0700)]
HID: Check for EINTR in uhid_event() and fix return value evaluation

uhid_event() returns 0 in the normal case. Commit 3a2c2d61
results in the polling thread to be exited.

Bug: 28942565
Change-Id: Id0aff2958bc7c2704ba340aa0ff7848afb8dcf80

8 years agoUpdate the HCI unit test if BT_CLEAN_TURN_ON_DISABLED is TRUE
Pavlin Radoslavov [Fri, 27 May 2016 19:07:06 +0000 (12:07 -0700)]
Update the HCI unit test if BT_CLEAN_TURN_ON_DISABLED is TRUE

Bug: 28614494
Change-Id: I3f4a923f9e14faef57b2d694bfc253fd10749414
(cherry picked from commit 7496372239773b7121359a34291681b749beda5f)

8 years agoAdd minimum LE connection timeout that can be used for HID devices
Jakub Pawlowski [Thu, 26 May 2016 22:13:04 +0000 (15:13 -0700)]
Add minimum LE connection timeout that can be used for HID devices

Fixes: 28979841
Change-Id: I520608a13224601fb9101d00c08b34cdb0f8d374

8 years agoRemove the RFComm MCB from the ports when releasing it
Pavlin Radoslavov [Thu, 26 May 2016 01:08:29 +0000 (18:08 -0700)]
Remove the RFComm MCB from the ports when releasing it

Bug: 28849621
Change-Id: I3ce1c857d0d0a2c00c59d8f71b40685ae602dc29
(cherry picked from commit 1f9eb3d62c78bae8b429a48f71629d6e53f9fc87)

8 years agoImprove config file sync during configuration save.
Jacky Cheung [Wed, 18 May 2016 22:41:09 +0000 (15:41 -0700)]
Improve config file sync during configuration save.

Add fsync() calls to force sync to disk while saving configuration
file.  It is necessary to do a sync on the temp file before rename,
and to sync again on its parent directory to ensure both the
file content and the directory are up-to-date.

Bug: 27354612

Change-Id: I3a862ad59c8ae5beb8ea2c727eb5f275a2d5823e
(cherry picked from commit 95dbe03a693f4a920204b8c6acbba5269915a59f)

8 years agoLimit number of SBC frames to fit into single MTU
Ayan Ghosh [Mon, 11 Nov 2013 13:55:16 +0000 (19:25 +0530)]
Limit number of SBC frames to fit into single MTU

- Calculate number of SBC frames to fit into single MTU for EDR capable
  remote devices. This makes sure the maximum utilization of the
  available bandwidth, keeping the bitrate at high quality.
- This change helps to address the discrepancy seen with a few available
  2 Mbps headsets which set the AVDTP media MTU size greater than the
  2DH5 packet payload size which eventually forces AVDTP packets to get
  fragmented in the controller. This change ensures packing of the SBC
  frames in a way that AVDTP packet size fits within the 2DH5 payload
  size.
- As packet size is restricted to meet the required bit rate more than
  one AVDTP packet can be sent to the controller in a given iteration
  based on the bit rate requirement.

Bug: 24875861
Change-Id: Icae7656ad563bbbdef65ecbfa15a89b26cf9edb2

8 years agoMerge "Fix crashes in btif_sendmsg when worqueue not initialized" into nyc-dev
Jakub Pawlowski [Tue, 24 May 2016 22:16:05 +0000 (22:16 +0000)]
Merge "Fix crashes in btif_sendmsg when worqueue not initialized" into nyc-dev

8 years agoMerge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5 am: 99bbe2fffe...
Ajay Panicker [Tue, 24 May 2016 22:15:52 +0000 (22:15 +0000)]
Merge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5 am: 99bbe2fffe  -s ours am: 34619f8e30
am: 84970d1300

* commit '84970d13000623b266a72433474c4c2ae6abd3c6':
  Add guest mode functionality (2/3)

Change-Id: I8e26f8bb0fa6898427507dfc888dfb6fd743fcac

8 years agoMerge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5 am: 99bbe2fffe...
Ajay Panicker [Tue, 24 May 2016 22:13:00 +0000 (22:13 +0000)]
Merge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5 am: 99bbe2fffe  -s ours
am: 34619f8e30

* commit '34619f8e30adb98a2a605665b02df16a9fda6032':
  Add guest mode functionality (2/3)

Change-Id: I00a7ad9675ba8e3f68e2066aca2fd1a5baaf06db

8 years agoMerge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5
Ajay Panicker [Tue, 24 May 2016 22:10:22 +0000 (22:10 +0000)]
Merge "Add guest mode functionality (2/3)" into mnc-dev am: 4439d380e5
am: 99bbe2fffe  -s ours

* commit '99bbe2fffe98c57295a26d35b30e15c432d6a1e3':
  Add guest mode functionality (2/3)

Change-Id: Ie493166a8d452f2892bb96323b23527efe053dd7

8 years agoMerge "Add guest mode functionality (2/3)" into mnc-dev
Ajay Panicker [Tue, 24 May 2016 22:02:04 +0000 (22:02 +0000)]
Merge "Add guest mode functionality (2/3)" into mnc-dev
am: 4439d380e5

* commit '4439d380e5e2ec3c24b04f7eba1bcbceae78191a':
  Add guest mode functionality (2/3)

Change-Id: Ia13560babbc18e2ee290e16f9b03fb5202894c23

8 years agoMerge "Add guest mode functionality (2/3)" into mnc-dev
Ajay Panicker [Tue, 24 May 2016 21:53:32 +0000 (21:53 +0000)]
Merge "Add guest mode functionality (2/3)" into mnc-dev

8 years agoFix crashes in btif_sendmsg when worqueue not initialized
Jakub Pawlowski [Tue, 24 May 2016 16:15:50 +0000 (09:15 -0700)]
Fix crashes in btif_sendmsg when worqueue not initialized

Instead of crashing whole stack when trying to post task to
uninitialized queue, log error message. This can happen in two cases:
stack is not initialized yet, or we're shutting down and already cleaned
up the workqueue thread.

Bug: 28889608
Change-Id: I9b8652d27abc2489b2489997c928634b68433a3e

8 years agoDon't disconnect on failure to register for service changed notification
Jakub Pawlowski [Mon, 23 May 2016 21:47:48 +0000 (14:47 -0700)]
Don't disconnect on failure to register for service changed notification

Bug: 28721625
Change-Id: I2214fb2576f0f0794922ed9b47d8805839d69bfd

8 years agoMerge "Improve poll(2) handling and log messages" into nyc-dev
TreeHugger Robot [Thu, 19 May 2016 22:39:37 +0000 (22:39 +0000)]
Merge "Improve poll(2) handling and log messages" into nyc-dev

8 years agoImprove poll(2) handling and log messages
Pavlin Radoslavov [Wed, 18 May 2016 21:34:31 +0000 (14:34 -0700)]
Improve poll(2) handling and log messages

 * Better error handling and log messages inside
   uipc_flush_ch_locked()
 * Add missing error check inside UIPC_Read()
 * Add missing OSI_NO_INTR() wrapper around poll()
   inside function btu_exec_tap_fd_read()

Bug: 28823662
Change-Id: I5f1c720861bea594d53ed6465a5ff327ba352598

8 years agoAdd error log messages for A2DP commands
Pavlin Radoslavov [Wed, 18 May 2016 21:30:53 +0000 (14:30 -0700)]
Add error log messages for A2DP commands

Bug: 28823662
Change-Id: Ifa9950dd2277b444bedd5108beff2db029a5ed93

8 years agoMerge "Add L2CAP signaling headers and more ACL data to btsnooz" into nyc-dev
TreeHugger Robot [Wed, 18 May 2016 23:31:07 +0000 (23:31 +0000)]
Merge "Add L2CAP signaling headers and more ACL data to btsnooz" into nyc-dev

8 years agoAdd L2CAP signaling headers and more ACL data to btsnooz
Andre Eisenbach [Tue, 17 May 2016 04:49:23 +0000 (21:49 -0700)]
Add L2CAP signaling headers and more ACL data to btsnooz

Increase the BTSNOOZ log buffer to 256kb and adds complete L2CAP
signaling headers as well as more data per ACL data packet. This will
allow additional RFCOMM debugging.

Fixes: 28845518
Change-Id: I19e1a4a40bb1c8d332a25283fb50635d791bc275

8 years agoAdd a log message to capture NULL pointer in l2c_link_hci_disc_comp()
Pavlin Radoslavov [Tue, 17 May 2016 00:14:03 +0000 (17:14 -0700)]
Add a log message to capture NULL pointer in l2c_link_hci_disc_comp()

Added a log message inside l2c_link_hci_disc_comp() to help capture
a NULL pointer p_lcb->p_fixed_ccbs[xx] that triggers SIGSEGV crash.
Also, updated the typedef of bdstr_t and moved it to
file "btcore/include/bdaddr.h"

Bug: 28765514
Change-Id: Iacd9376cfb9e18b58e18865581da8edad9f68821

8 years agoDO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR...
Pavlin Radoslavov [Tue, 17 May 2016 23:46:29 +0000 (23:46 +0000)]
DO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR am: f9a4d9e8bf  -s ours
am: 529f7e35ff  -s ours

* commit '529f7e35ff204c641f822e318770e8240d1ae570':
  DO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR

Change-Id: I79ab95e5cd139dc99183f398bec5fe5ca2fbd38c

8 years agoDO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR
Pavlin Radoslavov [Tue, 17 May 2016 23:42:42 +0000 (23:42 +0000)]
DO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR
am: f9a4d9e8bf  -s ours

* commit 'f9a4d9e8bf63b006bec9c30f6dc430ac5d30a85b':
  DO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR

Change-Id: I982345259966a2d7108a6a9699b3f71cb6d2e26f

8 years agoDO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR
Pavlin Radoslavov [Thu, 12 May 2016 18:36:44 +0000 (11:36 -0700)]
DO NOT MERGE ANYWHERE Restart failed system calls interrupted with errno of EINTR

In number of places we don't handle properly system calls failures
when the errno is EINTR (i.e., the system call was interrupted
by a signal). In all our use cases, the system calls should be
restarted. The handling of the following system calls (as used in the code)
has been updated/fixed:

  poll, send, recv, sendmsg, nanosleep, epoll_wait
  read - mostly (e.g., socket-like fds)
  write - mostly (e.g., socket-like fds)
  select, accept, connect

Bug: 28471477
Bug: 28658141
Change-Id: I03e6f0f67e33876780fb6d02c33eb84547ba8f95

8 years agoAdd missing arguments to log messages
Pavlin Radoslavov [Sat, 14 May 2016 04:10:22 +0000 (21:10 -0700)]
Add missing arguments to log messages

Bug: 28769522
Change-Id: I37c2b8400619646a8711099cf0bd369c3cf8eb51

8 years agoDO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f am: d47ab963e1...
Marie Janssen [Mon, 16 May 2016 18:04:27 +0000 (18:04 +0000)]
DO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f am: d47ab963e1 am: 6f6949ff93
am: fae8da3f76  -s ours

* commit 'fae8da3f76947e30f4e65baddf8867956eb5dc45':
  DO NOT MERGE btif: check overflow on create_pbuf size

Change-Id: I050ce836c311c54efab4f7e495f42901cd0a0d4e

8 years agoDO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f am: d47ab963e1
Marie Janssen [Mon, 16 May 2016 18:02:02 +0000 (18:02 +0000)]
DO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f am: d47ab963e1
am: 6f6949ff93

* commit '6f6949ff93d3e370cf72b0e18673a7749bfdfa0f':
  DO NOT MERGE btif: check overflow on create_pbuf size

Change-Id: I1ed5ea4b978e5f9b6628a5443a0acc3e61c297d7

8 years agoDO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f
Marie Janssen [Mon, 16 May 2016 17:59:28 +0000 (17:59 +0000)]
DO NOT MERGE btif: check overflow on create_pbuf size am: ad31ee0f0f
am: d47ab963e1

* commit 'd47ab963e1b6afd164bcfb051fe55ec47c1d211d':
  DO NOT MERGE btif: check overflow on create_pbuf size

Change-Id: I839427756e92067e8c54822988648a85e537cc27

8 years agoDO NOT MERGE btif: check overflow on create_pbuf size
Marie Janssen [Mon, 16 May 2016 17:57:02 +0000 (17:57 +0000)]
DO NOT MERGE btif: check overflow on create_pbuf size
am: ad31ee0f0f

* commit 'ad31ee0f0f03953064cc503314d5e39d687af50a':
  DO NOT MERGE btif: check overflow on create_pbuf size

Change-Id: I77748f8ce26e15cf87f53cf3a34a11ecc19471f5

8 years agoAdd sync to write the backup file to the filesystem
Ajay Panicker [Thu, 12 May 2016 22:52:01 +0000 (15:52 -0700)]
Add sync to write the backup file to the filesystem

Bug: 27354612
Change-Id: I5a7751b6f08831d43647391774501f211336e9eb

8 years agoFail gracioulsy when GATT_MAX_APPS reached
Jakub Pawlowski [Fri, 13 May 2016 20:09:08 +0000 (13:09 -0700)]
Fail gracioulsy when GATT_MAX_APPS reached

Bug: 28677905
Change-Id: I092494ab3f9e9ae4330d5d2a6f6ef010c61fe2a4

8 years agoDO NOT MERGE btif: check overflow on create_pbuf size
Marie Janssen [Thu, 12 May 2016 22:30:16 +0000 (15:30 -0700)]
DO NOT MERGE btif: check overflow on create_pbuf size

Bug: 27930580
Change-Id: Ieb1f23f9a8a937b21f7c5eca92da3b0b821400e6

8 years agoAdd config logging, make parsing stricter, and move sync
Ajay Panicker [Thu, 12 May 2016 18:03:39 +0000 (11:03 -0700)]
Add config logging, make parsing stricter, and move sync

The functions that parse the config file will report failure if
the config file is improperly formatted or is missing the necessary
Adapter section. Also moved sync to sync the filesystem after the
config file is saved.

Bug: 27354612
Change-Id: Ia75ff628d83bdc933c4bc16761d6c55eef19b757

8 years agoaudio HAL: improve control socket error handling
Eric Laurent [Thu, 12 May 2016 01:18:54 +0000 (18:18 -0700)]
audio HAL: improve control socket error handling

Implement retry upon control socket receive error
in a2dp_ctrl_receive() if EAGAIN or EINTR.

Implement recovery from previous socket error in
a2dp_command().

Increase socket receive timeout to account for
headsets will long activation time.

Fixed state update error in start_audio_datapath()
in case the data socket is already opened.

Added missing mutex around state updated in oput_write()
and in_read()

Made read and write code symmetric.

Bug: 28727517
Change-Id: I68d7fe63f298bbd1e387ec42fdb1277b2dcdfef5

8 years agoMerge "Restart failed system calls interrupted with errno of EINTR" into nyc-dev
TreeHugger Robot [Thu, 12 May 2016 23:30:32 +0000 (23:30 +0000)]
Merge "Restart failed system calls interrupted with errno of EINTR" into nyc-dev

8 years agoRestart failed system calls interrupted with errno of EINTR
Pavlin Radoslavov [Thu, 12 May 2016 18:36:44 +0000 (11:36 -0700)]
Restart failed system calls interrupted with errno of EINTR

In number of places we don't handle properly system calls failures
when the errno is EINTR (i.e., the system call was interrupted
by a signal). In all our use cases, the system calls should be
restarted. The handling of the following system calls (as used in the code)
has been updated/fixed:

  poll, send, recv, sendmsg, nanosleep, epoll_wait
  read - mostly (e.g., socket-like fds)
  write - mostly (e.g., socket-like fds)
  select, accept, connect

Bug: 28471477
Bug: 28658141
Change-Id: I03e6f0f67e33876780fb6d02c33eb84547ba8f95

8 years agobtif: only save config when bonded devices change
Marie Janssen [Wed, 11 May 2016 21:58:48 +0000 (14:58 -0700)]
btif: only save config when bonded devices change

Bug: 27354612

Change-Id: I15f816c85d3ab1991abf076f7c1ae2914d773d54

8 years agoDO NOT MERGE ANYWHERE SMP: Delay authorization complete. am: 8c519caec3 -s ours
Jacky Cheung [Thu, 12 May 2016 18:40:44 +0000 (18:40 +0000)]
DO NOT MERGE ANYWHERE SMP: Delay authorization complete. am: 8c519caec3  -s ours
am: 731684b29a  -s ours

* commit '731684b29a6603e3c6b22e80229d49f46c44a56c':
  DO NOT MERGE ANYWHERE SMP: Delay authorization complete.

Change-Id: I01ba378fc44a2e273ef2cd53787ddc6504de38b8

8 years agoDO NOT MERGE ANYWHERE SMP: Delay authorization complete.
Jacky Cheung [Thu, 12 May 2016 18:38:06 +0000 (18:38 +0000)]
DO NOT MERGE ANYWHERE SMP: Delay authorization complete.
am: 8c519caec3  -s ours

* commit '8c519caec3908ce20832ce4c756f2514158da132':
  DO NOT MERGE ANYWHERE SMP: Delay authorization complete.

Change-Id: I1dbfbc0b3f5cddecd18f604f5d4d0271777ce02a

8 years agoDO NOT MERGE ANYWHERE SMP: Delay authorization complete.
Jacky Cheung [Wed, 11 May 2016 19:17:31 +0000 (12:17 -0700)]
DO NOT MERGE ANYWHERE SMP: Delay authorization complete.

Delay authorization complete during Bond Pending state in SMP.
Instead of automatically advancing the Bond Pending state, create
a 500ms window to allow the slave to stop pairing by sending over
the Pairing Failed command during the Bond Pending state.

BUG: 28475887
Change-Id: I164e8312fdf9170d0f36caf404fc42e293ed5d79

8 years agoMerge "Add additional VW car kits to absolute volume blacklist" into nyc-dev
TreeHugger Robot [Wed, 11 May 2016 20:29:53 +0000 (20:29 +0000)]
Merge "Add additional VW car kits to absolute volume blacklist" into nyc-dev

8 years agoAdd additional VW car kits to absolute volume blacklist
Andre Eisenbach [Wed, 11 May 2016 19:21:41 +0000 (12:21 -0700)]
Add additional VW car kits to absolute volume blacklist

Change-Id: I8b0b73595e9183b9c1540b06e9e0378312c6a63d
Fixes: 25613423

8 years agoDO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition am: d7ec6c9c59 ...
Andre Eisenbach [Wed, 11 May 2016 19:06:17 +0000 (19:06 +0000)]
DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition am: d7ec6c9c59  -s ours
am: 2e2ef67bcf  -s ours

* commit '2e2ef67bcfe9eff2e24bd336a589c17392ec9ba6':
  DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition

Change-Id: Ife87fe9a7bb266daddf4407d1ec5adaf4eba3e22

8 years agoDO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition
Andre Eisenbach [Wed, 11 May 2016 19:01:31 +0000 (19:01 +0000)]
DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition
am: d7ec6c9c59  -s ours

* commit 'd7ec6c9c59aab205a1e90fd1db3f98431e983dfd':
  DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition

Change-Id: Ida3953705286386634d27d00ceef540090ecc533

8 years agoDO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition
Andre Eisenbach [Wed, 11 May 2016 03:27:20 +0000 (20:27 -0700)]
DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition

Commit "L2CAP and SDP Search API for BT profiles (2/2)" introduced two
separate issues in btsock_rfc_signaled():

1. The "slot_lock" potentially gets unlocked twice, causing
   undefined behaviour.

2. The call to BTA_JvRfcommWrite() was incorrectly taken outside
   of the conditional if() block that only executes the code if
   data is available.

This patch reverts the relevant locking change and fixes the if()
condition.

Bug: 27204458
Change-Id: I63b1257d21ca7bdd248858ec67e28f64e37a7895
(cherry picked from commit 2d7ddd09c163c84eacddd101cf08fd8021a35370)