Commit graph

1428 commits

Author SHA1 Message Date
Jakub Pawlowski
442eae00eb Modernize BLE Scanner implementation (1/3)
Get rid of BTA state machine states for BLE scanning.

Test: sl4a FilteringTest
Bug: 30622771
Change-Id: I4319584c6f6c701dc49be6f52887985d2f1e112c
2016-12-19 16:20:44 -08:00
Jakub Pawlowski
9790298053 Expose Bluetooth 5.0 properties to JNI
Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I44b1d6eedb421728076671b4d9be3ebb9d466b71
2016-12-19 14:25:40 -08:00
Jakub Pawlowski
b4a82ba556 BLE scan filter setup simplification (1/3)
Bug: 30622771
Test: sl4a BleScanTest
Change-Id: I41f53e2275c0d5da5244c72faefc7b330bd1a8f9
2016-12-19 11:53:00 -08:00
Jakub Pawlowski
d5286ae2ed Refactor LE scanning HAL (1/3)
This patch converts btgatt_scanner_interface_t struct into
BleScannerInterface class. It also refactors three most important
methods from this interface: RegisterAdvertiser, Scan, and Unregister.
Rest of this interface will be updated in following patches.

Bug: 30622771
Test: sl4a BleScanApiTest
Change-Id: I0b7dddc1e9906d825096e23a83a39ecc681d232c
2016-12-16 14:29:07 -08:00
Pavlin Radoslavov
44d57d4c18 Replace usage of "vector<>" with "std::vector<>"
This change is needed so we can remove the last instances
of "using std::vector" statements in hardware/libhardware.

Test: code compilation
Change-Id: Id728867f6b2e154a01ef56bda93d48def71b0e47
2016-12-09 17:55:30 -08:00
Marie Janssen
6c990300bb Merge "bluetooth: Remove duplicate function definitions"
am: db38221b9b

Change-Id: I3e0c507de5f60fc279e171d19e1776562e4b3d9b
2016-12-06 01:16:52 +00:00
Marie Janssen
694efc0efb bluetooth: Remove duplicate function definitions
Test: m -j37
Change-Id: Ib0f596df1f9ccf07531bdb9c2c313936a03166bb
2016-12-05 14:59:45 -08:00
Ruchi Kandoi
8b5e7a4360 Merge "nfc: Add nfc-base.h"
am: 45182ed0e8

Change-Id: I2697a8ba298c77b12d3a398fcfff7c633f7959ab
2016-11-30 20:51:17 +00:00
Ruchi Kandoi
a2e7517215 nfc: Add nfc-base.h
Test: Compiles
Bug: 32748647
Change-Id: I53d1d4b73091920ef1dc32f32ca31b87db5e38c2
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-11-30 18:19:03 +00:00
Sanket Agarwal
5a77f325ec Merge "Add Bluetooth device address parameter to HF Client APIs"
am: a76ae0e511

Change-Id: I199b9cdcd827d09c9c47bd87004d39966e13800f
2016-11-30 01:28:43 +00:00
Sanket Agarwal
2659e44f75 Add Bluetooth device address parameter to HF Client APIs
Bug: 30984220
Test: SL4A tests for HFP

Change-Id: I55e54d138355fbd8e08781067307f73a25cd49df
2016-11-29 12:17:30 -08:00
Jakub Pawlowski
1cd5f8e990 Move startAdvertising() logic into native code (1/3)
am: a90ebeafc1

Change-Id: I5cf2363eed2ed1b561dc676f10fbd4d5794106a5
2016-11-18 22:35:54 +00:00
Jakub Pawlowski
a90ebeafc1 Move startAdvertising() logic into native code (1/3)
AdvertiseManager.startAdvertising() was implemented in Java layer for
historical reasons. Now that we have nice native callbacks and tests,
it can be moved into native code, where it will be shared between
Android daemon and bluetoothtbd.

