OSDN Git Service

android-x86/system-bt.git
7 years agoMake gatt_attr use opportunistic connection am: 970d9d18ec
Jakub Pawlowski [Tue, 23 Aug 2016 20:32:50 +0000 (20:32 +0000)]
Make gatt_attr use opportunistic connection am: 970d9d18ec
am: de0eabbc05

Change-Id: Ic84f963c1efa375a643fe4c08ef0716c21e209b6

7 years agoGATT: don't update link status for apps that were never connected am: aab757d3d6
Jakub Pawlowski [Tue, 23 Aug 2016 20:32:48 +0000 (20:32 +0000)]
GATT: don't update link status for apps that were never connected am: aab757d3d6
am: a7dd707914

Change-Id: I9256c0f1ad331bca8b62e01790dcc9d6c5248e87

7 years agoMake gatt_attr use opportunistic connection
Jakub Pawlowski [Tue, 23 Aug 2016 20:27:39 +0000 (20:27 +0000)]
Make gatt_attr use opportunistic connection
am: 970d9d18ec

Change-Id: Iaff1375e619409afe9570b6fb79867070a339902

7 years agoGATT: don't update link status for apps that were never connected
Jakub Pawlowski [Tue, 23 Aug 2016 20:27:38 +0000 (20:27 +0000)]
GATT: don't update link status for apps that were never connected
am: aab757d3d6

Change-Id: Id9397aa59aae3570821c9838d428541cfb6a878a

7 years agoMake gatt_attr use opportunistic connection
Jakub Pawlowski [Mon, 18 Jul 2016 16:06:49 +0000 (09:06 -0700)]
Make gatt_attr use opportunistic connection

This patch creates new connection mode - opportunistic connection. When
such connection is made, no call to gatt_update_app_hold_link_status
will be made when it's started.

This means that connecting and disconnecting in this mode won't trigger
disconnect timer. When other, app creates regular connection and then
disconnects, the physical connection might get disconnected.

Opportunistic connection is used only for code setting CCC right now.

Bug: 30186455
Change-Id: Ia5be7682b6c3dcb4993060f818dee603aef3e19e

7 years agoGATT: don't update link status for apps that were never connected
Jakub Pawlowski [Thu, 16 Jun 2016 15:16:48 +0000 (08:16 -0700)]
GATT: don't update link status for apps that were never connected

Right now, in GATT_Deregister we make a call to
gatt_update_app_use_link_flag, which might result in a call to
GATT_SetIddleTimeout on links that this client was never connected to.

In order to fix that, we must check if gatt_update_app_hold_link_status
made any changes to p_tcb->app_hold_link. If not, then skip updating
the timer.

Bug: 30186455
Change-Id: I6f18ec7fe4e80e048adc9e360cae703b7d64d62a

7 years agoMerge "GATT: don't update link status for apps that were never connected" into nyc...
Jakub Pawlowski [Fri, 19 Aug 2016 13:27:30 +0000 (13:27 +0000)]
Merge "GATT: don't update link status for apps that were never connected" into nyc-mr1-dev
am: fdab496066

Change-Id: I176b02758b89cec3e0af685bc1d6a51cc4e22584

7 years agoGATT: don't update link status for apps that were never connected
Jakub Pawlowski [Fri, 19 Aug 2016 13:27:30 +0000 (13:27 +0000)]
GATT: don't update link status for apps that were never connected
am: d921c78fc6

Change-Id: I35b5cd7df92916044b69c9b191978ccd207ee6d4

7 years agoMake gatt_attr use opportunistic connection
Jakub Pawlowski [Fri, 19 Aug 2016 13:27:29 +0000 (13:27 +0000)]
Make gatt_attr use opportunistic connection
am: 8ed030ff4a

Change-Id: I7f9926fa32daaf286de667b9faf8ef92f81d43f2

7 years agoMerge "GATT: don't update link status for apps that were never connected" into nyc...
TreeHugger Robot [Fri, 19 Aug 2016 06:15:04 +0000 (06:15 +0000)]
Merge "GATT: don't update link status for apps that were never connected" into nyc-mr1-dev

7 years agoGATT: don't update link status for apps that were never connected
Jakub Pawlowski [Thu, 16 Jun 2016 15:16:48 +0000 (08:16 -0700)]
GATT: don't update link status for apps that were never connected

