OSDN Git Service

android-x86/system-bt.git
7 years agoUse C++ style std::string instead of C-style string
Pavlin Radoslavov [Tue, 16 Aug 2016 17:44:36 +0000 (10:44 -0700)]
Use C++ style std::string instead of C-style string

Change-Id: I323187bca7555adada2a8a5cf2c25e30592040b1

7 years agoMerge "Make default SBC bitrate configurable by device."
Sridhar Vashist [Tue, 16 Aug 2016 10:21:38 +0000 (10:21 +0000)]
Merge "Make default SBC bitrate configurable by device."
am: 57e911ea25

Change-Id: I3233e531e724bb1fa27afc73bc78c5fdf3ad5117

7 years agoMerge "Make default SBC bitrate configurable by device."
Treehugger Robot [Tue, 16 Aug 2016 10:15:01 +0000 (10:15 +0000)]
Merge "Make default SBC bitrate configurable by device."

7 years agoMerge "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."
Sridhar Vashist [Tue, 16 Aug 2016 09:44:06 +0000 (09:44 +0000)]
Merge "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."
am: 21a7e48c0f

Change-Id: If6b31a75dfd04c69e620402e81df741c348f714c

7 years agoMerge "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."
Treehugger Robot [Tue, 16 Aug 2016 09:37:37 +0000 (09:37 +0000)]
Merge "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."

7 years agoMake default SBC bitrate configurable by device.
Sridhar Vashist [Wed, 14 Oct 2015 22:47:02 +0000 (17:47 -0500)]
Make default SBC bitrate configurable by device.

Configurable default SBC bitrate so that audio quality can be maintained
for sampling rates other than 44.1kHz

Change-Id: Ia4197c0a500088cfa48a8ba821e9738a16c3fc6e
Signed-off-by: Sridhar Vashist <svashist@motorola.com>
(cherry picked from commit 5f308397b7fe8a8da3f88b0f8910c3863ed1ec0b)

7 years agoMerge "GATT: Deregister notification when a GATT connection is closed"
ugo_yu [Tue, 16 Aug 2016 08:30:32 +0000 (08:30 +0000)]
Merge "GATT: Deregister notification when a GATT connection is closed"
am: bb75465676

Change-Id: Ia3bd8ef88282634a6d142593f9edb8ba41c65ac5

7 years agoMerge "GATT: Deregister notification when a GATT connection is closed"
Treehugger Robot [Tue, 16 Aug 2016 08:22:56 +0000 (08:22 +0000)]
Merge "GATT: Deregister notification when a GATT connection is closed"

7 years agoAlways send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE.
Sridhar Vashist [Fri, 7 Aug 2015 00:40:24 +0000 (19:40 -0500)]
Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE.

There appear to be race cases where the peer sends a START before
we reconfigure the stream. Avoid btif_av state from getting
mismatched by always sending out the SUSPEND_CFM during RECONFIGURE.

Change-Id: I2034cd111466f792233cedb60a3a0df11d055962
Signed-off-by: Sridhar Vashist <svashist@motorola.com>
(cherry picked from commit 8b1c7af03a2a8eedd1efd2eddca3ecd4b61bfd95)

7 years agoMerge "Check size of pin before replying"
Marie Janssen [Tue, 16 Aug 2016 07:40:58 +0000 (07:40 +0000)]
Merge "Check size of pin before replying"
am: 545ac907dd

Change-Id: Ibbf6e58b4297871899baa85b9bfa3510eac402b1

7 years agoMerge "Check size of pin before replying"
Treehugger Robot [Tue, 16 Aug 2016 07:35:18 +0000 (07:35 +0000)]
Merge "Check size of pin before replying"

7 years agoaudio_a2dp_hw: Always update frame counter in out_write
Andy Hung [Tue, 16 Aug 2016 07:24:56 +0000 (07:24 +0000)]
audio_a2dp_hw: Always update frame counter in out_write
am: cd85170ab8

Change-Id: Ic87913c0b7d8ed7d3d8dceb4a292517706e1724b

