Commit Graph

983 Commits

Author SHA1 Message Date
Ajay Panicker
048adae957 Merge "Limit btsnoop file size (3/8)" 2017-04-26 23:02:45 +00:00
Jakub Pawlowski
ba785bb0ba Merge "Bluetooth: expand comments on new PHY constants" am: bdeb8539e8 am: 3e56fdba72
am: adc97e1c33

Change-Id: Ifcc1efc1cc2b99065e04e96b2aaff13a87b868b3
2017-04-25 20:06:17 +00:00
Jakub Pawlowski
701370c140 Merge "Bluetooth: Add handler parameter to connectGatt" am: 1f4e111808 am: 41eae807ef
am: 36ceeb548e

Change-Id: Icf0d3001d2ec25c7f5aad6c6789fdac1b58078bc
2017-04-25 20:01:57 +00:00
Jakub Pawlowski
343ef5d024 Merge "Bluetooth: document status value in PHY read/update" am: 06abc2c404 am: 3d95c68d2e
am: 6260ea5ab7

Change-Id: I5d45b8a8a33394d7e50479a4a4a920c59e999965
2017-04-25 19:51:38 +00:00
Treehugger Robot
bdeb8539e8 Merge "Bluetooth: expand comments on new PHY constants" 2017-04-25 19:36:37 +00:00
Treehugger Robot
1f4e111808 Merge "Bluetooth: Add handler parameter to connectGatt" 2017-04-25 19:36:22 +00:00
Jakub Pawlowski
60c7dac775 Bluetooth: expand comments on new PHY constants
Bug: 37544152
Test: the all-knowing eyes of the reviewers
Change-Id: I8f5a756a204fe90960700e1dc42f64824d3b844a
2017-04-25 17:46:50 +00:00
Jakub Pawlowski
e55c446977 Bluetooth: document status value in PHY read/update
Bug: 37544152
Test: none
Change-Id: I2bac468f833c73cd282b1dac80b6553917996604
2017-04-25 17:46:40 +00:00
Jakub Pawlowski
4eab49652e Bluetooth: Add handler parameter to connectGatt
Bug: 37544152
Test: sl4a GattReadTest GattWriteTest
Change-Id: I043dfefaafe9f3700418f2c855c52aac3644310f
2017-04-25 17:46:33 +00:00
Amith Yamasani
515239fa6f Merge "Add link to class with constants" into oc-dev
am: 6c0f8dc0b0

Change-Id: I98dab756a117a46b62aa5ea50e7f998d9747017e
2017-04-24 20:36:12 +00:00
Jakub Pawlowski
c4434b341a Merge "Get rid of the IAdvertiserCallabck" am: 7503b11b14 am: 2fb02a252c
am: 526719a1a2

Change-Id: I432069ce857ec9d79c8afae6e8c278a7fd8e97ca
2017-04-24 19:16:52 +00:00
Jeff Sharkey
f25b285706 Merge "More auto-doc work." into oc-dev
am: 6bc03748a7

Change-Id: I71f5f408abfa0d7cdf71711bb1bbab63341989c3
2017-04-24 18:23:35 +00:00
Amith Yamasani
ad8f086912 Add link to class with constants
Addresses api-council feedback

Change-Id: I2dcd526a266a2320b34c714fd91fb4a83d382d9c
Fixes: 37536012
Test: make update-api
2017-04-24 11:01:20 -07:00
Ajay Panicker
00e82f235c Limit btsnoop file size (3/8)
Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Change-Id: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
2017-04-24 10:49:05 -07:00
Jakub Pawlowski
89e10d3eb4 Get rid of the IAdvertiserCallabck
Bug: 30622771
Test: none
Change-Id: I2c55f96e71cd3be67f88201ab07c91730cd85971
2017-04-24 15:42:57 +00:00
Jeff Sharkey
6bc03748a7 Merge "More auto-doc work." into oc-dev 2017-04-22 19:11:34 +00:00
TreeHugger Robot
afe32d2fb1 Merge "Allow the Bluetooth MAC address to be updated asynchronously (2/3)" into oc-dev 2017-04-22 00:17:29 +00:00
Jeff Sharkey
910e081216 More auto-doc work.
Add support for AnyThread, CallSuper, and UiThread.