Right now, in GATT_Deregister we make a call to
gatt_update_app_use_link_flag, which might result in a call to
GATT_SetIddleTimeout on links that this client was never connected to.

In order to fix that, we must check if gatt_update_app_hold_link_status
made any changes to p_tcb->app_hold_link. If not, then skip updating
the timer.

Change-Id: I6f18ec7fe4e80e048adc9e360cae703b7d64d62a

7 years agoMake gatt_attr use opportunistic connection
Jakub Pawlowski [Mon, 18 Jul 2016 16:06:49 +0000 (09:06 -0700)]
Make gatt_attr use opportunistic connection

This patch creates new connection mode - opportunistic connection. When
such connection is made, no call to gatt_update_app_hold_link_status
will be made when it's started.

This means that connecting and disconnecting in this mode won't trigger
disconnect timer. When other, app creates regular connection and then
disconnects, the physical connection might get disconnected.

Opportunistic connection is used only for code setting CCC right now.

Bug: 30186455
Change-Id: Ia5be7682b6c3dcb4993060f818dee603aef3e19e

7 years agoRvert "Register for Service Changed notifications for untrusted devices"
Satomi [Tue, 9 Aug 2016 19:48:29 +0000 (19:48 +0000)]
Rvert "Register for Service Changed notifications for untrusted devices"
am: 3b9c4610e0

Change-Id: I18923bae68b0b186ab43f7bbb05ccc171980264b

7 years agoRvert "Register for Service Changed notifications for untrusted devices"
Satomi [Tue, 9 Aug 2016 16:30:11 +0000 (09:30 -0700)]
Rvert "Register for Service Changed notifications for untrusted devices"

This reverts commit 5f0e23d532f4f90d081ccc0e294f404eb5e5b688.

Instead of reusing service discovery data, gatt profile initiates
discovery by service uuid before regular service discovery is started,
and both discovery procedures interfere with each other.
As a result, link is dropped.

Bug: 30462943
Bug: 30481143
Change-Id: Ic63339f4f46eda70e575a4103974766d54a9d624
Signed-off-by: Satomi <michitsuta@casio.co.jp>
7 years agoFix APR crashes in read rssi callback
Jakub Pawlowski [Fri, 5 Aug 2016 19:07:32 +0000 (19:07 +0000)]
Fix APR crashes in read rssi callback
am: 17be4ae79a

Change-Id: I3d36ea5bc06e20be72103c9028e2719bc393a4de

7 years agoFix APR crashes in read rssi callback
Jakub Pawlowski [Fri, 5 Aug 2016 12:32:37 +0000 (05:32 -0700)]
Fix APR crashes in read rssi callback

When read RSSI timeouts, callback is called with NULL result. This was
causing crash.

Bug: 30562545
Change-Id: If379c2de4ceab48c021601851a8c83f995440460

7 years agoAdd dumpsys support for LE connection parameter updates
Jacky Cheung [Fri, 29 Jul 2016 23:39:39 +0000 (16:39 -0700)]
Add dumpsys support for LE connection parameter updates

Change-Id: Ia79483c72d3b0cfc1e339f9f4ac65295e68e8e5d

7 years agoMerge \"audio_a2dp_hw: Always update frame counter in out_write\" into nyc-mr1-dev
Andy Hung [Thu, 28 Jul 2016 23:50:06 +0000 (23:50 +0000)]
Merge \"audio_a2dp_hw: Always update frame counter in out_write\" into nyc-mr1-dev
am: ac9f5fbfa3

Change-Id: Ifc8aa0a9649c8f92190c372c4c816fbb1cbd4072

7 years agoaudio_a2dp_hw: Always update frame counter in out_write
Andy Hung [Thu, 28 Jul 2016 23:49:59 +0000 (23:49 +0000)]
audio_a2dp_hw: Always update frame counter in out_write
am: f4a37b255d

Change-Id: Idb6e3e27f412da21e14e45addaf31d0fa82e9ea4

7 years agoMerge "audio_a2dp_hw: Always update frame counter in out_write" into nyc-mr1-dev
Andy Hung [Thu, 28 Jul 2016 23:40:16 +0000 (23:40 +0000)]
Merge "audio_a2dp_hw: Always update frame counter in out_write" into nyc-mr1-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

