Commit Graph

633 Commits

Author SHA1 Message Date
Adam Lesinski
b95d4ae257 Merge "Add WorkSource to BLE scanning API" 2016-01-27 20:41:45 +00:00
Marie Janssen
9db28ebea5 IBluetooth: remove dump(), support arguments
Because IBluetooth is a Binder service, we don't need dump() to
support dumpsys, just call the IBinder.dump().

Change-Id: Idcd48f758427b824e0b7eaafd091ba3fb2ff8993
(cherry picked from commit adbb3ff062e039b2552c6b5ded92e56346ac3934)
2016-01-26 20:00:11 +00:00
Bryce Lee
18116c01c2 Improve logging in BluetoothHeadsetClientCall.
Change-Id: I3b1b3946ca21c0bbc902a2c521938239a486d98a
(cherry picked from commit fe985fa7f0)
2016-01-21 23:11:20 +00:00
Adam Lesinski
50e4760214 Record bytes transferred for bluetooth
Bug:26039657
Change-Id: Iec42459d12f4106d5733f55313e8544d58930285
2016-01-18 18:22:55 -08:00
Adam Lesinski
6771d629b5 Add WorkSource to BLE scanning API
This will allow apps that do work on behalf of others to correctly blame
those apps for the power implications of BLE scanning.
Bug:22718669

Change-Id: Ib64af0b6a5d37721a6067ac4e5c39c01f921b56b
2016-01-18 18:19:08 -08:00
Jakub Pawlowski
2fc6e6bfd2 Implementation of BluetoothDevice.createBondOutOfBand
This patch implements out of band pairing that uses optional data.
Currently, it works only for LE transport, using Temporary Key value.
In the future fields might be added to OOBData to support other options for
optional data.

Change-Id: I0811182efb72ac5f80521ed4876b32603cb628c1
2016-01-15 00:01:02 +00:00
Sanket Agarwal
1bec6a5b0d Add support for AVRCP 1.3.
* Add metadata support.
* Add player settings support.
* Add playback support.

A2DP Settings App support.

Bluetooth: A2DP Sink support for Settings App

- add support for A2DP Sink in Settings App. This will enable connection
  initiation and updation on Settings App
- add framework Apis to support A2DP Sink. Any third party Apps can access
  A2DP Sink priority of device and playing state of device
- add support for key to set priority. This manages priority of device for
  A2DP Sink profile

Change-Id: If5f9139f37cdb9d200387877c7801075205c78a0
2016-01-14 21:59:33 +00:00
Bryce Lee
a9b1ee799e Merge "Remove duplicate Bluetooth profiles." into cw-e-dev am: 9c27969385 am: d980b8c7a0 am: 1b695edc97
am: 76656c6b48

* commit '76656c6b48d3fa3e5538e864929ba63b692d5764':
  Remove duplicate Bluetooth profiles.
2015-12-18 23:25:27 +00:00
Bryce Lee
15309a3d20 Remove duplicate Bluetooth profiles.
Change-Id: I04fd867511713dd02ef249b113f7a46c69f22f98
2015-12-18 11:34:20 -08:00
Bryce Lee
bd17928afc resolve merge conflicts of 6b9e5bf0c2 to master.
Change-Id: Idada49313619533bfeb375ee232c942589457fa4
2015-12-18 03:05:20 +00:00
Bryce Lee
cf91b45c05 Merge "Add setting for declaring disabled bluetooth profiles." into cw-e-dev 2015-12-17 19:40:47 +00:00
Bryce Lee
3a0ea6254d Merge "Add UUID to BluetoothHeadsetClientCall" into cw-e-dev am: cae2f2415b am: fc3762aafd am: 0ccc3a1cb5
am: 972c616ce2

* commit '972c616ce2f83622e5529ef86c9d7f243a60b601':
  Add UUID to BluetoothHeadsetClientCall
2015-12-17 00:42:08 +00:00
Bryce Lee
e457fa4b9d Add UUID to BluetoothHeadsetClientCall
This will allow for unique identification of a call as id only provides
uniqueness per session.

