Commit Graph

813 Commits

Author SHA1 Message Date
Marie Janssen
5c7ef9ccc7 resolve merge conflicts of 7a2518e to nyc-mr1-dev-plus-aosp am: f2fc15824d
am: 2f94877c01

Change-Id: I00f1e604816bd95b4ecc3063209e38780a4e8675
2016-12-15 00:27:08 +00:00
Marie Janssen
f2fc15824d resolve merge conflicts of 7a2518e to nyc-mr1-dev-plus-aosp
Change-Id: I903680717ed121a93fee3b7c2ed358cb29726d71
2016-12-14 13:44:28 -08:00
Marie Janssen
7a2518ee6e Merge "Bluetooth: log message improvements"
am: f34bdf7676

Change-Id: Ic89c59257559d95119829fa4157dbb763124e86f
2016-12-14 20:01:39 +00:00
Marie Janssen
cb21ad71ed Bluetooth: log message improvements
Some log improvements:
 - Reduce logspam
 - Use names for states in logs instead of numbers
 - Be more consistent with messages

Also remove some commented out dead code.

Test: run on phone, observe more useful logs
Change-Id: I32163278e148be144c03d4e8aaf0eb761226c94c
2016-12-14 09:51:30 -08:00
Ivan Podogov
903d6414e5 resolve merge conflicts of b1e2da7 to nyc-mr1-dev-plus-aosp
Test: build police
Change-Id: Ifec1ab6760ebb94b0b411c9c60f07066e151206b
2016-12-13 17:55:14 +00:00
Svetoslav Ganov
c2ac5bde6f DO NOT MERGE Add Bluetooth toggle prompts - framework
If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749
Change-Id: I77bca2305f9d0f20034b2c8fc5b58e0565d5e617
2016-12-12 09:50:24 -08:00
Svetoslav Ganov
b1e2da7c24 Add Bluetooth toggle prompts - framework
If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
2016-12-02 11:52:18 +00:00
Jakub Pawlowski
e3fb0afa96 Merge "Bluetooth: report proper advertiser status on error" am: b509957e62 am: 673c0e5596 am: e8ceb15b51
am: 0debe3c5b7

Change-Id: Iff59148dd5862bf0dcc51112b27ced7e9f76bef6
2016-11-23 02:15:40 +00:00
Jakub Pawlowski
e8ceb15b51 Merge "Bluetooth: report proper advertiser status on error" am: b509957e62
am: 673c0e5596

Change-Id: Ic91b1c614e9cc71e7d57bd39ac31ec1127f08f65
2016-11-23 02:03:13 +00:00
Jakub Pawlowski
673c0e5596 Merge "Bluetooth: report proper advertiser status on error"
am: b509957e62

Change-Id: I1bb0a029a9044c3931e158c7ef02ffee4cb0f1cd
2016-11-23 01:58:03 +00:00
Jakub Pawlowski
76f517a173 Bluetooth: report proper advertiser status on error
When advertiser is not started because too many advertisers are
registered, return proper error code.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I57384ff30132e9a7ee17dcf191ff89baa7abf1ef
2016-11-22 13:38:15 -08:00
Jakub Pawlowski
4bdd6d454d Merge "Bluetooth: advertising improvements" am: 82c9ba9c55 am: e3b71cd572 am: d81df46e80
am: c90cb005fe

Change-Id: I32443204849794f92917a2a2e1098951d5015851
2016-11-12 00:36:22 +00:00
Jakub Pawlowski
d81df46e80 Merge "Bluetooth: advertising improvements" am: 82c9ba9c55
am: e3b71cd572

Change-Id: I54df9c355ac951d40b2d8e865d5f36f8875ce71f
2016-11-11 23:58:44 +00:00
Jakub Pawlowski
e3b71cd572 Merge "Bluetooth: advertising improvements"
am: 82c9ba9c55