8 years agoProper handling of AV connection collision
Ayan Ghosh [Thu, 28 Jul 2016 01:27:53 +0000 (01:27 +0000)]
Proper handling of AV connection collision
am: b82a27ed32

Change-Id: I2e6ad58ff61b95d3c6460d169e24702213bd31d5

8 years agoProper handling of AV connection collision
Ayan Ghosh [Fri, 22 Jul 2016 09:41:11 +0000 (15:11 +0530)]
Proper handling of AV connection collision

Use case:
1. Pair to Remote
2. Turn OFF/ON BT on DUT
3. After DUT's BT is turned ON, Remote would reconnect to DUT

Failure:
  Bluetooth settings UI continues to display Connecting when
  BT was Turned OFF and ON.

Root cause:
- This is a connection collision case where remote is not responding
  to DUT initiated SDP attribute fetch request for AV. AV holds outgoing
  connection for sometime and meanwhile remote starts AV connection
  from its end. Then DUT disconnects the SDP channel after a second
  without waiting to fetch requested info, and this confuses DUT's AV
  state machine. The outgoing connection could not proceed as incoming
  AV L2CAP connects, because DUT's AV state machine is not equipped
  with handling this scenario. On incoming connection timer expiry, it
  does not start AV media channel as it finds AV Open has not been done
  from upper layer after incoming L2CAP got connected.

- When the incoming path 2s timer expires, the DUT checks whether Open
  has been called after incoming state is set. This is not the case here,
  because Open was triggered earlier as as part of the outgoing
  connection. As a result, A2DP cannot connect at all.

Fix:
- Properly set collision flags for handling AV connection collision.
- Update BTA AV handle even when BTIF AV state machine is yet to be built.

Bug: 30362987
Change-Id: I02a3adb62479b0f762bc792a5727d06e11eaaa52
(cherry picked from commit db1e3a5fbb41cd1faf572c5f89ec9212c5ff2986)

8 years agoRevert "Remove position dependent lookup tables in AT command parser"
Tom Turney [Mon, 25 Jul 2016 21:23:30 +0000 (21:23 +0000)]
Revert "Remove position dependent lookup tables in AT command parser"

This reverts commit 1e7afc829bde75489d14669b2baea1e9c47b1d56.

Revert Reason: This CL causes regressions b/30367872, b/30368041,
b/30368763.

Change-Id: I48da5caac1e9fe32462c236385f768b896fa6542

8 years agoRemove position dependent lookup tables in AT command parser
Andre Eisenbach [Sat, 23 Jul 2016 06:15:11 +0000 (23:15 -0700)]
Remove position dependent lookup tables in AT command parser

The various position dependent lookup tables in the AT command parser
were out of sync, causing invalid responses to the AT+CBPS command for
example.

This patch gets rid of positionally dependent enums for simple lookup
tables that correlate all the values for easier, less error prone
maintenance of the related tables.

Change-Id: I84f7d4f4a803e6e52bf2021c6c74917e90bbc846
Fixes: 29978908

8 years agoGATT: Deregister notification when a GATT connection is closed
ugo_yu [Fri, 3 Jun 2016 10:04:24 +0000 (18:04 +0800)]
GATT: Deregister notification when a GATT connection is closed

Precondition:
1. Pair with specific HOGP mouse.

Steps:
1. Pair with HOGP mouse (iBuffalo BSMBB09DS)
2. Unpair the mouse.
3. Pair the mouse again.

Failure:
Pairing is successful, but the mouse won't connect.

Root Cause:
Some HOGP mice send notifications before the stack writes the
client characteristic configuration descriptor.
The Bluetooth stack doesn't deregister these notifiactions
when disconnecting.

Fix:
Deregister notifications when the GATT connection closes.

Fixes: 29111689
Change-Id: I520faeaa5fc396381cb248d3a2c49efbffa12261

8 years agoMake parameter set S4 default for eSCO
Andre Eisenbach [Fri, 15 Jul 2016 17:50:32 +0000 (10:50 -0700)]
Make parameter set S4 default for eSCO

Bug: 29615817
Change-Id: I5256b31a746433f10c2e7de1629952f668c99d16