Bug: 30622771
Test: native tests added to cover startAdvertising
Change-Id: I492d857cae7e4f82273fa92213c8e9904302f01a
2016-11-18 11:54:48 -08:00
Jakub Pawlowski
1ea50bd0ea Merge "Unify advertising API (2/3)"
am: 9fe1a712fb

Change-Id: Ice673d86314e72da1d993cd9651fef1f4ef8967e
2016-11-11 23:48:54 +00:00
Jakub Pawlowski
9fe1a712fb Merge "Unify advertising API (2/3)" 2016-11-11 23:33:15 +00:00
Aleksej Makarov
335f934536 Merge "Make HW_AUTH_TOKEN_VERSION static"
am: 99adae1cf6

Change-Id: Ia51e0e24e13f5a8fe60f5b934d00a3b74eaa7c4a
2016-11-11 19:37:13 +00:00
Treehugger Robot
99adae1cf6 Merge "Make HW_AUTH_TOKEN_VERSION static" 2016-11-11 19:26:41 +00:00
Jakub Pawlowski
2b64b02443 Merge "BLE OOB Pairing - parse address type (2/5)"
am: 2258384020

Change-Id: I3ad5aef4e326e30c36fcae3e38674af4debbf585
2016-11-10 20:07:43 +00:00
Aleksej Makarov
cf1e7408fd Make HW_AUTH_TOKEN_VERSION static
Having this object non-static in header file is ok in
"c-plus-plus" since constant values default to internal
linkage, which allows them to appear in header files.

This is not i case in "c" and we need to declare it also
as static to limit the contex.

Making it static works for both.

Bug: 32467815
Test: lunch 1; make
Change-Id: I4ed4ffe41add3b10d990db0fb156a85a146d0ba2
Signed-off-by: Aleksej Makarov <aleksej.makarov@sonymobile.com>
2016-11-10 14:43:20 +01:00
Jakub Pawlowski
d82fbad4aa BLE OOB Pairing - parse address type (2/5)
When address type is not parsed, creating bond to devices not using
random address is impossible.

Bug: 32780409
Test: try pairing with nRF52DK using random address
Change-Id: I1265b6abdefa12dc024d00ecf232f7fc7722d178
2016-11-10 01:06:48 +00:00
Jakub Pawlowski
555b8aeef9 Unify advertising API (2/3)
This patch unifies advertising API. On startup, if VSC multi advertising
is avaliable, it will be used, otherwise
BleAdvertiserLegacyHciInterfaceImpl will be used, which provides one
advertising instance.

Test: sl4a tests are passing, all proper tests updated accordingly
Change-Id: I02d3996f694beb6614d342d6c15a8c27b7b7274a
2016-11-08 11:51:17 -08:00
Jakub Pawlowski
204b309411 Merge "Move start advertise method to advertising interface (2/3)"
am: 8ba3a3007e

Change-Id: I03805002789374a884116d0c47287c6dc5ec3fca
2016-11-01 22:34:27 +00:00
Jakub Pawlowski
8ba3a3007e Merge "Move start advertise method to advertising interface (2/3)" 2016-11-01 22:30:43 +00:00
Sanket Agarwal
8c840392dd Merge "Add API for AVRCP CT get_play_status_cmd"
am: 0d2ae67cc9

Change-Id: Ib30f724f4dfbdbf48a3774e294cafb61625384cd
2016-11-01 20:03:18 +00:00
Sanket Agarwal
9d0d6700b1 Add API for AVRCP CT get_play_status_cmd
Bug: b/31684931
Change-Id: I5e47e3b1ab30f457ee2581d02a384ffb76454a21
(cherry picked from commit de0f636db2035deff127fdd5f62ed2043650b270)
2016-11-01 19:59:36 +00:00
Sanket Agarwal
f787d1e7e3 Merge "Implement set addressed player."
am: 7798d9ddfc