7 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
(cherry picked from commit 7592bcfe7a0be9dc4ffdfc3f29bf68fd68950418)

7 years agoCheck size of pin before replying
Marie Janssen [Wed, 9 Mar 2016 23:31:48 +0000 (15:31 -0800)]
Check size of pin before replying

If a malicious client set a pin that was too long it would overflow
the pin code memory.

Bug: 27411268
Change-Id: I9197ac6fdaa92a4799dacb6364e04671a39450cc
(cherry picked from commit 7120b9f35f1c3d8b4f115bc9bb39ab39443886e1)

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)

7 years agoRemove SBC frame scrambling
Andre Eisenbach [Tue, 16 Aug 2016 05:46:52 +0000 (05:46 +0000)]
Remove SBC frame scrambling
am: 7fcea70080

Change-Id: If59587ff211e5ce378e4258aabcb7a32774553a9

7 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
(cherry picked from commit 470aee234664fd75094c16dd2c70313ee28354c1)

7 years agoMerge "New status code for two SMP authorization failures"
Jacky Cheung [Tue, 16 Aug 2016 03:40:18 +0000 (03:40 +0000)]
Merge "New status code for two SMP authorization failures"
am: b29732059e

Change-Id: I8d05dde66952f263ebfcc81cbc38b0f27675efd7

7 years agoHID: Check for EINTR in uhid_event() and fix return value evaluation
Andre Eisenbach [Tue, 16 Aug 2016 03:40:15 +0000 (03:40 +0000)]
HID: Check for EINTR in uhid_event() and fix return value evaluation
am: acb093ada7

Change-Id: I4c7269a3aee069ca725eec0faa885100171e198d

7 years agoMerge "New status code for two SMP authorization failures"
Treehugger Robot [Tue, 16 Aug 2016 03:37:09 +0000 (03:37 +0000)]
Merge "New status code for two SMP authorization failures"

7 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
(cherry picked from commit 6984b19d95736d7205fc6302a21e8be564617287)

7 years agoRemoved bogus leftover code that wasn't auto-merged properly
Pavlin Radoslavov [Tue, 16 Aug 2016 00:43:30 +0000 (17:43 -0700)]
Removed bogus leftover code that wasn't auto-merged properly

Change-Id: I41c2869ae32f08bc170cc222f036e0bc207b81f9

7 years agoRefactor vendor library to use async manager class
Jorge E. Moreira [Mon, 15 Aug 2016 21:21:25 +0000 (21:21 +0000)]
Refactor vendor library to use async manager class
am: 0b32c8d8c1

Change-Id: Ifeb58d21c5343f7fe42b6bce87cb03b2063003ee

7 years agoAdded the async manager
Jorge E. Moreira [Mon, 15 Aug 2016 21:21:23 +0000 (21:21 +0000)]
Added the async manager
am: 08c214154d

Change-Id: I583d351023846be861018cd67f5410a50d98a12a

7 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
(cherry picked from commit 32d66694e9f782a0e9dfa423015284a573f8975c)

7 years agoRefactor vendor library to use async manager class
Jorge E. Moreira [Mon, 8 Aug 2016 18:39:52 +0000 (11:39 -0700)]
Refactor vendor library to use async manager class

Homogenizes the use of lambdas/binds (uses c++ lambdas only)
Uses STL's time library implementation (std::chrono)

Change-Id: I6194b26c0a7fabffddf96acb5c2379ff52026a84

7 years agoAdded missing #include directives
Jorge E. Moreira [Mon, 15 Aug 2016 21:13:38 +0000 (21:13 +0000)]
Added missing #include directives
am: 65ee728284

Change-Id: I5b293b7ff4665312efdf1bcc00a6f2f5058d2670

7 years agoAdded the async manager
Jorge E. Moreira [Mon, 8 Aug 2016 18:39:52 +0000 (11:39 -0700)]
Added the async manager

Change-Id: I968fee42fd610e33e13bf358f54bec1fe7af4a7d