Another related CL started documenting @RequiresPermission, so remove
duplicated information in existing APIs.

Suppress auto-doc on a handful of classes that are already
well-documented.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I791437dccec0f11d5349a23b982ba098cb551af8
2017-04-21 16:35:08 -06:00
Stanley Tng
dd749b0f61 Allow the Bluetooth MAC address to be updated asynchronously (2/3)
There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.

Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382

Change-Id: I09720193e38fdf9139e1bb146f8e1847e2b65b1a
(cherry picked from commit ad4d1d8e28)
2017-04-21 22:19:57 +00:00
Jakub Pawlowski
c611b7ae90 Merge "Bluetooth: improve getLeMaximumAdvertisingDataLength comment" am: c8d5f84fcf am: e00b92e550
am: b4be7093da

Change-Id: I712347c5e3ceaae00fd179e77d62311ef6bba89d
2017-04-21 20:50:07 +00:00
Jakub Pawlowski
76cceb1189 Bluetooth: improve getLeMaximumAdvertisingDataLength comment
Bug: 37534792
Test: none
Change-Id: Ieff71356aceb0e2a4c6e81d9053f854448e0c927
(cherry picked from commit 4634b5cd27)
2017-04-21 13:41:37 -07:00
Jakub Pawlowski
4634b5cd27 Bluetooth: improve getLeMaximumAdvertisingDataLength comment
Bug: 37534792
Test: none
Change-Id: Ieff71356aceb0e2a4c6e81d9053f854448e0c927
2017-04-21 20:28:39 +00:00
Stanley Tng
4a6356942d Merge "Allow the Bluetooth MAC address to be updated asynchronously (2/3)" am: c5680c9b05 am: 16609dfe18
am: 559f49a4a8

Change-Id: I6fa8f334a84132e121db7c517ea50ff8d8047611
2017-04-21 01:38:54 +00:00
Stanley Tng
ad4d1d8e28 Allow the Bluetooth MAC address to be updated asynchronously (2/3)
There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.

Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382

Change-Id: I09720193e38fdf9139e1bb146f8e1847e2b65b1a
2017-04-20 23:34:20 +00:00
Jakub Pawlowski
83f5d516a1 Merge "Expose LE advertiser address for easier PTS tests (1/6)" am: f2e6988350 am: fc99848b96
am: f3732e2fe2