Change-Id: I662ba0f326aa204f9f07ce88bc9d48f5b06770cb
2016-11-11 23:48:51 +00:00
Jakub Pawlowski
3d83b0e90b Bluetooth: advertising improvements
This patch removes isPeripheralModeSupported(), hidden public method
which is always returning true. It also modify the BluetoothLeAdvertiser
to be able to use advertising instance with instance id equal 0.

Bug: 30622771
Bug: 24099160
Change-Id: Id31582621dbe56d5c3a8d4ee5cd296af66a5f026
2016-11-11 23:28:32 +00:00
Jakub Pawlowski
1cc78aa2c3 Merge "BLE OOB Pairing - parse address type (5/5)" am: 97d9fe0a2f am: c3cfff6ef6 am: f59ad8bd68
am: 196fe3597c

Change-Id: Idf087fc9dcd88733ec7755196fab3eac944bf8cf
2016-11-10 20:31:12 +00:00
Jakub Pawlowski
f59ad8bd68 Merge "BLE OOB Pairing - parse address type (5/5)" am: 97d9fe0a2f
am: c3cfff6ef6

Change-Id: Ia05bccadc06b202cf6ac1039b1e227bd67575bb5
2016-11-10 20:14:24 +00:00
Jakub Pawlowski
c3cfff6ef6 Merge "BLE OOB Pairing - parse address type (5/5)"
am: 97d9fe0a2f