7 years agoAdded missing #include directives
Jorge E. Moreira [Tue, 9 Aug 2016 22:21:01 +0000 (15:21 -0700)]
Added missing #include directives

Change-Id: Ia26cd6775699c65a75d94003c09730926835f7a3

7 years agoReplace calls to std::bind by lambda expressions
Jorge E. Moreira [Mon, 15 Aug 2016 20:51:50 +0000 (20:51 +0000)]
Replace calls to std::bind by lambda expressions
am: 97980c25a1

Change-Id: Iad98f599d6bd802c42b583c6bb5d8e75da568839

7 years agoNo longer uses the macro DISALLOW_COPY_AND_ASSIGN
Jorge E. Moreira [Mon, 15 Aug 2016 19:17:44 +0000 (19:17 +0000)]
No longer uses the macro DISALLOW_COPY_AND_ASSIGN
am: 83cf95e0a1

Change-Id: I6bd4c3d3bb9b12ce8a167769ce4be5dbefebe10a

7 years agoUsing include paths relative to vendor library dir
Jorge E. Moreira [Mon, 15 Aug 2016 19:17:41 +0000 (19:17 +0000)]
Using include paths relative to vendor library dir
am: ea3ede2474

Change-Id: Ic703fda9a8c7d72f6fb563069d1948f190ac7924

7 years agoReplace calls to std::bind by lambda expressions
Jorge E. Moreira [Fri, 5 Aug 2016 18:07:07 +0000 (11:07 -0700)]
Replace calls to std::bind by lambda expressions

Change-Id: I5fbe6ae6d5172e87428322084276e593a67fd7d1

7 years agoNo longer uses the macro DISALLOW_COPY_AND_ASSIGN
Jorge E. Moreira [Thu, 4 Aug 2016 23:55:31 +0000 (16:55 -0700)]
No longer uses the macro DISALLOW_COPY_AND_ASSIGN

Change-Id: I3403cdfa38fabf56ffe0854064eeb0ae38eb5a4a

7 years agoUsing include paths relative to vendor library dir
Jorge E. Moreira [Thu, 4 Aug 2016 23:46:45 +0000 (16:46 -0700)]
Using include paths relative to vendor library dir

Change-Id: I6b5dfa4098cdf2eda21d3fae60729b765532c2f9

7 years agoMerge "Improve BT HAL write response to BT server reads"
Andy Hung [Mon, 15 Aug 2016 18:20:11 +0000 (18:20 +0000)]
Merge "Improve BT HAL write response to BT server reads"
am: f65e83e5b1

Change-Id: Ib48a998e19b3eada7d19897b81626f60309062b3

7 years agoMerge "Improve BT HAL write response to BT server reads"
Treehugger Robot [Mon, 15 Aug 2016 18:15:31 +0000 (18:15 +0000)]
Merge "Improve BT HAL write response to BT server reads"

7 years agoSeparate the Alarm unit tests from testing the Wakelocks
Pavlin Radoslavov [Mon, 15 Aug 2016 17:59:38 +0000 (17:59 +0000)]
Separate the Alarm unit tests from testing the Wakelocks
am: 223cecf8b6

Change-Id: Iceb0a3e4d2f776456cad88a5276dbd9516baf175

7 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
(cherry picked from commit 5952e40bef1afb310cd3bba7e673163d7e32d62c)

7 years agoSeparate the Alarm unit tests from testing the Wakelocks
Pavlin Radoslavov [Mon, 8 Aug 2016 18:18:47 +0000 (11:18 -0700)]
Separate the Alarm unit tests from testing the Wakelocks

* Simplify the AlarmTestHarnless unit test setup for Wakelocks.
  Now we use wakelock_set_os_callouts() to setup local unit tests and
  to keep local state whether the wakelock is acquired.
  Also, removed unused timer-related setup inside AlarmTestHarnless.

* Add explicit Wakelock unit tests

Change-Id: I08bd8d457fd48ec45a8a591bd69cb08dbaf5ee7a

