OSDN Git Service
Myles Watson [Fri, 19 Aug 2016 15:22:42 +0000 (15:22 +0000)]
Add a socket unit test for the async_manager
This reverts commit
10986700c302f79376894ebef9f2ec92a65b8b08.
Which reverted commit
1387d4330da52034af67d1dbc61b870e8f89c820.
Some minor style changes as well.
Change-Id: I83ea40b4cf96adfa58c24d0cd9109ed9974519f1
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: I9deba6821284f0cb1423d543550786cc76a61a33
(cherry picked from commit
825cd49864f7338be8b33f901ddf3be8e1bab7c1)
Jorge E. Moreira [Tue, 16 Aug 2016 18:55:27 +0000 (11:55 -0700)]
Added cancelling for fd watching on async manager
Change-Id: I4107b3b50345f81833c47c85c4a322a582973bb2
Myles Watson [Thu, 18 Aug 2016 16:22:01 +0000 (16:22 +0000)]
Revert "Added unit test for async_manager with sockets"
This reverts commit
1387d4330da52034af67d1dbc61b870e8f89c820.
Change-Id: I4af4e0d5ac5a108f3de44d186db97592a70c729e
Jorge E. Moreira [Wed, 17 Aug 2016 20:53:00 +0000 (13:53 -0700)]
Added unit test for async_manager with sockets
Change-Id: I8d31f766722e4b4a6c6fe00e30a957ac43176cf1
Chih-Hung Hsieh [Wed, 17 Aug 2016 21:12:51 +0000 (14:12 -0700)]
Fix clang-tidy warnings in bt.
* Add explicit keyword to conversion constructors,
or add NOLINT to implicit conversion constructors.
Bug:
28341362
* Use const reference type for read-only parameters,
or add NOLINT to keep same callback function signature.
Bug:
30407689
* Use const reference type for loop index variables to avoid unnecessary copy.
Bug:
30413223
* Use const reference type to avoid unnecessary copy.
Bug:
30413862
Test: build with WITH_TIDY=1
Change-Id: I8237d332f32d7be09ab72a8de82160fdb776dcd1
Jorge E. Moreira [Wed, 17 Aug 2016 20:59:15 +0000 (13:59 -0700)]
Fix incorrect fd used for select() call in vendor lib async_manager
Change-Id: Iabb8389ee6fcef0f9c6a17838d6a3a9a517befc6
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
Pavlin Radoslavov [Wed, 17 Aug 2016 02:42:16 +0000 (19:42 -0700)]
Synchronize the code with the internal tree
Spacing, line split, etc.
Change-Id: I781e771e93b104bbc044d1646106c19d8af55e7b
Treehugger Robot [Wed, 17 Aug 2016 01:44:34 +0000 (01:44 +0000)]
Merge "Fix a typo in pre-compiler error message"
Glenn Kasten [Tue, 8 Mar 2016 20:11:38 +0000 (12:11 -0800)]
Fix a typo in pre-compiler error message
Change-Id: Ia584c748ea065739e0f6df1ea8a86df517a257af
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
(cherry picked from commit
d13870072e61e468e6cd8f3e007a1647f7001a14)
Sathya Kumar [Thu, 7 Jan 2016 23:26:05 +0000 (17:26 -0600)]
Disable 3Mbps packets for AVDT ACL links
Change-Id: I4b1b52ec8aeaf5eab0672231889e0ea6f23aa852
(cherry picked from commit
26bb30842b6c64821c2a6c4a515f290140017105)
Merged-In: I4b1b52ec8aeaf5eab0672231889e0ea6f23aa852
Treehugger Robot [Tue, 16 Aug 2016 10:15:01 +0000 (10:15 +0000)]
Merge "Make default SBC bitrate configurable by device."
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."
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)
Treehugger Robot [Tue, 16 Aug 2016 08:22:56 +0000 (08:22 +0000)]
Merge "GATT: Deregister notification when a GATT connection is closed"
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)
Treehugger Robot [Tue, 16 Aug 2016 07:35:18 +0000 (07:35 +0000)]
Merge "Check size of pin before replying"
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)
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)
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)
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)
Treehugger Robot [Tue, 16 Aug 2016 03:37:09 +0000 (03:37 +0000)]
Merge "New 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)
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)
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
Jorge E. Moreira [Mon, 8 Aug 2016 18:39:52 +0000 (11:39 -0700)]
Added the async manager
Change-Id: I968fee42fd610e33e13bf358f54bec1fe7af4a7d
Jorge E. Moreira [Tue, 9 Aug 2016 22:21:01 +0000 (15:21 -0700)]
Added missing #include directives
Change-Id: Ia26cd6775699c65a75d94003c09730926835f7a3
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
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
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
Treehugger Robot [Mon, 15 Aug 2016 18:15:31 +0000 (18:15 +0000)]
Merge "Improve 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)
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
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
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>
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
Jakub Pawlowski [Tue, 9 Aug 2016 10:48:53 +0000 (10:48 +0000)]
Merge "Fix 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
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)
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
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
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
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)
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
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
Treehugger Robot [Mon, 1 Aug 2016 22:29:31 +0000 (22:29 +0000)]
Merge "Fix build when SMP_DEBUG=TRUE plus logging improvements"
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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)
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
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
Jacky Cheung [Fri, 1 Jul 2016 20:23:35 +0000 (20:23 +0000)]
Merge "SMP: Delay authorization complete."
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
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
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
(cherry picked from commit
d881c4b46776fe03a5861a3021bbe739b1f3cc58)
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: Ie59ff23128b5d523aa13c4db599be97396097cc3
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
Jakub Pawlowski [Sat, 25 Jun 2016 00:06:41 +0000 (17:06 -0700)]
Simplify GATT characteristic read memory handling
Pass read result in a fixed sized array instead of a pointer.
This eliminates the need for any special memory management in btif.
Change-Id: I2a33d74b12f3059050855c9fc90fff785cc985ba
Andy Hung [Wed, 4 May 2016 22:47:05 +0000 (15:47 -0700)]
Match socket buffer sizes between audio HAL and BT server
Adjust our mixer buffer size to be one quarter that of
the socket buffer size for quadruple buffering.
Increase socket buffer size from 20*512 to 28*512 to
smooth out variability in data draw from AudioFlinger.
Bug:
28286313
Change-Id: I8a9ca9e1f4639a0724cfe126acc670c2058cb0fb
(cherry picked from commit
e97d975cce213b8c6e4f69bc3fc75411a1743647)
Jakub Pawlowski [Fri, 24 Jun 2016 21:05:58 +0000 (14:05 -0700)]
Get rid of unused BTA_DYNAMIC_MEMORY
Change-Id: Idc7fcddfecac9ab7d9800b496e2380ae277f357f
Jakub Pawlowski [Fri, 24 Jun 2016 20:36:01 +0000 (13:36 -0700)]
Use bta_gattc_cb directly, not through aliases
Right now, bta_gattc_cb is not used directly, instead it's passed as
argument to methods that can use it directly.
Change-Id: I54fef4b8b1e11b3289e7961f70bea187173e9804
Marie Janssen [Wed, 22 Jun 2016 19:52:19 +0000 (12:52 -0700)]
btif: standardize types, #ifs
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__
Change-Id: Ic29d1d0b32c3ca9953752a4e5da6c28f45ec8895
Jakub Pawlowski [Tue, 21 Jun 2016 23:16:09 +0000 (16:16 -0700)]
GATT: use one type for all server attributes
Right now we have three types, for attributes depending on how long
the uuid is. Instead, use one type.
Change-Id: I33bb4f3c57b7b1516eda871a77b71661b7ba39ce
Treehugger Robot [Mon, 20 Jun 2016 22:53:14 +0000 (22:53 +0000)]
Merge "Remove unused "cmn_ble_vsc_cb"; causing extended scan to not start"
Jakub Pawlowski [Tue, 31 May 2016 20:14:13 +0000 (13:14 -0700)]
Vectors as parameters to GATT (1/3)
Bug:
29005882
Bug:
28485365
Change-Id: I0a5041073a39977c4fbc29879c383fa6720da641
IHLHO KIM [Wed, 15 Jun 2016 05:27:53 +0000 (05:27 +0000)]
Remove unused "cmn_ble_vsc_cb"; causing extended scan to not start
The local variable "cmn_ble_vsc_cb" is referenced instead of btm_cb.
This causes generic LE scans to be used even though the controller
supports extended scans.
Change-Id: I8b1d817d4d04ee3a8db4285998b5a1916d046ccc
Marie Janssen [Fri, 17 Jun 2016 21:12:17 +0000 (14:12 -0700)]
bta: use standard types
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__
Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
Jakub Pawlowski [Fri, 27 May 2016 22:48:03 +0000 (15:48 -0700)]
Vectors as parameters to GATT write/indicate (1/3)
This changes are covered in test cases:
GattReadTest.*
GattWriteTest.*
Bug:
29005882
Bug:
28485365
Change-Id: I1409e6ead22ff691190f9ea4c3ffe2267bd3bf33
Jakub Pawlowski [Fri, 27 May 2016 16:42:21 +0000 (09:42 -0700)]
Use vector instead of C arrays in bta_gatt_api
This changes are covered in test cases:
GattReadTest.*
GattWriteTest.*
Bug:
28485365
Change-Id: I0bb098b4d5e991ed53d3276ac6f7174723c59444
Marie Janssen [Fri, 17 Jun 2016 20:13:21 +0000 (13:13 -0700)]
AVRCP: rename constant AVRC_CTLR_INCLUDED
Typo fixed to AVRC_CTRL_INCLUDED
Change-Id: Ib0ac11916bf6e856ae2d3cfb842bd0b8fef56008
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
(cherry picked from commit
4362b8c559575a83897a5af55202ce2c1d19925c)
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
(cherry picked from commit
af77225c0d7bec06d2417b0305ebcbab04144caa)
Jakub Pawlowski [Fri, 17 Jun 2016 19:12:36 +0000 (19:12 +0000)]
Merge "BTIF: remove unnecessary 'extern "C"'"
Treehugger Robot [Fri, 17 Jun 2016 01:13:14 +0000 (01:13 +0000)]
Merge "test_vendor_lib: refactor packet constructors"
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
Jakub Pawlowski [Thu, 16 Jun 2016 00:15:42 +0000 (17:15 -0700)]
BTIF: remove unnecessary 'extern "C"'
btif is all cpp now, with execption to uuid_to_string_legacy
and few methods imported/exported for main module.
There is no need to have c linkage for the rest of it.
Change-Id: I5e7079e1269dc6461b14b665587592270cdf3140
Myles Watson [Thu, 26 May 2016 21:13:42 +0000 (14:13 -0700)]
test_vendor_lib: refactor packet constructors
Make it simpler to append bytes to payloads, since that's a common
operation.
Change-Id: I7fc975fb999add8e1a360b91bdae869d6d7d2029
Signed-off-by: Myles Watson <mylesgw@google.com>
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
Jakub Pawlowski [Fri, 27 May 2016 00:57:22 +0000 (17:57 -0700)]
Convert HID and Device Manager BTA code to C++
These are the only places that use BTA GATTC API. After this change it's
possible to change GATT API to use C++ types as arguments.
Bug:
28485365
Change-Id: Idf83396f4bc3a2cc8a9b41f69da5d033af1be678
Dan Willemsen [Wed, 15 Jun 2016 22:46:15 +0000 (15:46 -0700)]
Fix unused source warning
These were using the wrong c++ extension, so the build system was not
picking them up.
Change-Id: I3a767a236bca05f04dd069bb1f40796f41cb8b60
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
(chery picked from commit
552e630435a68d8f51d458dccf8697c625cf1510)
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
(cherry picked from commit
e6b1cb43525e27f95de85dc43150d7368b9d4c35)
Jakub Pawlowski [Tue, 14 Jun 2016 16:26:24 +0000 (09:26 -0700)]
Add missing curly braces in clear notification
Change-Id: I59b13486f76735e5dd0c07d57b2671c746169bd8
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
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
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
Change-Id: Ica47717119f1ab9fa9f4f5244e8483c408276a2a