Bug: 26016489
Change-Id: I643d24bf5ff5680c26e530075649ef2a4f378295
2015-12-16 15:33:59 -08:00
Bryce Lee
ec85f34812 Add setting for declaring disabled bluetooth profiles.
Bug: 25900899
Change-Id: I420a7c590d72ba10f3e466d15dccfdbb520e810a
2015-12-16 13:32:28 -08:00
Andreas Gampe
e6748ce31f Frameworks/base: Use Arrays.toString
Fix a couple of cases where Arrays.toString should be used.

Bug: 19797138
Change-Id: I905fc79e63face9b26975320a92086c732bf6316
2015-12-14 12:04:26 -08:00
Bryce Lee
e5d5773f71 Improve logging in BluetoothHeadsetClientCall. am: 3c67873f0a am: 180dd72a9b am: a83d518689
am: 0a8c81a204

* commit '0a8c81a2046753f08c036ec68a15778e0c0dade4':
  Improve logging in BluetoothHeadsetClientCall.
2015-12-09 23:18:52 +00:00
Bryce Lee
3c67873f0a Improve logging in BluetoothHeadsetClientCall.
Bug: 26032099
Change-Id: I497edc9aa4c19cc7159993a899071e7b0c26db63
2015-12-08 11:22:31 -08:00
Neil Fuller
1d4775fbb2 Merge "Add thread safety documentation" 2015-12-04 11:09:53 +00:00
Christine Hallstrom
07c289d183 Merge "Log API calls to createBond(), cancelBondProcess(), removeBond()" into cw-e-dev am: 7fb263c472 am: 67d068b5ec am: 9355a0420e
am: c1a79e7bd2

* commit 'c1a79e7bd2061c025fd88529800db7358c39ed14':
  Log API calls to createBond(), cancelBondProcess(), removeBond()
2015-12-03 21:00:30 +00:00
Christine Hallstrom
044b8f3f03 Log API calls to createBond(), cancelBondProcess(), removeBond()
In an attempt to better be able to debug Bluetooth-related parts of
the system, add info-level logging including calling process and
thread whenever the aforementioned functions are called.

Bug: 25996120
Change-Id: I5a72b2ab929f805ec1c43cc54879ed079a8dfe34
2015-12-03 19:08:17 +00:00
Neil Fuller
bf0dc0fba7 Add thread safety documentation
An upcoming change will remove "synchronized" from the API docs. This change
documents those cases where the guarantees can be determined from code
inspection.

Bug: 25767152
Change-Id: I75083ce01513ed315222304fe3f34190d40748cb
2015-11-26 13:33:48 +00:00
Bryce Lee
cdde7c8868 Merge "Add Bluetooth headset API to allow disabling audio route." into cw-e-dev am: cb8749c903 am: 0fa22022a3 am: e2861471b9 am: 52d93db91d
am: 17ffebf8c8

* commit '17ffebf8c802ccc5ee6db36aad88e560297d6c33':
  Add Bluetooth headset API to allow disabling audio route.
2015-11-17 16:41:39 +00:00
Bryce Lee
0db53d90a0 Add Bluetooth headset API to allow disabling audio route.
This functionality is required by devices which have multiple profiles
using the SCO channel. For example, a device that is both a HFP AG and HF.
In this case, we must explicitly notify the profiles when they can acquire
the channel as they are not aware of each other. A similar change was
previously added to the Bluetooth Headset Client profile.

Bug: 25485578
Change-Id: Ia60cfdd33c2c3c3f185464b24056f8ccb976056d
2015-11-16 08:55:52 -08:00
Bryce Lee
52e52f6f56 Merge "Add ability to set whether audio route is allowed in BluetoothHeadsetClient" into cw-e-dev am: 4636770f0d am: 3b6f9f78cf
am: 698b33ea7f

* commit '698b33ea7f78d200df73ef869d68cfc5ab36e604':
  Add ability to set whether audio route is allowed in BluetoothHeadsetClient
