History log of /system/bt/btif/src/btif_ble_advertiser.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6884c4c68b1c43bb2febeb6b506362614808f726 22-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Fix crashes on stack shutdown

During stack shutdown, Unregister would sometimes get called after the
stack is already cleaned up, and the AdvertiseManager::Get would crash
on null check assertion. Ensure that stack is initialized before
Unregister call.

Bug: 37888261
Test: none
Change-Id: I7a4bbcd24ec7d24d21d04fe842985baaac899321
/system/bt/btif/src/btif_ble_advertiser.cc
779b4fd786c571cb8013f4d94ddacfe7116fb05f 19-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Expose LE advertiser address for easier PTS tests (4/6)

This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: I5ad554d872f2b772f2bf91642a9648c4018d935c
/system/bt/btif/src/btif_ble_advertiser.cc
5204c62f137de9b6c2834391fd329457d3fdbc84 31-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 advertising duration refactoring (1/4)

Expose both duration and maximum extended advertising events to limit
advertising time.

Test: manual
Bug: 30622771
Change-Id: I4475c322347899946b39e65026d8009e02c93759
/system/bt/btif/src/btif_ble_advertiser.cc
ff32af6dee78aea6889c9b381ff9278eccafcde3 18-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 AdvertisingSet implementation (4/4)

Test: manual
Bug: 30622771
Change-Id: Ie1c1588383a83296cabd29a0481f7d80a1168263
/system/bt/btif/src/btif_ble_advertiser.cc
256afc4d84cc0b05b96881ade6bcbfbab8636c51 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Report back TX Power value

For LE Extended Advertising report the value returned by controller.
For VSC Advertising return the value send to controller.
For Legacy Advertising use 0.

Test: manual
Bug: 30622771
Change-Id: Ifc49af86e7f064c91ed2d20e6f87532159d1bffa
/system/bt/btif/src/btif_ble_advertiser.cc
16da9217c6e44e7b9bbe3a6c60c1e293d52c7223 12-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 AdvertisingSet implementation (3/4)

This patch wires up fist methods of AdvertisingSet, making it possible
to start advertising and stop advertising. It also replaces legacy
implemementation with calls to new implementation.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I843d8fc12ba1928c87e256a0fb6d730c9fa200e6
/system/bt/btif/src/btif_ble_advertiser.cc
96ad0d2596ce468fa8ef6fa74c822124c845e7b2 17-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Remove unnecessary extern declarations

Test: manual
Change-Id: I21bdb5952fff359a9ee7091d740ecac13aad640a
/system/bt/btif/src/btif_ble_advertiser.cc
0482c8a3f4253b5b86180b44de6cd9dbaecd5e99 17-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Thread switching simplification

* add jni_thread_wrapper
* add FROM_HERE parameter to do_in_jni_thread, this will be used in
later patches to make thread switching logs nice.

Bug: 30622771
Test: manual
Change-Id: I4c8f9e0f32c501a6126fe04f2476ab6453fe637e
/system/bt/btif/src/btif_ble_advertiser.cc
657baed5df56ce4c46fc58e33661416316d19e48 20-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Fix advertising timeout behaviour.

When advertising is enabled with timeout, enable callback was not
called. Also we were not scheduling the disable operation after the
timeout passes. This patch fixes that. It also make sure that the
timeout callback is called on proper thread.

Bug: 34440704
Test: sl4a ConcurrentBleAdvertising:test_timeout
Change-Id: I233c2692c690f55ef6243325640e48b37818c9d5
/system/bt/btif/src/btif_ble_advertiser.cc
e0750ca056c8561d4a5b7ea14430049bf1d82fc1 05-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Expose Bluetooth 5.0 properties to JNI

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I6185e6926e7363824aa573c7d65f7ab66f954e52
/system/bt/btif/src/btif_ble_advertiser.cc
911d1ae03efec2d54c3b1b605589d790d1745488 29-Nov-2016 Myles Watson <mylesgw@google.com> Apply clang-format to the rest of the tree

find * | grep "\.[ch]" | xargs clang-format --style=file -i

Test: mma -j32
Change-Id: I6fcc9862bb7bc07c2a367ca58fef2b3cd27a6f05
/system/bt/btif/src/btif_ble_advertiser.cc
9008888d24407541aa383aa4bd363a40abbf954b 16-Nov-2016 Myles Watson <mylesgw@google.com> Fix formatting after removing defines