8 years agoProcess Gatt read multiple response properly
Subramanian Srinivasan [Mon, 16 May 2016 18:14:03 +0000 (11:14 -0700)]
Process Gatt read multiple response properly

The Gatt server multi response queue is made NULL after each Gatt
server response is sent by BT stack in response to the remote Gatt
client's request. But the multi response queue is not initialized
again to process subsequent read multiple Gatt server responses.
Hence, the BT stack does not send Gatt server responses for the
subsequent read multiple requests from remote device which inturn
leads to disconnection. This change would process read multiple
responses by initializing the queue when it is null.

Some of Bluetooth certification test cases involve testing
Gatt server's capability to process and send read multiple
response.

Test case: TC_GAR_SR_BV_05_C

This change also cleans up unnecessary initialization and freeing
of multi rsp queue. This change makes sure that the stack initializes
multi rsp queue only when it is necessary(ie only when the Gatt
multiple read response is being processed).

Bug: 29011255

Change-Id: Ia3e2e1569ee16cac9c518f95501945257b9fb7fd
(cherry picked from commit 3737592a7846766083041e81d72a2fab0b27fb38)

8 years agoAdd logs for AVRCP commands that originate from a remote device
Ajay Panicker [Wed, 29 Jun 2016 23:39:07 +0000 (16:39 -0700)]
Add logs for AVRCP commands that originate from a remote device

Change-Id: I02b213913685d831bfe00e1938baef953428e048

8 years agoNew status code for two SMP authorization failures
Jacky Cheung [Wed, 6 Jul 2016 22:11:30 +0000 (15:11 -0700)]
New status code for two SMP authorization failures

On BTA_DM_AUTH_SMP_UNKNOWN_ERR and BTA_DM_AUTH_SMP_CONN_TOUT, bond state
status will be notified as BT_STATUS_AUTH_FAILURE.  This is observed during
the pairing flow with iOS devices.

Plus minor cleanup on SMP errors and fail reasons.

Bug: 29779689
Change-Id: Ia32fe6bb84b07272d5159409f65217a06a2e5f8e

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

8 years agoAdd BT_HCI_TIMEOUT and BT_CONFIG_SOURCE log events.
Jacky Cheung [Mon, 23 May 2016 19:39:01 +0000 (12:39 -0700)]
Add BT_HCI_TIMEOUT and BT_CONFIG_SOURCE log events.

These events are used to track HCI timeout and configuration file
usage respectively.

Change-Id: I5c8b6ef20b61f03b9ccb74f3b1c9784e4653b770

8 years agoSMP: Delay authorization complete.
Jacky Cheung [Tue, 17 May 2016 20:42:43 +0000 (13:42 -0700)]
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: Id6c30247d15258cd18eb34827694b6cd79ca753a

8 years agoLog RSSI when A2DP buffers are flushed
Andre Eisenbach [Wed, 29 Jun 2016 19:46:13 +0000 (12:46 -0700)]
Log RSSI when A2DP buffers are flushed

To add another datapoint and potentially narrow down *why* we had to
flush the buffers, add RSSI logging to keep track of signal strength
during audio drop-out events.

Change-Id: Ie52f56290951130165a9f375a898a9bacf459d55

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

Change-Id: Iff3e3643f4cc36c093e5a7d0d47af8e3aa79fe9c

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 [Fri, 24 Jun 2016 23:54:36 +0000 (23:54 +0000)]
A2DP media task: Flush full TX queue on congestion
am: d881c4b467

Change-Id: Ie00432fcec7e869c212a04374d6fcd58094eb643

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:31:36 +0000 (17:31 +0000)]
Merge \"Remove SBC frame scrambling\" into nyc-dev
am: 6b142ed4b5

Change-Id: I7dd99e2af5ec4b09a9cba9830df9cf0c677ca46b

8 years agoRemove log spam in btif_gattc_update_properties
Andre Eisenbach [Fri, 24 Jun 2016 17:31:35 +0000 (17:31 +0000)]
Remove log spam in btif_gattc_update_properties
am: ffdb33b5fc

Change-Id: I1df2268b7ddd28220f69d4eeeaee30097a976e7c

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: 8e80a260...
Sharvil Nanavati [Wed, 22 Jun 2016 01:26:51 +0000 (01:26 +0000)]
resolve merge conflicts of 1f433cb to mnc-dr-dev am: f15ca6d21d  -s ours am: 8e80a26078 am: edb7ce120e
am: c4bc5d2c5a