Change-Id: I73bc945099ab07b5c1f29896be6135e574821602
2017-04-19 21:50:42 +00:00
Jakub Pawlowski
4bc4a44100 Expose LE advertiser address for easier PTS tests (1/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: Iaf0f2fe0613de44b8430ac25e691d66a4ad44f8d
2017-04-19 21:32:57 +00:00
Jakub Pawlowski
cf990de525 Merge "Read by UUID for PTS tests (1/5)" am: 7826c08e21 am: 0c9c0969cc
am: 8359e191ae

Change-Id: I435d7755d39068730089764916de56b23411cc49
2017-04-19 16:20:37 +00:00
Jakub Pawlowski
de74891d1c Read by UUID for PTS tests (1/5)
Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: Ice4076d99e4694d20374ba0fdcae74d5ae841147
2017-04-18 20:47:03 +00:00
Amith Yamasani
461111bc3d BLE scan API using PendingIntent
This allows apps to listen for beacons, etc., without having to
run a foreground service and register a callback. They can instead
register a PendingIntent which will be fired when scan results
are available or when an error occurs.

Bug: 37254611
Test: WIP
Change-Id: I1793eee67ff0211370ed6fc38be4d95a4c5853f5
2017-04-14 16:16:42 -07:00
Jakub Pawlowski
a51513747a Bluetooth 5 PHY simplification
Having PHY_LE_* constants defined in four different places, with one
value being different than others is misleading. Leave just PHY_LE_*
definitions in BluetoothDevice, and add PHY_LE*_MASK for the mask used
in PHY update API.

This patch also removes need to translate PHY value between PHY update
request and event, as mask is used for request, and the value is
returned in event.

Bug: 30622771
Test: manual
Change-Id: I897effa1204a024465d55501c83c542566c4d37c
(cherry picked from commit 9e377194e3)
2017-04-14 07:33:55 +00:00
Jack He
76cd53a953 Add developer setting and system API for inband ringing support
* Add 1 system API to check inband ringing flag in config.xml
	static isInbandRingingSupported(Context)
* Add developer menu options to enable this feature

Bug: 19171297
Test: mm -j 40, HFP regression testing, testplans/82144
Change-Id: Iaf56ea41911f546bbc7ae1f82e399d0f8d48f75f
(cherry picked from commit e86bdcaed1)
2017-04-12 22:24:37 +00:00
Jakub Pawlowski
9e377194e3 Bluetooth 5 PHY simplification
Having PHY_LE_* constants defined in four different places, with one
value being different than others is misleading. Leave just PHY_LE_*
definitions in BluetoothDevice, and add PHY_LE*_MASK for the mask used
in PHY update API.

This patch also removes need to translate PHY value between PHY update
request and event, as mask is used for request, and the value is
returned in event.

Bug: 30622771
Test: manual
Change-Id: I897effa1204a024465d55501c83c542566c4d37c
2017-04-12 10:57:03 -07:00
Jakub Pawlowski
326996916d Remove enable from PeriodicAdvertisingPariameters (1/2)
Instead of setting enable to true, one can just pass null
PeriodicAdvertisingParameters and achieve same result when starting the
set.
Passing the "enable" when updating the parameters make no sense, and
might be confusing.
Experience with "timeout" field, which was a part of AdvertiseSettings
show that merging fields that go into different HCI commands can cause
problems during processing, so keep enable as separate field.

Test: manual
Bug: 30622771
Change-Id: Ida02c59eb8433537179b4d22202fe745f8b4bb3e
(cherry picked from commit e6c453d828)
2017-04-11 09:13:38 -07:00
Jakub Pawlowski
1ab569d43f Bluetooth 5 fix default AdvertisingSetParameters values
Having advertiser be scannable and connectable by default is a bad
choice for new advertising set.

Bug: 30622771
Test: sl4a Bt5ScanTest
Change-Id: I4fc270e78ca4e62d3077c5cd28aa59b0518d2e77
(cherry picked from commit 010cc95583)
2017-04-11 09:13:31 -07:00
Jakub Pawlowski
5203f76933 Bluetooth: fix comment wording
Test: manual
Bug: 30622771
Change-Id: I5a589c98553f35248b0d95d332e9f35774075b24
(cherry picked from commit e7f89b07e6)
2017-04-11 09:13:18 -07:00
Jakub Pawlowski
e6c453d828 Remove enable from PeriodicAdvertisingPariameters (1/2)
Instead of setting enable to true, one can just pass null
PeriodicAdvertisingParameters and achieve same result when starting the
set.
Passing the "enable" when updating the parameters make no sense, and
might be confusing.
Experience with "timeout" field, which was a part of AdvertiseSettings
show that merging fields that go into different HCI commands can cause
problems during processing, so keep enable as separate field.

Test: manual
Bug: 30622771
Change-Id: Ida02c59eb8433537179b4d22202fe745f8b4bb3e
2017-04-11 06:18:44 +00:00
Jack He
e86bdcaed1 Add developer setting and system API for inband ringing support
* Add 1 system API to check inband ringing flag in config.xml
	static isInbandRingingSupported(Context)
* Add developer menu options to enable this feature

Bug: 19171297
Test: mm -j 40, HFP regression testing, testplans/82144
Change-Id: Iaf56ea41911f546bbc7ae1f82e399d0f8d48f75f
2017-04-10 19:49:36 +00:00
Jakub Pawlowski
010cc95583 Bluetooth 5 fix default AdvertisingSetParameters values
Having advertiser be scannable and connectable by default is a bad
choice for new advertising set.

Bug: 30622771
Test: sl4a Bt5ScanTest
Change-Id: I4fc270e78ca4e62d3077c5cd28aa59b0518d2e77
2017-04-06 17:21:28 +00:00
Jakub Pawlowski
260846b31b Bluetooth 5 advertising duration refactoring (4/4)
Expose both duration and maximum extended advertising events to limit
advertising time.

Test: manual
Bug: 30622771
Change-Id: I44df300995ef985526b93f8c24389775720b3432
(cherry picked from commit 5a355610fe)
2017-03-31 22:47:19 -07:00
Jakub Pawlowski
d89e4ba357 Bluetooth LE Advertising minor improvements
This patch adds some additional error checking for the advertising set
parameters, and some more comments.

Test: manual
Bug: 30622771
Change-Id: I87bd44f4179ef63694ad3ed656dc2acc52e40f1e
(cherry picked from commit f4ed33f5fa)
2017-03-31 22:47:18 -07:00
Jakub Pawlowski
66bf1bd18b Fix advertise data size estimation
UUID in service data field can be 2, 4, or 16 bytes long.

Test: manual
Bug: 36553478
Change-Id: Ib5ba2d16065496ca311e8642a15a7ea6bc84d4c1
(cherry picked from commit 72e9e9f815)
2017-03-31 22:47:18 -07:00
Jakub Pawlowski
a537b3f1f8 Hide periodic scanning
Bug: 30622771
Test: manual
Change-Id: I5d786b13cf99287732e16769e2563ac7c4fe715c
(cherry picked from commit 63fad69a19)
2017-03-31 22:47:17 -07:00
Jakub Pawlowski
f752ace75a Bluetooth API spelling fixes ("wether" -> "whether")
Bug: 30622771
Test: manual
Change-Id: I01c8b18d0057f2fd6e477ce2ca0b779321b6c0e6
(cherry picked from commit 08ed924d89)
2017-03-31 22:47:16 -07:00
Jakub Pawlowski
8c5b5b0c4b Merge "Bluetooth 5 advertising duration refactoring (4/4)"
am: 3946df68ed

Change-Id: I04f7f867a1387d1816d007ba4bdebf9eecc66b06
2017-04-01 04:42:45 +00:00
Jakub Pawlowski
821523d859 Merge "Bluetooth LE Advertising minor improvements"
am: 3d84362412

Change-Id: Idc51a6673d8c29a22f9bed177ecb949a49480e3a
2017-04-01 04:40:10 +00:00
Jakub Pawlowski
5a355610fe Bluetooth 5 advertising duration refactoring (4/4)
Expose both duration and maximum extended advertising events to limit
advertising time.

Test: manual
Bug: 30622771
Change-Id: I44df300995ef985526b93f8c24389775720b3432
2017-04-01 04:34:40 +00:00
Jakub Pawlowski
f4ed33f5fa Bluetooth LE Advertising minor improvements
This patch adds some additional error checking for the advertising set
parameters, and some more comments.

Test: manual
Bug: 30622771
Change-Id: I87bd44f4179ef63694ad3ed656dc2acc52e40f1e
2017-04-01 04:33:24 +00:00
Ajay Panicker
7eaf518b71 Merge "Bluetooth: Add additional BluetoothSocket logging to root cause errors"
am: 985fe4cbd2

Change-Id: I81f642bae7fe8f1530db6474ebab26760c707fa3
2017-04-01 03:28:13 +00:00
Treehugger Robot
985fe4cbd2 Merge "Bluetooth: Add additional BluetoothSocket logging to root cause errors" 2017-04-01 03:18:46 +00:00
Jakub Pawlowski
21bd8d5f2e Merge "Fix advertise data size estimation"
am: 5b2e9f40b4

Change-Id: Ic6c0a5d5a988ebeedde333910281af54c026f428
2017-04-01 02:13:41 +00:00