Change-Id: I580191f4ddb9743103f5b25d519f7ab43f3b655e
2016-11-01 17:28:21 +00:00
Sanket Agarwal
8f8171ac23 Implement set addressed player.
Bug: b/31554234
Change-Id: I32b5d33605b06c70fea1c20942af82a1f9561b46
(cherry picked from commit f01b2391410485aa4cb82bc2d91085d10350c84d)
2016-11-01 15:55:32 +00:00
Sanket Agarwal
04badf7fb6 Merge "[AVRCP1.6 CT] Add reply status to get_folder_items_callback."
am: 5096f9c288

Change-Id: Iff066328ccc4fa763d65777d27c9f01e1ecceb96
2016-11-01 00:46:23 +00:00
Sanket Agarwal
f65a26b962 [AVRCP1.6 CT] Add reply status to get_folder_items_callback.
It is useful to know what error code the get_folder_items_cmd gets back
with since it can help the UI decide if to keep fetching more. For ex.
if the return code is out of range then the UI does not need to keep
fetching anymore. This is useful for folders where we do not know the
size before hand (Media Player List or Now Playing List).

Bug: b/31253501

Change-Id: Ia6544de4845b8b72feaa359ef1481290dc54348a
(cherry picked from commit fdc7153966f9aecdbfd962b8a7655b5db3e464e0)
2016-10-31 16:17:48 -07:00
Jakub Pawlowski
f82a249795 Move start advertise method to advertising interface (2/3)
Advertising related code should be exposed through
BleAdvertiserInterface. Move client.listen function into this interface.
Remove reduntant clientif parameter.

Bug: 30622771
Bug: 24099160
Test: no tests necessary
Change-Id: Ic4335f2c65c1e21f20d3ae08222fba4341b63e27
2016-10-31 11:14:46 -07:00
Jakub Pawlowski
d3ea3edc18 Merge "Separate LE scanner and GATT client BTIF interfaces (2/3)"
am: 86f508d45d

Change-Id: I7a6b7b8b1241c9bb35a1eb91acf5e5f38ed3d34f
2016-10-28 20:49:45 +00:00
Jakub Pawlowski
1e24ce9167 Separate LE scanner and GATT client BTIF interfaces (2/3)
In order to properly separate low level structures associated with LE
scanner and GATT client, their interfaces must be separated first.

Test: sl4a BleScanApiTest
Bug: 30622771
Change-Id: Idf8c5b7285b68e59f18f5216380488bfe8404b22
2016-10-28 12:07:45 -07:00
Jakub Pawlowski
7fd804c526 Merge "Separate LE scanner from GATT client (3/4)"
am: 1f4fc31367

Change-Id: Ifcafcd480cbf5111dfa1575ca8127951bfd395df
2016-10-28 02:50:58 +00:00
Jakub Pawlowski
8cb1baefa1 Separate LE scanner from GATT client (3/4)
Right now, LE scanning functionality is combined with the GATT client.
This is the source of various bugs, like scans suddenly stoppinging when
a GATT client is killed. It also increases memory consumption, because
we associate many structures with a GATT client, which are not necessary
when just scanning.

Test: sl4a BleScanApiTest ConcurrentBleScanTest
Bug: 30622771
Change-Id: I5c2608b769bd6aec54900357cdccfa22987962c9
2016-10-27 23:10:20 +00:00
Jakub Pawlowski
7da5970d15 Merge "Change how Advertise Data is passed to BTIF (1/3)"
am: 81f7d7e8bf

Change-Id: I29f4d0b65f3fd008d995e45e98ac6f31a98e85b8
2016-10-26 00:15:11 +00:00
Jakub Pawlowski
6b76de1ef0 Change how Advertise Data is passed to BTIF (1/3)
The way that AD data is passed right now put some additional
limitations, i.e. only one manufacturer specific data can be set, or
only one service UUID. By moving AD generation to upper layers, another
set of limitations is removed.

Test: Covered by BleAdvertiseApiTest sl4a test
Bug: 30622771
Change-Id: I34e8d731141caaf4497565f6e929992f6e929913
2016-10-19 14:57:05 -07:00
Jakub Pawlowski
3ed4100144 Merge "Get rid of dependency on core from linux build (2/2)"
am: 77a4c05a7e

