Commit Graph

1004 Commits

Author SHA1 Message Date
Antony Sargent
dc62fbe81b Merge "Add persistent state for Bluetooth high quality audio support" into oc-dev
am: d53a71f443

Change-Id: I735640f2c9c7a00ab206372ffa33f51621546e78
2017-05-04 01:43:00 +00:00
TreeHugger Robot
d53a71f443 Merge "Add persistent state for Bluetooth high quality audio support" into oc-dev 2017-05-04 01:37:07 +00:00
Antony Sargent
f5772c6121 Add persistent state for Bluetooth high quality audio support
Defines the flags used in code and the Settings.Global key names for
persisting the following state for Bluetooth A2DP Sink devices:
-Whether the device supports optional codecs or not
-Whether optional codecs should be turned on for the device

For each of these two properties we model the state in the code as
yes/no/unknown, so that we can tailor the UI and behavior
accordingly.

Bug=37441685
Test: manually

Change-Id: I6bcd02fd7c95bef989575f3b13d4788dab61971a
2017-05-03 04:36:51 +00:00
Ruben Brunk
44e317e278 Merge "Fix Bluetooth GATT API default handler assignment" into oc-dev
am: 24f4743f92

Change-Id: I23f5fdf5b3584861818bc378b85f98fc2e33ebb8
2017-05-03 03:56:01 +00:00
Ruben Brunk
6bdc550e27 Fix Bluetooth GATT API default handler assignment
Restores previous behaviour where GATT callbacks are invoked on the
binder thread and not the calling process main looper thread.

This fixes performance regressions as well as some
NetworkOnMainThreadException's for some applications.

Bug: 37544152
Bug: 37871717
Test: Covered by prior API tests.
Change-Id: Id8ab705dd4d7f00030e6ac29e056dde5180670e9
2017-05-03 00:11:10 +00:00
Ajay Panicker
c29bb4a394 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
(cherry picked from commit 00e82f235c)
2017-04-30 01:58:41 +00:00
Jakub Pawlowski
9cc225e482 Merge "Bluetooth: bluetooth.le API fixes" am: cf95973276 am: 6af9bde898
am: 62fc08f684

Change-Id: I98bf6fc7d8d58f102b1268cb3e6d27fb6fd86b78
2017-04-28 22:02:52 +00:00
Jakub Pawlowski
17100948f9 Bluetooth: bluetooth.le API fixes
Fix minor spelling problems.
Throw IllegalStateException instead of IllegalArgumentException in
build().

Bug: 37532634
Test: none
Change-Id: I73b6f04aec98f5baffb06a363e2a3f71e8cec3c4
(cherry picked from commit 9d4abb5631)
2017-04-28 21:51:53 +00:00
Jakub Pawlowski
9d4abb5631 Bluetooth: bluetooth.le API fixes
Fix minor spelling problems.
Throw IllegalStateException instead of IllegalArgumentException in
build().

Bug: 37532634
Test: none
Change-Id: I73b6f04aec98f5baffb06a363e2a3f71e8cec3c4
2017-04-28 21:35:53 +00:00
Jakub Pawlowski
ebaa44db58 Merge "Bluetooth: Add constants to ScanResult" am: 369a94496c am: b6656f07e7
am: 493ae0da60

Change-Id: Ib7c7f3f71e6e49d06091effb99ac09dae605822e
2017-04-27 22:52:34 +00:00
Jakub Pawlowski
56d8f786a5 Bluetooth: Add constants to ScanResult
Add TX_POWER_NOT_PRESENT and PERIODIC_INTERVAL_NOT_PRESENT

Test: none
Bug: 37536707
Change-Id: Ia48a30f44a961c6e0babd17ecaed0eb93c98ecad
(cherry-picked from commit c7c01a2877)
2017-04-27 22:22:36 +00:00
Jakub Pawlowski
7918ff08dd Merge "Fix NPE when accessing mCallback in BluetoothGatt" am: 1be8fb23eb am: 28f182aa87
am: 3657c398e1

Change-Id: I9425efce8de6376c0e3c74401d74da39e8037b98
2017-04-27 21:24:35 +00:00
Jakub Pawlowski
c7c01a2877 Bluetooth: Add constants to ScanResult
Add TX_POWER_NOT_PRESENT and PERIODIC_INTERVAL_NOT_PRESENT

Test: none
Bug: 37536707
Change-Id: Ia48a30f44a961c6e0babd17ecaed0eb93c98ecad
2017-04-27 21:03:46 +00:00
Jakub Pawlowski
0e0e75793d Fix NPE when accessing mCallback in BluetoothGatt
This issue was introduced in commit
4eab49652e.

Bug: 37710354
Test: none
Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb
(cherry picked from commit 0e4ac75f2e)
2017-04-27 13:16:32 -07:00
Jakub Pawlowski
348ba3da78 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
(cherry picked from commit 4bc4a44100)
2017-04-27 13:15:58 -07:00
Jakub Pawlowski
ce21cb903c 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
(cherry picked from commit de74891d1c)
2017-04-27 13:15:43 -07:00
Jakub Pawlowski
0e4ac75f2e Fix NPE when accessing mCallback in BluetoothGatt
This issue was introduced in commit
4eab49652e.

Bug: 37710354
Test: none
Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb
2017-04-27 19:37:35 +00:00
Ajay Panicker
37cad12cb1 Merge "Limit btsnoop file size (3/8)" 2017-04-27 17:29:37 +00:00
Ajay Panicker
731a26666d 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
Merged-In: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
Change-Id: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
2017-04-27 00:05:31 +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
91fe3080e7 Bluetooth: expand comments on new PHY constants
Bug: 37544152
Test: the all-knowing eyes of the reviewers
Change-Id: I8f5a756a204fe90960700e1dc42f64824d3b844a
(cherry picked from commit 60c7dac775)
2017-04-25 13:00:52 -07:00
Jakub Pawlowski
e7c6e6ae1f Bluetooth: document status value in PHY read/update
Bug: 37544152
Test: none
Change-Id: I2bac468f833c73cd282b1dac80b6553917996604
(cherry picked from commit e55c446977)
2017-04-25 13:00:43 -07:00
Jakub Pawlowski
b0f647492f Bluetooth: Add handler parameter to connectGatt
Bug: 37544152
Test: sl4a GattReadTest GattWriteTest
Change-Id: I043dfefaafe9f3700418f2c855c52aac3644310f
(cherry picked from commit 4eab49652e)
2017-04-25 13:00:36 -07:00
Jakub Pawlowski
d2ac8b94e7 Get rid of the IAdvertiserCallabck
Bug: 30622771
Test: none
Change-Id: I2c55f96e71cd3be67f88201ab07c91730cd85971
(cherry picked from commit 89e10d3eb4)
2017-04-25 13:00:25 -07: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
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