7 years agoAdd LE Secure Connection data parsing (3/4)
Jakub Pawlowski [Thu, 11 Aug 2016 23:06:57 +0000 (23:06 +0000)]
Add LE Secure Connection data parsing (3/4)
am: bd60854e49

Change-Id: Ia33a911e973fe22b72a4bf4f3ce89d20b9b71fea

7 years agoAdd LE Secure Connection data parsing (3/4)
Jakub Pawlowski [Thu, 28 Jul 2016 12:58:35 +0000 (05:58 -0700)]
Add LE Secure Connection data parsing (3/4)

Bug: 30460956
Change-Id: I216142090fe99b25ef7697fceceb278b761a182b

7 years agoRevert "Register for Service Changed notifications for untrusted devices"
Satomi [Tue, 9 Aug 2016 20:23:51 +0000 (20:23 +0000)]
Revert "Register for Service Changed notifications for untrusted devices"
am: 42657c2f23

Change-Id: I01ff859d5158904695965a0038b252fc98c9096d

7 years agoRevert "Register for Service Changed notifications for untrusted devices"
Satomi [Tue, 9 Aug 2016 15:19:03 +0000 (08:19 -0700)]
Revert "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 agostrlcpy call size fixes, memory clearing
Satish Kodishala [Tue, 9 Aug 2016 18:13:45 +0000 (18:13 +0000)]
strlcpy call size fixes, memory clearing
am: 4fd9ce1b4d

Change-Id: I563fa0319297ae930efc5eb114ecf639b0a5096e

7 years agostrlcpy call size fixes, memory clearing
Satish Kodishala [Fri, 5 Feb 2016 07:05:54 +0000 (12:35 +0530)]
strlcpy call size fixes, memory clearing

Usecase:
1. Run PTS test cases IIA BV-03-I/IIC BV-02-I/IID BV-01-I

Failure:
Randomly errors are returned for AT+BIA from PTS.

Cause:
Command parsing advances the check beyond the string end,
which is not guaranteed to be zeroed.

Fix:
Break string parsing when the end of string is encountered
after a AT+BIA argument.

Bug: 29615016

Change-Id: Ifc77435e780fba34006372694a7da4758e4f8c36

7 years agoMerge "Fix descriptor write"
Jakub Pawlowski [Tue, 9 Aug 2016 10:56:15 +0000 (10:56 +0000)]
Merge "Fix descriptor write"
am: a8be6caf45

Change-Id: I6346731e787457bbd013c958ccb306f470e9bc00

7 years agoMerge "Fix descriptor write"
Jakub Pawlowski [Tue, 9 Aug 2016 10:48:53 +0000 (10:48 +0000)]
Merge "Fix descriptor write"

7 years agoFix descriptor write
Jakub Pawlowski [Tue, 9 Aug 2016 10:44:05 +0000 (03:44 -0700)]
Fix descriptor write

This patch fixes error introduced in commit
bb920a65b959fbb593403587f89bc3fc7e831732
Writing descriptor was broken, ACTS tests were failing.

Change-Id: Ied2ff4a12df1053961677fdcb824838b7946dbaa

7 years agoAdd dumpsys support for LE connection parameter updates
Jacky Cheung [Mon, 8 Aug 2016 17:46:40 +0000 (17:46 +0000)]
Add dumpsys support for LE connection parameter updates
am: 8ec8ca4a87

Change-Id: I0966798416b8a7c784f4b1e6d5af593e91006990

7 years agoAdd dumpsys support for LE connection parameter updates
Jacky Cheung [Thu, 4 Aug 2016 17:20:39 +0000 (10:20 -0700)]
Add dumpsys support for LE connection parameter updates

Change-Id: Ie203eec9d8efec0d55b1b10208c64a98449044a2
(cherry picked from commit 4e5514b69b95ee1416fb0d0b5e7783bcfe1612ab)