2015-10-29 18:19:14 +00:00
Bryce Lee
bc8654748f Merge "Revert "Declare new interface for headset client bluetooth profile to query."" into cw-e-dev am: 0a80294c81 am: 2adf45bee0
am: 8faa19c826

* commit '8faa19c8260d77c5ad7abc061bc06bc596be7c2b':
  Revert "Declare new interface for headset client bluetooth profile to query."
2015-10-29 18:17:41 +00:00
Bryce Lee
461ba0ce4a Merge "Declare new interface for headset client bluetooth profile to query." into cw-e-dev am: a841973dee am: 8b4f21b108
am: 2b47b6eed2

* commit '2b47b6eed247acc95a2d27980b2d20e43c852946':
  Declare new interface for headset client bluetooth profile to query.
2015-10-29 18:15:23 +00:00
Bryce Lee
dc13382622 Add ability to set whether audio route is allowed in BluetoothHeadsetClient
Bug: 25332357
Change-Id: I942ac0dea3e4f8580c44e027a570d0b59822a257
2015-10-28 22:21:54 -07:00
Bryce Lee
70d4210e2e Revert "Declare new interface for headset client bluetooth profile to query."
This reverts commit 694251eaaa.

Change-Id: I588206d8aedb96254c27494dddb32ddc3b6ea0ea
2015-10-29 04:58:38 +00:00
Bryce Lee
694251eaaa Declare new interface for headset client bluetooth profile to query.
This is needed in order to allow implementations of the HFP HF side to
define when audio can be routed to the device. This allows for calls dialed
from an AG to be kept on the AG if desired.

Bug: 25332357
Change-Id: I35a554cfc53f88c7dd3059bf52df5c69df9c7415
2015-10-28 21:06:27 -07:00
Florian Salbrechter
30c3c09071 Merge "Fix wrong javadoc in BluetoothAdapter." 2015-08-20 09:29:29 +00:00
Ajay Panicker
cda6e878cd Implement Bluetooth settings factory reset (2/5)
Implemented the factory reset function to be used to reset all bluetooth
settings on device to factory default

Bug: 16161518
2015-08-05 10:35:15 -07:00
Florian Salbrechter
05416af2ae Fix wrong javadoc in BluetoothAdapter.
Calling getSystemService(BLUETOOTH_SERVICE) returns a BluetoothManager.

See ag/661924.

Change-Id: I589837b9db3b7e0bc0639c85f4acf23a8f9fb7d1
2015-07-31 14:43:15 +01:00
Fyodor Kupolov
7bd8be0019 Added a note about location permission
ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission is required to get
results.

Bug: 21852542
Change-Id: I3a2746d691f4d7024b0bb7b884d4436c73ce82e6
2015-07-16 19:40:13 -07:00
Fyodor Kupolov
4044440d2c Merge "Require ACCESS_COARSE_LOCATION for ACTION_FOUND broadcast" into mnc-dev 2015-07-15 01:34:43 +00:00
Fyodor Kupolov
72f491dd86 Require ACCESS_COARSE_LOCATION for ACTION_FOUND broadcast
Receivers of ACTION_FOUND intent are now required to have
ACCESS_COARSE_LOCATION permission.

Bug: 21852542
Change-Id: I8306f7431f067ca36bfc568a912385153fa3d496
2015-07-14 11:38:58 -07:00
Zach Johnson
569ff225a3 Fix BluetoothSocket file descriptor leak
Sockets accepted on a server socket didn't populate
the mPfd field, which is used to close out the java
end of the native-and-java communication socket when
the overall rfcomm socket is closed. #badnewsbears

b/21398841

Change-Id: I3adb0a9965f83d0f3006fa4f79ea4abeab5c9a17
2015-07-14 03:40:49 +00:00
Fyodor Kupolov
a179030483 Do not return devices when caller has no location permission
During startLeScan, do not return devices if calling process has no location
permission/appop

Bug: 21852542
Change-Id: Idce8f4704558574e373e8144390f2a2fa1a7e84a
2015-07-09 21:38:50 +00:00
Jerome Poichet
cd62b10bd6 Preventing leak
When transitioning from ON to OFF with LE Advertisers, advertiser do not
get a chance to unregister themselves as the stopAdvertising checks the
state of the stack and throws before unregistering the object.