Change-Id: I935cc35d9f7f1eea5459f0091ad14dc8b200bc02
2016-11-10 20:07:39 +00:00
Jakub Pawlowski
f465823f6d BLE OOB Pairing - parse address type (5/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: Ie6cc1f8c008d43b2acd021b47f9bbfb1f63472e8
2016-11-10 19:51:49 +00:00
Jeff Sharkey
0a17db1cc5 Detect non-oneway calls leaving system_server.
To protect system stability, any Binder calls leaving the
system_server must carefully be performed using FLAG_ONEWAY (or
the 'oneway' verb in AIDL) which prevents the call from blocking
indefinitely on the remote process.

In this CL, the system_server uses the new Binder.setWarnOnBlocking()
method to enable detection by default for all remote Binder
interfaces.  It can also use Binder.allowBlocking() to allow
blocking calls on certain remote interfaces that have been
determined to be safe.

This CL adds the 'oneway' verb to several interfaces and methods
where it should have been added, and marks a handful of system
ContentProviders as being safe to call into.  Also, we assume that
any services obtained from ServiceManager are part of the core
OS, and are okay to make blocking calls to.

Test: builds, boots, runs with minimal logs triggered
Bug: 32715088
Change-Id: Ide476e120cb40436a94b7faf7615c943d691f4c0
2016-11-07 17:03:37 -07:00
Joseph Pirozzo
22eedd9073 MAP MCE am: b8fc0679e8 am: b13240028b am: 5602b26f41
am: 132dab26e5

Change-Id: Icb6d7db9d0e1866b2c1847be2b1da0008bd8185d
2016-11-02 01:26:01 +00:00
Joseph Pirozzo
fe9368afe8 MAP MCE am: 631768d814 am: d94c280a7f am: c412914520
am: fb70d77f64

Change-Id: Ia56f6ca01a4d92b24f192102917950a10b6cb05d
2016-11-02 01:24:14 +00:00
Joseph Pirozzo
5602b26f41 MAP MCE am: b8fc0679e8
am: b13240028b

Change-Id: I62a9a758bc46fbb1174fbce4d50f488932d65113
2016-11-02 01:11:04 +00:00
Joseph Pirozzo
c412914520 MAP MCE am: 631768d814
am: d94c280a7f

Change-Id: I6a765b9a07204afca2763fb98fdb2e92e08292e5
2016-11-02 01:09:14 +00:00
Joseph Pirozzo
b13240028b MAP MCE
am: b8fc0679e8

Change-Id: Id82f047bc2d0eb7e4f04c14cfc216854e066156f
2016-11-02 01:05:14 +00:00
Joseph Pirozzo
d94c280a7f MAP MCE
am: 631768d814

Change-Id: I155fd0e8b44539bf79cec2c6ddb2a4d71b0c23d9
2016-11-02 01:03:51 +00:00
Joseph Pirozzo
b8fc0679e8 MAP MCE
Fix @LINK to @link in javadoc.

Bug: 30467210
Change-Id: Icac176947bee971c3f5d11fd4166cf8ceb0a437e
(cherry picked from commit f5fba751d360bbe8294c4640f5ad12a990f13122)
2016-11-01 17:39:16 -07:00
Joseph Pirozzo
631768d814 MAP MCE
Add MAP client code into packages/apps/Bluetooth.  Changes here are to
define the MAP MCE interface and enable its selection when running on a
device that is also running a PBAP client (Car Kitt).

Bug: 30467210
Change-Id: Ifa2cdea7d67f63a2b5f3d971df8ec6d321dc5fee
(cherry picked from commit 433b3054847951e8e7b3864d11990604a66b8651)
2016-11-01 17:39:16 -07:00
Bryce Lee
6f84631d8d Merge "Add a way to query for supported Bluetooth profiles."
am: 0a86c936a6

Change-Id: Id10ad10a5dbcab92e390a7a245772d2b551ad30c
2016-11-01 23:20:16 +00:00
Bryce Lee
f6b74dea04 Add a way to query for supported Bluetooth profiles.
Currently there is no way to get the profiles supported by the Bluetooth
adapter. Asking for a profile proxy of an unsupported profile does not
fail and can lead to code indefinitely waiting for the proxy response. This
new code will allow for checking the supported profiles before asking for
the proxies.

Bug: 26451648
Change-Id: I4b48e7151f5ca53851aa3b967c143fae140ecd34
(cherry picked from commit b1301fa284)
2016-11-01 15:13:04 -07:00
Marie Janssen
635d528877 resolve merge conflicts of 6a31a5c to stage-aosp-master
am: 879a5169ec

Change-Id: Ib6321dee7357920c73b135fbe465998dc4469e66
2016-10-31 18:47:52 +00:00
Marie Janssen
879a5169ec resolve merge conflicts of 6a31a5c to stage-aosp-master
Change-Id: I29f2085f4656b0b57896ef505ef6a50cdbd1b194
2016-10-31 11:00:06 -07:00
Marie Janssen
6a383a7d32 Bluetooth: prevent enabling BLE in airplane mode
Enabling BLE in airplane mode puts BluetoothManagerService in an
unexpected state which causes Bluetooth to be on when airplane mode
is disabled.

Also fixes a bug where a crash of a BLE client would trigger a restart
into ON mode.

Test: SL4A BleBackgroundScanTest:test_airplane_mode_disables_ble

Bug: 32140251
Bug: 32140271
Bug: 32369494

Change-Id: Ie65157e65c3a1ca914f567a7a0c631175d1e5835
2016-10-31 09:06:36 -07:00
Sanket Agarwal
9527a19cbc Merge "Use UUIDs for call management in Headset Client (HF)" am: 678ba24533
am: 958dab93cd

Change-Id: Ie21c9be4b7177179ea4588d2832d0bbf72e7a3c1
2016-10-28 20:19:14 +00:00
Sanket Agarwal
958dab93cd Merge "Use UUIDs for call management in Headset Client (HF)"
am: 678ba24533

Change-Id: I77553f45f3d5de04e9b443e425f15afb8946e237
2016-10-28 20:13:57 +00:00
Sanket Agarwal
52a04e4467 Use UUIDs for call management in Headset Client (HF)
Using UUIDs that are managed by the service gives more control and error
handling in the service since it has control over assigning them.

Bug: b/29788044
Change-Id: I8483f8e61a33302ba95d544828947d7fb4a21be9
(cherry picked from commit dbeab2c6e12693fe9b06b6a680677da5325c9230)
(cherry picked from commit 40bb6f3f8f)
2016-10-28 18:16:53 +00:00
Jakub Pawlowski
d649849928 Merge "Separate LE scanner from GATT client (1/4)" am: 87c997ca21 am: 81d5ecb7a6 am: 61d0088923
am: e582ab854d

Change-Id: Ibbf57cfccad50ae5d7dd9f80a13f08c5cfd1623e
2016-10-28 03:24:38 +00:00
Jakub Pawlowski
e582ab854d Merge "Separate LE scanner from GATT client (1/4)" am: 87c997ca21 am: 81d5ecb7a6
am: 61d0088923

Change-Id: I83c82b17064ee958fff6a98d90a0b351205ccf54
2016-10-28 03:01:56 +00:00
Jakub Pawlowski
61d0088923 Merge "Separate LE scanner from GATT client (1/4)" am: 87c997ca21
am: 81d5ecb7a6

Change-Id: If7688706be45e72e3ab98a35d3712ddae9d508a6
2016-10-28 02:56:54 +00:00
Jakub Pawlowski
81d5ecb7a6 Merge "Separate LE scanner from GATT client (1/4)"
am: 87c997ca21

Change-Id: I8fdf97a457d7566b4e0048624d47a6cfea693f13
2016-10-28 02:50:54 +00:00
Jakub Pawlowski
1b49e6eb04 Separate LE scanner from GATT client (1/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
Change-Id: I0c25bd4a58bb430eb0ee4100d5f2bbab194f9621
2016-10-27 23:09:35 +00:00
Svetoslav Ganov
f9e2ad0b3c Add Bluetooth toggle prompts - framework
If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
(cherry picked from commit ac69be543f)
2016-10-27 22:49:11 +00:00
Marie Janssen
1e012d93c7 resolve merge conflicts of 1238daf to master
Change-Id: Icc70d291379d4f4816881e46704197513e6d548e
2016-10-26 17:57:22 -07:00
Marie Janssen
1238daf20d Bluetooth: prevent enabling BLE in airplane mode am: a80d745c65 am: 6affbde556
am: 73bfd25356

Change-Id: Ieb424a2d68058d4171e6c9bd04f8a42cc1f3d7e9
2016-10-27 00:29:51 +00:00
Marie Janssen
6affbde556 Bluetooth: prevent enabling BLE in airplane mode
am: a80d745c65

Change-Id: I05a57fa747abedab24e0509c1fb7ab8737b2256a
2016-10-27 00:20:17 +00:00
Marie Janssen
a80d745c65 Bluetooth: prevent enabling BLE in airplane mode
Enabling BLE in airplane mode puts BluetoothManagerService in an
unexpected state which causes Bluetooth to be on when airplane mode
is disabled.

Also fixes a bug where a crash of a BLE client would trigger a restart
into ON mode.

Test: SL4A BleBackgroundScanTest:test_airplane_mode_disables_ble

Bug: 32140251
Bug: 32140271
Bug: 32369494

Change-Id: Ie65157e65c3a1ca914f567a7a0c631175d1e5835
(cherry picked from commit bd93b7b3dc6141cef6236cf0ca7dcc5acf5bfeed)
2016-10-26 14:55:47 -07:00
Jakub Pawlowski
bd7c33967c Merge "Add helper method to convert Bluetooth UUID to bytes" am: 8a0a58b218 am: f169ecb76f am: f68a0c6dec
am: 94aaa0a705

Change-Id: I6cbff5dba97d53763861b60c015cf6ff349eaa23
2016-10-25 22:02:54 +00:00
Jakub Pawlowski
f68a0c6dec Merge "Add helper method to convert Bluetooth UUID to bytes" am: 8a0a58b218
am: f169ecb76f

Change-Id: I035eb25c9a320b1760221bc5928919a148801488
2016-10-25 21:54:44 +00:00
Jakub Pawlowski
f169ecb76f Merge "Add helper method to convert Bluetooth UUID to bytes"
am: 8a0a58b218

Change-Id: I829135e559a9c3cf3c942258a16acee62c37c3ac
2016-10-25 21:47:35 +00:00
Jakub Pawlowski
f67ee83a22 Add helper method to convert Bluetooth UUID to bytes
Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I7f646d1d357c51b82efc504a0e65d868ad363ddb
2016-10-25 12:30:24 -07:00