clang-format -i --style=file bta/*/* btif/*/* include/*

Test: mma -j32
Change-Id: I9ebb32f0cc5bd24a7cb2ae25699999aab5036b13
/system/bt/btif/src/btif_ble_advertiser.cc
a75087effcc8b4a5869fb1673d43b0b9ff6fb8f1 17-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (2/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: Idf5d3c53b6ad21d8c7e239b5b150b88e073bb709
/system/bt/btif/src/btif_ble_advertiser.cc
d964cf944e23470d696177fb2ddf8df3684290b8 03-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Unify advertising API (1/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: I73753962e3a33a980e8a9a1174c8d88611a47e6b
/system/bt/btif/src/btif_ble_advertiser.cc
3a2747fce1bf71c3396fe50799023eefd4c09849 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Remove unused BLE_PERIPHERAL_MODE_SUPPORT

This patch removes BLE_PERIPHERAL_MODE_SUPPORT and all code related to
it, which is unused.

Bug: 30622771
Bug: 24099160
Change-Id: Ic9cc2a94c8d1b974814d453ee8a0073e7d6deb85
/system/bt/btif/src/btif_ble_advertiser.cc
a8d73ef2f3d2c9b344162cb15e9dd054c28761de 31-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Move start advertise method to advertising interface (3/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: Icc865c062e3d7c4b83bbeea6ff5b08bd2c1c4d9a
/system/bt/btif/src/btif_ble_advertiser.cc
0ecddf398c92324e15a53c9d410646fd7a494b96 19-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Change how Advertise Data is passed to BTIF (2/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, aother
set of limitations is removed.

Test: Covered by BleAdvertiseApiTest sl4a test
Bug: 30622771
Change-Id: Iee48ea30ec4c055eaa1ad0b1678686d261106e76
/system/bt/btif/src/btif_ble_advertiser.cc
74ef54b440dc50bb25f587783d80fe5a37070e4a 07-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Convert advertising HAL from struct into class (3/3)

Bug: 30622771
Test: all related tests were updated
Change-Id: I9695284ae249fa427ae4b2f3e9649da951102c6c
/system/bt/btif/src/btif_ble_advertiser.cc
9eaf7768670389e0850e924e295a0c5738027e31 05-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Refactor advertising data types

Currently we have some unnecessary complicated code for handling
advertising data. Get rid of it.

Bug: 30622771
Test: Tests making sure flags and tx power are filled are added
Change-Id: I807cdf11577c357c116c54cab50bbf3261e1ee16
/system/bt/btif/src/btif_ble_advertiser.cc
e47b769e71fa88f207db747e62974662e43aa07c 28-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Make Bluetooth LE multi-advertising testable

This patch turns the code that manages LE multi-advertising into the
BleAdvertisingManager class. All HCI calls made by this code were
abstracted into BleAdvertiserHciInterface.

Thanks to those changes, we can mock BleAdvertiserHciInterface and test
the advertising manager.

The BleAdvertisingManagerTest, still has some dependencies on other
code from the "stack" module. These have to be implemented on top of the
test file. In the future, this dependencies should be replaced by mockable
classes.

Test: Tests covering the change are added in this patch.
Bug: 30622771
Change-Id: I4a363678815c235ee01255f462db2a671ef89610
/system/bt/btif/src/btif_ble_advertiser.cc
014872655da0dd3a84d6d4ad680e4dbda6327627 05-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Convert BLE multi-advertising code to C++

This patch converts btm_ble_multi_adv.c file to .cc. It also separate
header definitions from rest of BTM layer. It is another step towards
making BLE advertising-related code testable.

Bug: 30622771
Change-Id: I89965e10fbf773e48176ee19ef613dd0df2fb951
/system/bt/btif/src/btif_ble_advertiser.cc
73679d01c70fe84921fc4718e99d4b02af8cc5a9 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Bluetooth: split setting params and enabling advertising (3/3)

Proper order of commands when starting advertising:
* set parameters
* set data
* enable advertising

This cannot be achieved when setting advertising parameters and enabling
advertising is put together in one function. Enabling before setting
data might cause first advertisements to be empty. If a device with
hardware filter pick up such advertisement, it might fail to properly
recognize our device.

Bug: 30622771
Bug: 19372779
Change-Id: I3a2c1171e301ecfd7cbf1cb8b86cfda0e5fc2382
/system/bt/btif/src/btif_ble_advertiser.cc
00a53d14c8ec66334ff4b27586315a7a81d5475c 16-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Remove BTA layer components for LE advertising

Advertising is so simple, it doesn't need the BTA layer.
Values returned by BTM_VendorSpecificCommand shouldn't be handled as
success or failure, it's just to inform wether we sent the callback.

Bug: 30622771
Change-Id: I104c4fbf84d3818b76fe8c527fbde4e6c4336c3a
/system/bt/btif/src/btif_ble_advertiser.cc
6a9666116668683fb473239ff381dec16b784421 16-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Unify LE advertising instance identifiers

Up till now, we had three numbers associated with each advertising
instance: client_id, inst_id, and cbindex. We also had special structure
mapping each of those numbers to another.

From now on, when registering advertiser, we'll grab next free
advertising instance id and make advertiser_id equal to it. Thanks to
this, we can remove all the mapping and have just one number associated
with each advertising instance.

This also means we no longer need to pass *p_ref value to the BTM layer
with each request, as advertiser_id is equal to inst_id.

Bug: 30622771
Change-Id: Ied71bff36e30d6c6ce4ca3e62d46ba96320cf597
/system/bt/btif/src/btif_ble_advertiser.cc
67d5a2523314d9757b2472c3e828dbc1015df4fe 13-Jul-2016 Jakub Pawlowski <jpawlowski@google.com> Separate advertiser from GATT client (4/4)

Bug: 30622771
Change-Id: I761f0bff09aec1047bd512915960021e4fbdc0c8
/system/bt/btif/src/btif_ble_advertiser.cc