It will then never remove the callback objects causing a leak.

b/22092678 | Remote service crash after switching to restricted profile

Change-Id: I04817026a524d10d60abdd8b533554a71a0112e2
2015-06-25 19:20:38 +00:00
Adam Lesinski
8a35137388 Bluetooth energy: fix overflow in calculation
Use longs instead of ints, because the energy values can get pretty
high.

Change-Id: I43e696ad9e5965c2e616b11920db5bfae5db1671
2015-06-15 17:19:07 -07:00
Casper Bonde
3b3d1fea94 SAP: Make it possible to enforce a 16-digit pin code (4/5)
This change enable the posibility to enforce using a
16-digit pin or MITM for a RFCOMM or L2CAP connection.

This is needed for the SIM access profile.

Change-Id: I3205013f9e758c353381442a86845dab467780f8
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
2015-06-09 21:42:22 +00:00
Casper Bonde
2328423d19 Add support for MITM for BluetoothSockets (1/4)
This change adds an option to enforce Man-in-the-middle protection
for the authentication process. This feature is needed for the Sim
Access Profile.

Change-Id: Ia3ef0caeb750f88608c9fa6bf6367d1c77de4cf3
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
2015-06-03 03:44:40 +00:00
Casper Bonde
da177bb5a0 SAP: Change to use new SDP Api (4/4)
Added class to carry SAP SDP record data.

Change-Id: Ic0d07402eca52c88e2be101181f6dd12e5e738d0
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
2015-06-03 00:04:37 +00:00
Wei Wang
6f54da32c9 Merge "Expose a few system APIs for BLE scan only mode." into mnc-dev 2015-06-02 17:24:00 +00:00
Wei Wang
f9e3e9e3dd Expose a few system APIs for BLE scan only mode.
Bug: 21562349
Change-Id: Ifc58efcf01edac5b4f9e5266adb966e7bc492209
2015-06-02 10:22:20 -07:00
Nitin Shivpure
1f8b844870 Bluetooth: Fix to avoid framework reboot during monkey testing
When running monkeyrunner, sometimes the framework is disconnected due
to an unhandled Java exception while binding the PAN service (when it
is unsuccessful). Handing the Java exception while binding PAN service
solves this issue.

Change-Id: Idea710593a3f9496305f636042605303e73e7749
2015-06-02 01:23:11 -07:00
Andre Eisenbach
708f57f4dc Un-hide connectGatt() variant with selective transport
Change-Id: I1d3c512160de2bd68550faf243bb151d5cf7f3c9
2015-06-02 02:28:54 +00:00
Prerepa Viswanadham
f5e368ff26 setCallbackType should be public for onlost/onfound apis
Bug: 21304922
Change-Id: I27ed4f3e00ac13354e3ef75e5686916be0d10918
2015-05-19 22:04:56 +00:00
Hemant Gupta
58fbffc36f Bluetooth: Check for mPanService before changing tethering state
Checking for mPanService before changing OR checking tethering state,
otherwise it will lead to application crash while checking isTetheringOn
OR changing tethering state.

Change-Id: I00844c03cdb8616118c1d50d7d31c75e51f0ef9b
2015-05-19 10:07:19 -07:00
Svet Ganov
408abf7f1b Do not report WiFi and Bluetooth MAC addresses - framework.
As a part of the new runtime permissions work we are limiting
the PII apps can access. BT and WiFi MAC addresses are PII and
based on our research there is no valid use case for app dev
to get these addresses aside of user tracking which we are
trying to limit.

bug:21078858

Change-Id: Ib48223b272c0fd4f5c36acc889d4f44df204b309
2015-05-18 15:14:24 -07:00
Tor Norbye
2d49752ee0 Add bluetooth permission annotations
Change-Id: I5bc86f8ec6ea5c873f1e14dab0e0c47c5c9df7f7
2015-05-15 00:18:28 +00:00