Commit Graph

777 Commits

Author SHA1 Message Date
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
Jacky Cheung
c74c449bc9 Merge "Gradually increase the level of authentication on failed GATT operations." am: 6071abdb92 am: 046a5c3a00
am: bd12e5c9db

Change-Id: Ic38340c15d1f2723c31d84acff12739acf8da3ff
2016-10-20 23:20:57 +00:00
Jacky Cheung
bd12e5c9db Merge "Gradually increase the level of authentication on failed GATT operations." am: 6071abdb92
am: 046a5c3a00

Change-Id: I749b2e4d4a13f099cfdc164f7fec8556d09f8433
2016-10-20 23:11:51 +00:00
Jacky Cheung
046a5c3a00 Merge "Gradually increase the level of authentication on failed GATT operations."
am: 6071abdb92

Change-Id: If06babf4a23879acdfc358838cdc094d753c362b
2016-10-20 23:03:57 +00:00
Jacky Cheung
3854e22674 Gradually increase the level of authentication on failed GATT operations.
When lower layer returns insufficient authentication or insufficient
encryption on various GATT operations, gradually retry with increased
authentication level first to AUTHENTICATION_NO_MITM, then
AUTHENTICATION_MITM.

Test: ported from internal branch.

Change-Id: I6bcc4198ca493b7900ddd166a81d30cde896fa86
2016-10-20 13:59:04 -07:00
Jacky Cheung
84c6d339ee Gradually increase the level of authentication on failed GATT operations.
When lower layer returns insufficient authentication or insufficient
encryption on various GATT operations, gradually retry with increased
authentication level first to AUTHENTICATION_NO_MITM, then
AUTHENTICATION_MITM.

Change-Id: I68335cf7451aeaf49c227d604f69cb329d117d08
2016-10-20 18:17:12 +00:00
Marie Janssen
733f0bc08e Bluetooth: More logging of bluetooth service state am: 9fa2491850 am: d8e027b5a4
am: 849174f228

Change-Id: I3049a597bf3182b68167973ab897749833a0dc9d
2016-10-19 16:56:49 +00:00
Marie Janssen
849174f228 Bluetooth: More logging of bluetooth service state am: 9fa2491850
am: d8e027b5a4

Change-Id: Ifaa9bad48234a6035b49a6a05484d91df31c5727
2016-10-19 16:49:23 +00:00
Marie Janssen
d8e027b5a4 Bluetooth: More logging of bluetooth service state
am: 9fa2491850

Change-Id: Idd26922caf3c1a0fb77d2091ac86bfe3a1d1c62a
2016-10-19 16:43:09 +00:00
Marie Janssen
9fa2491850 Bluetooth: More logging of bluetooth service state
Bug: 32140251
Bug: 32140271
Bug: 32060415

Change-Id: I50faa184551748023ea5a573646a75293f553d16
2016-10-19 16:28:31 +00:00
Bryce Lee
5a5626acd7 resolve merge conflicts of b1301fa to nyc-mr1-dev-plus-aosp
am: ccd3468567

Change-Id: I5dac528db07b40bb9e59a090bd7e0016ca6e996a
2016-10-18 17:41:52 +00:00
Bryce Lee
ccd3468567 resolve merge conflicts of b1301fa to nyc-mr1-dev-plus-aosp
Change-Id: Idb97adf36d981a340cdb5d24d4c3c3858d23e2fe
2016-10-18 10:07:00 -07:00
Sanket Agarwal
086be31642 Merge "Remove APIs that are not directly usable."
am: 9cff57312d

Change-Id: I1234db97ed82017ed3bca02e10818a53fdc33d3d
2016-10-17 21:28:05 +00:00
Sanket Agarwal
fb6322425a Remove APIs that are not directly usable.
The right way to expose this API is done via MediaBrowser.

Bug: b/28791287
Change-Id: I0a8a185934fd7aaa9f2b5eac7398955fa380060f
(cherry picked from commit b5fbb75aa2)
2016-10-17 12:47:10 -07:00
Bryce Lee
b1301fa284 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
2016-10-09 12:54:42 -07:00
Jakub Pawlowski
00be0387cc Merge "Fix connecting to profiles when bonding from local device (1/3)" am: 44c013d739 am: 6fe3900791 am: 56757a44a6
am: 4984d66b6a

Change-Id: I4b78ff54941ada956d4330a6192d0f1c279d953c
2016-10-07 15:11:55 +00:00
Jakub Pawlowski
4984d66b6a Merge "Fix connecting to profiles when bonding from local device (1/3)" am: 44c013d739 am: 6fe3900791
am: 56757a44a6

Change-Id: I3bdacc816923d012f061e5310d5e076fcaf9d387
2016-10-06 21:12:06 +00:00
Jakub Pawlowski
56757a44a6 Merge "Fix connecting to profiles when bonding from local device (1/3)" am: 44c013d739
am: 6fe3900791

Change-Id: I8e04aa89379c4a50031fade065c288fd1cc30668
2016-10-06 21:07:44 +00:00
Jakub Pawlowski
0278ab957a Fix connecting to profiles when bonding from local device (1/3)
When bond is created from Bluetooth Settings, profiles gets properly
auto connected when services are discovered. If pairing is done from any
other app, i.e. NFC app, the bond is not being recognized as initiated
from local device, and profiles are not connected.