Change-Id: Ib422f87fd63925236b650eaa9d6e2968ab932658
2016-10-19 19:18:14 +00:00
Jakub Pawlowski
7b4adb1dbc Get rid of dependency on core from linux build (2/2)
When building bluetooth stack for linux, don't include
dependencies from core.
2016-10-18 20:33:24 -07:00
Sanket Agarwal
4bc507a1e0 Merge "AVRCP 1.6: media browsing support on Controller"
am: 6b6400720a

Change-Id: Ib38e93f007cadf8527e429dec771220aa7c73127
2016-10-17 21:30:35 +00:00
Sanket Agarwal
f93277695b AVRCP 1.6: media browsing support on Controller
Bug: 28791287
Change-Id: I52519e91c9f8f6d8db05ebc8a79e118582701150
(cherry picked from commit dd4825b6ab)
2016-10-17 12:35:18 -07:00
Jakub Pawlowski
8cf15fee33 Convert advertising HAL from struct into class (1/3) am: 4a635288b8 am: b5496ca506
am: 6e00d6c9f5

Change-Id: I01ddd09e30a7f58a906af3c27252e72ebce16784
2016-10-11 17:45:44 +00:00
Jakub Pawlowski
4a635288b8 Convert advertising HAL from struct into class (1/3)
Bug: 30622771
Test: all related tests were updated
Change-Id: I61381cc57a9c8cd725478ad4e52abce9f857a373
2016-10-08 16:42:37 -07:00
Colin Cross
69735185b6 Merge "Make gralloc enums unsigned" am: e1582496f9 am: e4f267c1a1
am: 5f1f8915f9

Change-Id: I55e70cb51adb4613d9ce61d6c32365b6cddfb6e0
2016-10-08 22:50:38 +00:00
Colin Cross
92bba13dd1 Make gralloc enums unsigned
hardware/libhardware/include was being included with -isystem, which
hides warnings.  The gralloc enum values are used as bitmasks on
unsigned types, explicitly mark them values as unsigned in order to
force the type of the resulting enum to be unsigned.

Bug: 32018017
Test: m -j
Change-Id: Iea281480574e0a7a8413273983c76c2c0f9f7049
2016-10-08 11:40:17 -07:00
Colin Cross
2b932a434e Avoid C-style cast warnings am: cc8d9f9fcb am: ac416b9ed3
am: 9a786a3044

Change-Id: I35021c183bb6772c47a0e6ba9d94215dd0728d33
2016-10-08 00:49:03 +00:00
Colin Cross
74ca55073d Add name for typedef am: 64cd91274f am: 6ce096549f
am: 6f437dc0be

Change-Id: I84c46c06bd205d9cbddc5b7e565c664c5ea66e64
2016-10-08 00:49:01 +00:00
Colin Cross
848c07bfcc Fix enum switch warnings am: 248ec3da8b am: 1c74c66219
am: 3a69a4a432

Change-Id: I766feb96c1aa2576801723552509b07338ce8937
2016-10-08 00:48:59 +00:00
Colin Cross
14c19f32da Fix doc warnings am: 867e1e3043 am: 18bf56aeb7
am: 876f1ffb95

Change-Id: I33ace130d5c9751045f1cd3b15fedda69fc17950
2016-10-08 00:48:57 +00:00
Colin Cross
cc8d9f9fcb Avoid C-style cast warnings
hardware/libhardware/include was being included with -isystem, which
hides warnings.  Use a macro to convert modules to hw_device_t** to call
the open function that works in C++ and C.

Bug: 32018017
Test: m -j
Change-Id: If68bf15581975f1217fcab366cef7bc784894641
2016-10-07 13:10:20 -07:00
Colin Cross
64cd91274f Add name for typedef
hardware/libhardware/include was being included with -isystem, which
hides warnings.  Add the missing name for a typedef.

Bug: 32018017
Test: m -j
Change-Id: I35f950ba3e26836cb51312ef28e98748f29d8cd8
2016-10-07 13:10:07 -07:00