7 years agoresolve merge conflicts of d19e078 to stage-aosp-master
Marie Janssen [Sat, 6 Aug 2016 00:02:23 +0000 (17:02 -0700)]
resolve merge conflicts of d19e078 to stage-aosp-master

Change-Id: I901ce1a7cafc2f526d8a7e515e9fe8ffdd20f33e

7 years agoUse standard types, consistent ifdef style everywhere
Marie Janssen [Fri, 15 Jul 2016 19:48:27 +0000 (12:48 -0700)]
Use standard types, consistent ifdef style everywhere

Remove the typedefs in stack/include/bt_types.h

Use standard types everywhere.
Use standard style for #if statements:
 - #if (VAR_NAME == TRUE)
 - #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Update script to be less disruptive to aligned assignment blocks.

Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0

7 years agoFix APR crashes in read rssi callback
Jakub Pawlowski [Fri, 5 Aug 2016 19:21:35 +0000 (19:21 +0000)]
Fix APR crashes in read rssi callback
am: 7294d958dc

Change-Id: I5e7daa5962e92c8fb2c6adf683fe616f0af294d1

7 years agoFix APR crashes in read rssi callback
Jakub Pawlowski [Wed, 3 Aug 2016 22:43:56 +0000 (15:43 -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: I05b7eb2808c58655525ed5c7019ae175181c837a

7 years agoImplements some additional commands
Greg Hartman [Thu, 4 Aug 2016 23:27:29 +0000 (23:27 +0000)]
Implements some additional commands
am: 03c2c7c22a

Change-Id: I5a0f2011966daad1679a4f196996552db40f5e56

7 years agoImplements some additional commands
Greg Hartman [Tue, 26 Jul 2016 20:19:02 +0000 (13:19 -0700)]
Implements some additional commands

- Added/Improved responses to certain opcodes on bt_vendor.cc
- Added handlers for a couple of commands used in L

Change-Id: I85c02553057e4ea3a3e51795c2e1a2bb679fd5e1

7 years agoHFP 1.7 profile update (1/4)
Mudumba Ananth [Thu, 4 Aug 2016 01:37:03 +0000 (01:37 +0000)]
HFP 1.7 profile update (1/4)
am: 4de9bbcde7

Change-Id: I52433802594e44702152b57f00f7d5511f4741ac

7 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
(cherry picked from commit e5bed64926d6ae45501617052f90932287da135b)

7 years agoRmove write type from GATT descriptor writes (4/4)
Jakub Pawlowski [Thu, 4 Aug 2016 00:01:51 +0000 (00:01 +0000)]
Rmove write type from GATT descriptor writes (4/4)
am: bb920a65b9

Change-Id: I9301e43850d5e97256f3eca0a47047c47757c08b

7 years agoRmove write type from GATT descriptor writes (4/4)
Jakub Pawlowski [Tue, 21 Jun 2016 23:16:09 +0000 (16:16 -0700)]
Rmove write type from GATT descriptor writes (4/4)

According to the Bluetooth Core specification v4.2, Vol 3, Part G,
section 4.12.3: "The Attribute Protocol WRITE REQUEST is used
for this sub-procedure".

Change-Id: I60bb0b1489b417af96975265a023c356ace293bd

7 years agoMerge changes from topic 'beautiful-gatt-server'
Jakub Pawlowski [Wed, 3 Aug 2016 13:00:52 +0000 (13:00 +0000)]
Merge changes from topic 'beautiful-gatt-server'
am: 3cf12a6cfc

Change-Id: I542982eb13daa23c2ee75c74c3a0a04a94449de0

7 years agoMerge changes from topic 'beautiful-gatt-server'
Jakub Pawlowski [Wed, 3 Aug 2016 10:21:43 +0000 (10:21 +0000)]
Merge changes from topic 'beautiful-gatt-server'

* changes:
  GATT Server refactoring (4/4)
  Add C++ Parcelable types for Service, Characteristic, Descriptor

7 years agoMerge "Fix build when SMP_DEBUG=TRUE plus logging improvements"
Jakub Pawlowski [Mon, 1 Aug 2016 22:36:53 +0000 (22:36 +0000)]
Merge "Fix build when SMP_DEBUG=TRUE plus logging improvements"
am: 980147c889

Change-Id: I97ffc1ef3c2a953f486829b57da9f558c2b3ecd5

7 years agoMerge "Fix build when SMP_DEBUG=TRUE plus logging improvements"
Treehugger Robot [Mon, 1 Aug 2016 22:29:31 +0000 (22:29 +0000)]
Merge "Fix build when SMP_DEBUG=TRUE plus logging improvements"

7 years agoRelax some of the timing parameters in the Alarm unit tests
Pavlin Radoslavov [Fri, 29 Jul 2016 17:18:14 +0000 (17:18 +0000)]
Relax some of the timing parameters in the Alarm unit tests
am: 9713b9476c

Change-Id: Ibb7599098fd10e2b005622488160ffdce10aea3f

7 years agoGATT Server refactoring (4/4)
Jakub Pawlowski [Sat, 26 Mar 2016 07:47:23 +0000 (00:47 -0700)]
GATT Server refactoring (4/4)

Right now in order to add gatt service, we need to add it piece by
piece - each characteristic and descriptor separately. This causes lots
of concurrency errors in higher layers. Instead accept whole service
definition and start whole service at once.

Also, use handles to identify GATT server attributes. It's already done
on clinet side.

Bug: 27999121
Change-Id: I42c796809423d116fe6755ef8b1c40da270427a5

7 years agoAdd C++ Parcelable types for Service, Characteristic, Descriptor
Jakub Pawlowski [Tue, 24 May 2016 19:42:45 +0000 (12:42 -0700)]
Add C++ Parcelable types for Service, Characteristic, Descriptor

This types will be used in upcoming GATT Client/Server code. They will
match ones you can found in frameworks/base.

Change-Id: I6080310a726bcbcd0cd36970712928b188f7bd24

7 years agoFix build when SMP_DEBUG=TRUE plus logging improvements
Jakub Pawlowski [Thu, 28 Jul 2016 13:11:36 +0000 (06:11 -0700)]
Fix build when SMP_DEBUG=TRUE plus logging improvements

Bug: 30460956
Change-Id: I2611501d1961b104c8e66b1a3fca414936dc321f

7 years agoRelax some of the timing parameters in the Alarm unit tests
Pavlin Radoslavov [Thu, 28 Jul 2016 20:11:10 +0000 (13:11 -0700)]
Relax some of the timing parameters in the Alarm unit tests

In certain environments (e.g., virtual machines), the alarm timeouts
can late by tens of ms (40ms have been observed in some cases).
Relaxing some of the unit tests timing parameters, so we can
continue testing for correctness as covered by the AlarmTest.

Bug: 28907913
Change-Id: I211c36a689774c5cdf427039e4c9184cf4147604

7 years agoProper handling of AV connection collision
Ayan Ghosh [Thu, 28 Jul 2016 06:24:04 +0000 (06:24 +0000)]
Proper handling of AV connection collision
am: 09d91c0ceb

Change-Id: I7ace6b2005e544c8821271a9d575ee49f883ada1

7 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

7 years agoAllow the Bluetooth test library to be used as a vendor library
Greg Hartman [Tue, 26 Jul 2016 19:58:58 +0000 (19:58 +0000)]
Allow the Bluetooth test library to be used as a vendor library
am: 6bfe283db7

Change-Id: I0be79f4e37637a8af166a8b307c4b664bc777036

7 years agoAllow the Bluetooth test library to be used as a vendor library
Greg Hartman [Tue, 26 Jul 2016 03:22:48 +0000 (20:22 -0700)]
Allow the Bluetooth test library to be used as a vendor library

Change-Id: I479fd72482399f878ef045271c7b493c94aa5ab7

7 years agobtif: Fix logic bug within register_application
Greg Kaiser [Mon, 25 Jul 2016 22:45:12 +0000 (22:45 +0000)]
btif: Fix logic bug within register_application
am: 696996c115

Change-Id: Id2c2d4d2c171dfa9d8389a901e1f0f627628fa8e

7 years agobtif: Fix logic bug within register_application
Greg Kaiser [Mon, 27 Jun 2016 18:27:09 +0000 (11:27 -0700)]
btif: Fix logic bug within register_application

We were checking for the SINK bit twice in the same condition,
and would incorrectly report a SINK only mask as a DUAL device,
and would never hit the logic path to report a device as SINK.

Bug: 29763285
Change-Id: Ibc39db6396c09ddcd63896302dabf72841304cf2

7 years agoDon\'t use move in FOR_EACH_* macro
Jakub Pawlowski [Wed, 20 Jul 2016 15:10:48 +0000 (15:10 +0000)]
Don\'t use move in FOR_EACH_* macro
am: e84c4bdb5f

Change-Id: Ibda5234458e95627b16fcc94edb4331b2c8f960a

7 years agoDon't use move in FOR_EACH_* macro
Jakub Pawlowski [Wed, 20 Jul 2016 10:12:49 +0000 (03:12 -0700)]
Don't use move in FOR_EACH_* macro

FOR_EACH_* macros are resolved to for loop. Using std::move inside it
will cause already moved object to be used when more than one observer
is registered. This patch fixes that.

Change-Id: Iaaa314f5eeed4094d1e0fc951d3664fb1514ba15

7 years agoMake parameter set S4 default for eSCO
Andre Eisenbach [Mon, 18 Jul 2016 22:23:16 +0000 (22:23 +0000)]
Make parameter set S4 default for eSCO
am: 3edefef0ce

Change-Id: I2beae8e74d45d29ca8868b9baa62ef3c818ed1de

7 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
(cherry picked from commit af5b8248593c80acd8b1afb695eafe5801b44f7d)

8 years agoProcess Gatt read multiple response properly
Subramanian Srinivasan [Mon, 18 Jul 2016 09:16:05 +0000 (09:16 +0000)]
Process Gatt read multiple response properly
am: 089cd116de

Change-Id: Ieff85e5040d7fa3db24a7946a05d4958480ddd08

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

8 years agoFix linux build, missing strlcpy
Jakub Pawlowski [Thu, 14 Jul 2016 19:36:45 +0000 (19:36 +0000)]
Fix linux build, missing strlcpy
am: 3a2dc880ce

Change-Id: I306f667701519fed87b97138e0b47aab0cf2cc3d

8 years agoUpdate libchrome BUILD.gn
Jakub Pawlowski [Thu, 14 Jul 2016 17:59:40 +0000 (17:59 +0000)]
Update libchrome BUILD.gn
am: 3ad44520b8

Change-Id: If6e3c284c52fe8db1cbb61c7a41ec0024b5a696a

8 years agoFix linux build, missing strlcpy
Jakub Pawlowski [Thu, 14 Jul 2016 11:55:18 +0000 (04:55 -0700)]
Fix linux build, missing strlcpy

Compilation was failing with "missing strlcpy", this patch fixes that

Change-Id: Ic35d4bf4bed065fce27250a2d63d2fff606f6a3e

8 years agoUpdate libchrome BUILD.gn
Jakub Pawlowski [Thu, 14 Jul 2016 11:53:30 +0000 (04:53 -0700)]
Update libchrome BUILD.gn

Update BUILD.gn to match libchrome from top of AOSP.

Change-Id: I1d8638d67f816479e58af627ab5bd00649b72697

8 years agoAdd OnConnectionStateChanged to IBluetoothGattServerCallback
Jakub Pawlowski [Tue, 12 Jul 2016 22:13:55 +0000 (22:13 +0000)]
Add OnConnectionStateChanged to IBluetoothGattServerCallback
am: 7932727cbe

Change-Id: I9edcca7deb2484d8b64c8f63872b4b08c9f4ecc6

8 years agoAdd OnConnectionStateChanged to IBluetoothGattServerCallback
Jakub Pawlowski [Thu, 7 Jul 2016 23:40:11 +0000 (16:40 -0700)]
Add OnConnectionStateChanged to IBluetoothGattServerCallback

Currently native GattServer clients can't tell wether someone connected
or disconnnected to the device. This patch fixed that, by exposing
OnConnectionStateChangedCallback

Bug: 29835693
Change-Id: Ia7ef592f4031d021ab1b45808126ca57f9348d0e

8 years agoFix the implementation of macro BTM_IS_PUBLIC_BDA()
Chih-Hung Hsieh [Fri, 8 Jul 2016 18:47:25 +0000 (18:47 +0000)]
Fix the implementation of macro BTM_IS_PUBLIC_BDA()
am: 42e055353c

Change-Id: I9273b46c7e11da04f93cd38383de697dcf3dc750

8 years agoFix the implementation of macro BTM_IS_PUBLIC_BDA()
Chih-Hung Hsieh [Fri, 8 Jul 2016 17:29:55 +0000 (10:29 -0700)]
Fix the implementation of macro BTM_IS_PUBLIC_BDA()

Bug: 28705665
Change-Id: Id714a799c649ff85cf8bab9d8370626606fa7f2c

8 years agoDisable auto-pairing for hands-free devices
Andre Eisenbach [Thu, 7 Jul 2016 23:11:20 +0000 (23:11 +0000)]
Disable auto-pairing for hands-free devices
am: 43b12942ca

Change-Id: I1ca91fdcf1be9be6e1048123b79bf2eb4f44a60f

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 callbacks to GATT read/write operation
Jakub Pawlowski [Sat, 2 Jul 2016 01:39:08 +0000 (01:39 +0000)]
Add callbacks to GATT read/write operation
am: 24ea892320

Change-Id: I49b30d782f1260f63a75a4006c61b9ecc0f23d76

8 years agoAdd callbacks to GATT read/write operation
Jakub Pawlowski [Fri, 13 May 2016 23:39:25 +0000 (16:39 -0700)]
Add callbacks to GATT read/write operation

There is no need for read/write callback to be a global event. It should
execute local callback instead.

Change-Id: Id7e915af9d30092d2f754eddc7c3aed4970eeb2f

8 years agoAdd logs for AVRCP commands that originate from a remote device
Ajay Panicker [Fri, 1 Jul 2016 23:22:30 +0000 (23:22 +0000)]
Add logs for AVRCP commands that originate from a remote device
am: da34e5b65e

Change-Id: Ia29f28b3bb71da2b1f1beec72dad059fa9febf3f

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 agoMerge \"SMP: Delay authorization complete.\"
Jacky Cheung [Fri, 1 Jul 2016 20:27:44 +0000 (20:27 +0000)]
Merge \"SMP: Delay authorization complete.\"
am: 8afa82d0c3

Change-Id: Iade6d0379d44b26c6b2b401985c09e16916915d4

8 years agoMerge "SMP: Delay authorization complete."
Jacky Cheung [Fri, 1 Jul 2016 20:23:35 +0000 (20:23 +0000)]
Merge "SMP: Delay authorization complete."

8 years agoFix google-explicit-constructor warnings in system/bt.
Chih-Hung Hsieh [Thu, 30 Jun 2016 23:57:54 +0000 (23:57 +0000)]
Fix google-explicit-constructor warnings in system/bt.
am: 3398730eac

Change-Id: I54f2a53f6a2a6bf3ceb524966d98e2c1c80a58a3

8 years agoFix google-explicit-constructor warnings in system/bt.
Chih-Hung Hsieh [Thu, 30 Jun 2016 22:45:24 +0000 (15:45 -0700)]
Fix google-explicit-constructor warnings in system/bt.

* Declare conversion constructors as 'explicit'.
* Add NOLINT to implicit converters.

Bug: 28341362
Change-Id: I81fecf19c0ee2e64dd6778b3dea78e04f111bfb4
Test: build with clang-tidy