This patch makes sure that if bonding is initiated, no matter from which
app, it will cause proper profiles to connect.

Bug: 30211618
Change-Id: I71131f33eb5b9db2f5b4a8737b191d541bf1fd3d
2016-10-04 17:29:37 +00:00
Jeremy Klein
70a220be4f Remove unused mContext from BluetoothGatt[Server]. am: adc26ec1b4 am: 140e5cce70
am: 8002b27512

Change-Id: If05a528312cf0a5499c6ed122961124dc0d8e917
2016-09-28 15:50:05 +00:00
Jeremy Klein
8002b27512 Remove unused mContext from BluetoothGatt[Server]. am: adc26ec1b4
am: 140e5cce70

Change-Id: I11c459514e54bb486f3a90a1b0390453fc48b857
2016-09-28 15:44:23 +00:00
Jeremy Klein
adc26ec1b4 Remove unused mContext from BluetoothGatt[Server].
All that this member variable is doing right now is leaking a
reference to a context without any benefit.

Bug: 31752040
Bug: 31710795
Change-Id: If2241422533318b866340e8dcc9f5fbd9518349c
2016-09-28 07:09:38 +00:00
Ajay Panicker
8c9b37fecd Prevent NPE if someone creates a bad BluetoothHealthAppConfig object am: 74fa2d6846 am: 26803036be
am: e6558c2a54

Change-Id: I7f1ecb3ec7d0a02deff5fa0782966a0528e54098
2016-09-26 19:36:35 +00:00
Ajay Panicker
e6558c2a54 Prevent NPE if someone creates a bad BluetoothHealthAppConfig object am: 74fa2d6846
am: 26803036be

Change-Id: I4aa3f463b688f941817e6df4a16ff1036d7be8c5
2016-09-26 18:37:58 +00:00
Ajay Panicker
74fa2d6846 Prevent NPE if someone creates a bad BluetoothHealthAppConfig object
Bug: 28271086
Change-Id: Ic8ebe3152e2b06c070316acc7e6a1f89763cd2a3
2016-09-23 22:08:26 +00:00
Marie Janssen
6685014f34 Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27 am: e3812fc048 am: 532d2b11a3 am: 6f514cc82b am: dbb8ffc47d
am: 21688f8e34

Change-Id: I53b686ada774a48049dc76c58568746880e74978
2016-09-21 07:25:03 +00:00
Marie Janssen
21688f8e34 Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27 am: e3812fc048 am: 532d2b11a3 am: 6f514cc82b
am: dbb8ffc47d

Change-Id: I695df247f11b6bce15d3f771e4cc2edfd7c86f10
2016-09-21 02:20:22 +00:00
Marie Janssen
dbb8ffc47d Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27 am: e3812fc048 am: 532d2b11a3
am: 6f514cc82b

Change-Id: I88928de86c08a148b3124c616b309862da1a1c24
2016-09-21 01:59:29 +00:00
Marie Janssen
5742a055e2 Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27 am: e3812fc048 am: 532d2b11a3
am: 6f514cc82b

Change-Id: Idc9352afe667bb8be4846dc53036e95af2b248ce
2016-09-21 01:32:37 +00:00
Marie Janssen
6f514cc82b Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27 am: e3812fc048
am: 532d2b11a3

Change-Id: Iee468d3bcfd72b33475e9bf1d51865f3c5e8a4a2
2016-09-21 01:02:29 +00:00
Sanket Agarwal
b5fbb75aa2 Remove APIs that are not directly usable
This API is now exposed via MediaBrowser.

Bug: b/28791287
Change-Id: I0a8a185934fd7aaa9f2b5eac7398955fa380060f
2016-09-20 17:52:17 -07:00
Marie Janssen
532d2b11a3 Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f am: 3106e3ae27
am: e3812fc048

Change-Id: I6119aa9db2792a149202c16d63de205ba32423e8
2016-09-21 00:46:01 +00:00
Marie Janssen
e3812fc048 Fix setPairingConfirmation permissions issue (2/2) am: 93326cfd9f
am: 3106e3ae27

Change-Id: I0748eed7b884294d993b4538e4e65397b6f0dbb2
2016-09-21 00:37:07 +00:00
Marie Janssen
93326cfd9f Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: I887de32d156e672ec44aa0b286cd7ea7f9f8ad55
2016-09-08 18:15:26 +00:00
Jakub Pawlowski
2dd2fead45 Merge "Separate advertiser from GATT client (1/4)" am: 5f87c4539a am: 40a16ea242 am: 9f341e4e49
am: 8348bd2317

Change-Id: I15b6c8ab87822e5f33bdfabcb8e09e8ce9501cd7
2016-09-01 01:27:03 +00:00
Jakub Pawlowski
8348bd2317 Merge "Separate advertiser from GATT client (1/4)" am: 5f87c4539a am: 40a16ea242
am: 9f341e4e49

Change-Id: Ic3461b98449636cfc125890f255b1332d0ef5132
2016-08-31 18:28:45 +00:00
Jakub Pawlowski
9f341e4e49 Merge "Separate advertiser from GATT client (1/4)" am: 5f87c4539a
am: 40a16ea242

Change-Id: I0d08f623e78fdd779b39083d0da3a45aee72ff3c
2016-08-31 18:21:00 +00:00