Change-Id: I04df6e39839bedf8b40ffd66955d2684b45093bf

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 [Mon, 20 Jun 2016 18:05:16 +0000 (18:05 +0000)]
L2CAP: Handle invalid HCI packets
am: 92e0f19ff0

Change-Id: I3df89a1a7933976c30ab3cdf4851149bc128d839

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 [Fri, 17 Jun 2016 01:57:51 +0000 (01:57 +0000)]
Add missing NULL pointers assignments
am: ba64c39c8c

Change-Id: I4c010baf150c5daf88de73efdc3041a30cf90ddd

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 21:03:06 +0000 (21:03 +0000)]
Improve BT HAL write response to BT server reads
am: 5952e40bef

Change-Id: I88946232261030fc2e62fc5be78187d839f17d5f

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
Jakub Pawlowski [Wed, 15 Jun 2016 00:32:43 +0000 (00:32 +0000)]
Merge \"HOGP: Clear pending operations for a given device on connect\" into nyc-dev
am: bfbda174b5

Change-Id: I1565542c0f9fd29b97d7235a799e3df27e8c8c41

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
Jakub Pawlowski [Tue, 14 Jun 2016 23:32:10 +0000 (23:32 +0000)]
Merge \"HOGP: Preffer write command over write requests\" into nyc-dev
am: 8577ffca06

Change-Id: I71cf1e5e38eed1a0136105d5cd4e1db2fff2ec54

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:28:10 +0000 (22:28 +0000)]
Merge \"Use UINT16 for GATT attribute id field\" into nyc-dev
am: a1d6772787

Change-Id: I26659d38b1241962bd286c0c806687b6f95a7637

8 years agoFix missing GATT Characteristic from last service
Jakub Pawlowski [Tue, 14 Jun 2016 22:27:42 +0000 (22:27 +0000)]
Fix missing GATT Characteristic from last service
am: 552e630435

Change-Id: I7539fc75908cf70833f4380b5b7a805094b2a341

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 [Sat, 11 Jun 2016 01:45:25 +0000 (01:45 +0000)]
HOGP: Clear pending operations for a given device on disconnect
am: 22fc38259f

Change-Id: I6f6707eb9c69b34b12243f72f2b893c68ba31a72

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 [Thu, 9 Jun 2016 23:21:17 +0000 (23:21 +0000)]
Do not request AVRC_CAP_COMPANY_ID if A2DP Sink is not enabled
am: 470466e6be

Change-Id: Ibc2f939f4e07dcccac95c88b8ac163d9a22586ff

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 [Thu, 9 Jun 2016 00:50:41 +0000 (00:50 +0000)]
Set disable timer in case of any active ACL connection
am: 70035577fd

Change-Id: Ibd241e1dc6608a96576d9d4db4dcdd16f7c0d383

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
Myles Watson [Wed, 8 Jun 2016 22:08:44 +0000 (22:08 +0000)]
Merge \"btm: Restrict EXTENDED_INQUIRY_RESULT to 1 result\" into nyc-dev
am: 59bc2de906

Change-Id: I9234f8a567883fdbccb20326328f9cdb444de479

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
Subramanian Srinivasan [Wed, 8 Jun 2016 01:33:58 +0000 (01:33 +0000)]
Merge \"Fix payload size for GATT Read by type request\" into nyc-dev
am: 73ee3314ed

Change-Id: I449e8aa3437ac39f8786d82dbfb6a320d1ba51d7

8 years agoMerge \"Reject L2CAP INFO RSP and ECHO RSP on the LE signaling channel\" into nyc-dev
Venkata Jagadeesh [Wed, 8 Jun 2016 01:33:58 +0000 (01:33 +0000)]
Merge \"Reject L2CAP INFO RSP and ECHO RSP on the LE signaling channel\" into nyc-dev
am: e67263c5e6

Change-Id: Id7cb7cc9d1d10138a3233562513c5bf96090b73a

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 agoRemote device changes for SMP certification
Nitin Arora [Wed, 8 Jun 2016 01:05:07 +0000 (01:05 +0000)]
Remote device changes for SMP certification
am: 9ded3b71de

Change-Id: I94cf61e64d92b8bf2658941059507958c7feec75

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"...
JivakDhadse [Tue, 7 Jun 2016 00:15:33 +0000 (00:15 +0000)]
Merge "Revert "DO NOT MERGE Proper construction of AVDTP general reject message"" into nyc-dev
am: a3f785a138

* commit 'a3f785a138ab67c6533de4f427e777c222e4352e':
  Revert "DO NOT MERGE Proper construction of AVDTP general reject message"

Change-Id: I180dcc5e72104217af72311be8b1eb0bb38464d4

8 years agoMerge "Clear BLE block from device records at unpair" into nyc-dev
Nitin Arora [Tue, 7 Jun 2016 00:15:32 +0000 (00:15 +0000)]
Merge "Clear BLE block from device records at unpair" into nyc-dev
am: 8c919fb37a

* commit '8c919fb37a56f3a6a2e30564e1356bf93c468b5a':
  Clear BLE block from device records at unpair

Change-Id: Iee861ef44ca133bf4d2c0a1604a134d86a8c202d

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 agoFix for issue introduced due to rebase of LE L2CAP COC
Navin Kochar [Mon, 6 Jun 2016 20:30:06 +0000 (20:30 +0000)]
Fix for issue introduced due to rebase of LE L2CAP COC
am: be3f7f9d24

* commit 'be3f7f9d244ca39a9a5a27afd3b117f83b69e0e4':
  Fix for issue introduced due to rebase of LE L2CAP COC

Change-Id: Ibe88def5c20b8192e16db4c723c539c41921d9f7

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 agoHFP 1.7 profile update (1/4)
Mudumba Ananth [Mon, 29 Feb 2016 10:21:43 +0000 (02:21 -0800)]
HFP 1.7 profile update (1/4)

-> Added AG support for HFP 1.7 version upgrade which
   adds new type of indicator called HF(headset) indicators.
-> Added support for two new AT commands AT + BIND and AT + BIEV
   which have been appended to Hands-Free SLC sequence.
-> Added support to propagate the above commands and their data to
   the upper layers.

Bug: 19983867
Change-Id: I93d5b2af949f9fb99507a954e623cd0927ddc976

8 years agoHID: Check for EINTR in uhid_event() and fix return value evaluation
Andre Eisenbach [Wed, 1 Jun 2016 03:01:17 +0000 (03:01 +0000)]
HID: Check for EINTR in uhid_event() and fix return value evaluation
am: 32d66694e9

* commit '32d66694e9f782a0e9dfa423015284a573f8975c':
  HID: Check for EINTR in uhid_event() and fix return value evaluation

Change-Id: I0b762d88a94c33a78384e4dbd85fe1325b5e6e7d

8 years agoBump HDP version to 1.1
Andre Eisenbach [Tue, 31 May 2016 21:18:36 +0000 (14:18 -0700)]
Bump HDP version to 1.1

Change-Id: I0bdec6fffa097dc919ee495216a2f272cc0dcf1e
(cherry picked from commit bb838444c37642b7272e3ae4acaaa7a06a568cdb)

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 20:44:09 +0000 (20:44 +0000)]
Update the HCI unit test if BT_CLEAN_TURN_ON_DISABLED is TRUE
am: 6834570262

* commit '6834570262116974a176cd8598b6d0ca6d031aca':
  Update the HCI unit test if BT_CLEAN_TURN_ON_DISABLED is TRUE

Change-Id: Ie47f42f72515b974a51749acda0496c8467ff636

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 [Fri, 27 May 2016 04:16:15 +0000 (04:16 +0000)]
Add minimum LE connection timeout that can be used for HID devices
am: bfc90ee868

* commit 'bfc90ee868b042aa245eed8305047b35bddfdc5c':
  Add minimum LE connection timeout that can be used for HID devices

Change-Id: Ib7b42b46a48bf0d1b063fc51ba2bf9bf447f3831

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 03:20:41 +0000 (03:20 +0000)]
Remove the RFComm MCB from the ports when releasing it
am: 77c3905fe7

* commit '77c3905fe7907bd10b0d24dbe469ba74f546e00e':
  Remove the RFComm MCB from the ports when releasing it

Change-Id: I0a7c0a85026add0a4c892c01aea24af448e66c8c