Commit Graph

861 Commits

Author SHA1 Message Date
Pavlin Radoslavov
489ce07b81 Merge "Add a mechanism to configure the default A2DP codec priorities" am: acf34d8b62 am: cd6e0ee19d am: b7067e2b6c
am: 537eaf0f6e

Change-Id: I42186a561d59decb0d811b3f5b8d5bf96df53152
2017-02-07 14:05:43 +00:00
Pavlin Radoslavov
b7067e2b6c Merge "Add a mechanism to configure the default A2DP codec priorities" am: acf34d8b62
am: cd6e0ee19d

Change-Id: I6fb8a3a35451cf2d1e228466ef4a4d4e89d1d4ca
2017-02-07 00:10:21 +00:00
Pavlin Radoslavov
2199339c39 Add a mechanism to configure the default A2DP codec priorities
Previously, the relative codec priorities were hard-codec internally.
The new mechanism uses the following configurable resources in
packages/apps/Bluetooth/res/values/config.xml to re-assign the
default codec priorities per device, or to explicitly disable a codec.

 - a2dp_source_codec_priority_sbc
 - a2dp_source_codec_priority_aac
 - a2dp_source_codec_priority_aptx
 - a2dp_source_codec_priority_aptx_hd
 - a2dp_source_codec_priority_ldac

Those values are assigned on startup.
Also, they can be changed per device by using an overlay:
device/<VENDOR>/<DEVICE>/overlay/packages/apps/Bluetooth/res/values/config.xml

Test: Manually streaming to a headset
Change-Id: Ic4da3a51ac73f00cbae731156cb7878c8fadee06
2017-02-06 13:07:23 -08:00
Eugene Susla
6ed45d8cd3 CompanionDeviceManager
This introduces an API for apps that support companion devices to provide a
more streamlined flow for pairing and setting up the device

Bug: 30932767
Test: Using a toy app, invoke the newly introduced API (CompanionDeviceManager),
 and go through the flow. Ensure filtering works, and device is returned to
 the calling app. Ensure the calling app can pair to the selected device.
Change-Id: I0aeb653afd65e4adead13ea9c7248ec20971b04a
2017-02-06 12:50:55 -08:00
Pavlin Radoslavov
45250aca6d Merge "Update the A2DP Codec Config API" am: ccd60f7cbe am: f0096fb868 am: 91707989c4
am: 1ef3c9888e

Change-Id: If69bfe9839a35dc141d741695a217fa4805d46cc
2017-01-31 19:25:11 +00:00
Pavlin Radoslavov
91707989c4 Merge "Update the A2DP Codec Config API" am: ccd60f7cbe
am: f0096fb868

Change-Id: Ibc7d4b500adc4451978f366557b93dc6b6d3da63
2017-01-31 19:13:05 +00:00
Pavlin Radoslavov
b37f181c98 Update the A2DP Codec Config API
Previously, the JNI upcall would contain only the current codec config.
In the new API, the upcall contains:
 1. The current codec config
 2. The list of codecs containing the local codecs capabilities
 3. The list of codecs containing the selectable codecs capabilities.
    This list is the intersection of the local codecs capabilities
    and the capabilities of the paired device.

Also, refactored the Java internals to accomodate the extra information:
 * Added new class BluetoothCodecStatus that contains the extra info:
   current codec config, local codecs capabilities and selectable
   codecs capabilities
 * Renamed method getCodecConfig() to getCodecStatus() and return the
   corresponding BluetoothCodecStatus object.
 * Updates to class BluetoothCodecConfig:
   new methods isValid(), getCodecName(), and updated toString()
   so it is more user friendly
 * Removed BluetoothCodecConfig.EXTRA_CODEC_CONFIG and
   EXTRA_PREVIOUS_CODEC_CONFIG.
   The former is superseded by BluetoothCodecStatus.EXTRA_CODEC_STATUS;
   the latter is not really used.

Test: A2DP streaming with headsets and switching the codecs
Change-Id: Ia1af2c22e521e863e28a360610aca49f7e62d31b
2017-01-31 18:58:27 +00:00
Marie Janssen
2db3f99cfe Merge "Bluetooth: add getDiscoveryEndMillis() call" am: 1785fc4eea am: 7f8d8638eb am: ca312c1cd3
am: 9eb3d7e335

Change-Id: I45a29862c9a841b68bee41daff1d8e46145cbd79
2017-01-30 19:11:46 +00:00
Marie Janssen
ca312c1cd3 Merge "Bluetooth: add getDiscoveryEndMillis() call" am: 1785fc4eea
am: 7f8d8638eb

Change-Id: I6f02c4ddc0fe56cda5af2dcf2f5193ba13522792
2017-01-30 17:57:02 +00:00
Marie Janssen
23a4833157 Bluetooth: add getDiscoveryEndMillis() call
Method to tell when the adapter finished (or will finish) being in
discovery mode.

Test: compiles and still can scan
Bug: 34395439
Change-Id: I41b48c2b934c0a1d5e1727cec08f3f762e3cb309
2017-01-27 18:48:11 -08:00
Pavlin Radoslavov
02e806550c Merge "Integration of the AAC codec for A2DP source" am: 22f97c83fb am: f23e80bb9b am: d364208388
am: 78798cc13d

Change-Id: Ic645f9ee2eb090fc805a25a1449642dad021db4e
2017-01-26 19:42:16 +00:00
Pavlin Radoslavov
d364208388 Merge "Integration of the AAC codec for A2DP source" am: 22f97c83fb
am: f23e80bb9b

Change-Id: If2d85eba17f7ece5b3d19e3ee8fc86b7cf9bc062
2017-01-26 19:25:37 +00:00
Pavlin Radoslavov
b33bd5bc2e Integration of the AAC codec for A2DP source
Test: A2DP streaming to AAC headsets
Bug: 30958229
Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
2017-01-26 09:06:02 -08:00
Sanket Agarwal
c8399321e9 Change HFP Client API to support multi device
- Adds BluetoothDevice as a parameter where required
- Gets rid of device management APIs that can be done via
  BluetoothProfiles instead

Test: Manual sanity tests
Bug: b/33554547
Bug: b/30984220
Change-Id: I3485ac5bfe1fcb29c774ad040fdd608e1cacb8df
(cherry picked from commit 039eeb81b5)
2017-01-23 22:53:58 +00:00
Sanket Agarwal
a3ae5c4e24 Change HFP Client API to support multi device
- Adds BluetoothDevice as a parameter where required
- Gets rid of device management APIs that can be done via
  BluetoothProfiles instead

Test: Manual sanity tests
Bug: b/33554547
Bug: b/30984220
Change-Id: I3485ac5bfe1fcb29c774ad040fdd608e1cacb8df
(cherry picked from commit 039eeb81b5)
2017-01-20 19:30:35 -08:00
Sanket Agarwal
039eeb81b5 Change HFP Client API to support multi device
- Adds BluetoothDevice as a parameter where required
- Gets rid of device management APIs that can be done via
  BluetoothProfiles instead

Test: Manual sanity tests
Bug: b/33554547
Bug: b/30984220
Change-Id: I3485ac5bfe1fcb29c774ad040fdd608e1cacb8df
2017-01-20 14:55:15 -08:00
Neil Fuller
261a1dcffd Merge "Refactor RFCOMM / BluetoothSocket usage of LocalSocket" am: 649a89e524 am: f4e236c794 am: 43d53395dc
am: 75f84f2261

Change-Id: I5cf584048e1e2cde67c33d77e99cd181db4e8c82
2017-01-11 15:45:29 +00:00
Neil Fuller
43d53395dc Merge "Refactor RFCOMM / BluetoothSocket usage of LocalSocket" am: 649a89e524
am: f4e236c794

Change-Id: If23b5efe912c5b0a76487c46723288ff6a903a14
2017-01-11 13:48:14 +00:00
Neil Fuller
7fd724611b Refactor RFCOMM / BluetoothSocket usage of LocalSocket
LocalSocket is used by BluetoothSocket. BluetoothSocket
passes a pre-created file descriptor to LocalSocket that
is then given to the LocalSocketImpl.

Commit b08c7bc0bd broke the
behavior. Commit 7a8c36aa4e
put in a minimal fix.

This change tidies up LocalSocket and associated classes
and replaces a specialist constructor with a factory method
to highlight the special case. While there an unnecessary
exception has been removed.

Bug: 34111534
Test: Boot device
Test: vogar --mode app_process tests/tests/net/src/android/net/cts/LocalSocketTest.java
Change-Id: I4ba2f2d9ea361a950ff8bc8d64fc800d998c3210
2017-01-06 14:18:07 +00:00
Pavlin Radoslavov
3c0baf0082 Merge "Integration of the LDAC codec for A2DP source" am: 3c050268f0 am: bb8f1cd92b am: 7d14914239
am: 01be004c72

Change-Id: Ia0bdac1d25993519e85f962e7b7624ae5740e685
2017-01-05 08:04:26 +00:00
Pavlin Radoslavov
7d14914239 Merge "Integration of the LDAC codec for A2DP source" am: 3c050268f0
am: bb8f1cd92b

Change-Id: I62f8462330d7661b8008abf862c4d4bb47c129dc
2017-01-05 07:55:27 +00:00
Pavlin Radoslavov
9569ea0b93 Merge "Integration of the aptX and aptX-HD codecs for A2DP source" am: 5242acbd0b am: a750c90ac1 am: 5aaa985e97
am: 546866988a

Change-Id: Id2eb6fc928098fffdf1be85bc708efa8a1b7a339
2017-01-05 02:17:35 +00:00
Pavlin Radoslavov
fad8b730d2 Integration of the LDAC codec for A2DP source
The codec can be used if the encoding shared library is installed
on the device:
 libldacBT_enc.so

Test: A2DP streaming to LDAC headsets
Bug: 30958229

Change-Id: I524805fd308b5181427515617eda05625a7c4ae5
2017-01-04 18:07:29 -08:00
Pavlin Radoslavov
5aaa985e97 Merge "Integration of the aptX and aptX-HD codecs for A2DP source" am: 5242acbd0b
am: a750c90ac1

Change-Id: I7957fb151bb113485240fdc2bae1cdd380930f27
2017-01-05 02:07:05 +00:00
Pavlin Radoslavov
feeb9b245c Integration of the aptX and aptX-HD codecs for A2DP source
Each of the codecs can be used if the corresponding encoding
shared library is installed on the device:
 - aptX: libaptX.so
 - aptX-HD: libaptXHD.so

Test: A2DP streaming to aptX and aptX-HD headsets
Bug: 30958229
Change-Id: I24faddc8cd88ae3e1370922c633f30e13124a867
2017-01-04 16:30:35 -08:00
Ivan Podogov
c8daa78a42 Merge "HID Device role API fixes" am: f33a71d017 am: a7d58fecc6 am: 8e2e2b1381
am: daa72ea3ab

Change-Id: I7ee44e6d952c5d9760e04572d2009fe107aad80b
2017-01-04 10:48:34 +00:00
Ivan Podogov
8e2e2b1381 Merge "HID Device role API fixes" am: f33a71d017
am: a7d58fecc6

Change-Id: Iab0dc91a8e2d4066d5eb85ec4771d42642783671
2017-01-04 10:41:26 +00:00
Ivan Podogov
f33a71d017 Merge "HID Device role API fixes" 2017-01-04 10:32:41 +00:00
Pavlin Radoslavov
858ab99071 Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96 am: 8b46f87e7e am: da3de76bdb
am: 62c5226e9c

Change-Id: I14d4cc2dc91cb1ab431eda32d5066ac8f471c3a6
2017-01-04 03:54:18 +00:00
Pavlin Radoslavov
da3de76bdb Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96
am: 8b46f87e7e

Change-Id: I39e4b90491f646887200649954b652d9f5439925
2017-01-04 03:44:40 +00:00
Pavlin Radoslavov
44a4ef0aa9 Add a mechanism for configuring the A2DP Source codecs
* Added a new class BluetoothCodecConfig that contains codec-related
  configuration or capabilities: codec type, priority, sample rate,
  bits per sample, channel mode, and codec specific fields.

* Extended the Bluetooth A2DP AIDL interface to get/set the current
  codec configuration

* Added new call handleBluetoothA2dpDeviceConfigChange() to the Media
  Framework that is called when there are changes in the
  Bluetooth A2DP device configuration - e.g., the A2DP codec is changed.

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: I9a82716cbc2a5efbe77352a031ac80c88f6a2459
2017-01-03 17:52:52 -08:00
Ivan Podogov
dd87cd3bb6 HID Device role API fixes
This change makes HIDD API more like the other ones, i.e.
supporting multiple devices, and implements missing methods.

While the underlying implementation may still only support a
single device at a time, the "device" parameter can still be
useful for checking if the application is trying to send the
data to a correct device.

Test: make
Change-Id: I55fe04c0762a96fcddd6c6678e790361d648111a
2017-01-03 22:36:30 +00:00
Ivan Podogov
d57df642d7 Fix profiles broken by ag/1751147 am: 5297dba712 am: 72d9008700
am: 0ad19476cb

Change-Id: I6e69bac35f1d3ec78b64287f4faa86103357e136
2016-12-30 23:22:36 +00:00
Ivan Podogov
72d9008700 Fix profiles broken by ag/1751147
am: 5297dba712

Change-Id: I9c0a4ead26f60b601847c1ba73e6b492a3611880
2016-12-30 23:07:32 +00:00
Ivan Podogov
5297dba712 Fix profiles broken by ag/1751147
Change-Id: Ifa92819df8e63355a3979ea0f1a20a0363b6cd45
2016-12-30 22:22:38 +00:00
Marie Janssen
6727859f42 resolve merge conflicts of 825d8ff to master
Change-Id: I57ae47778f738dbea6a670b85f24161cfb544a16
2016-12-29 16:20:43 -08:00
Marie Janssen
07e590a574 resolve merge conflicts of c816141 to nyc-mr1-dev-plus-aosp
Change-Id: I42e00b90165220d88519771b8f4280aaf3a07525
2016-12-29 14:05:47 -08:00
Marie Janssen
c816141bce resolve merge conflicts of 9cc7ebe to stage-aosp-master
Change-Id: Ia1cdf49d77a574c38ed5cc33c31d5cf930103484
2016-12-29 12:44:03 -08:00
Ivan Podogov
48e6745a08 Rename the Bluetooth profile classes for HID Device role. am: 0afe190af5 am: 94e3d3f499 am: 91ab2e2f98
am: 48738f5ad0

Change-Id: I15651c5a6e3baf53d915626ea6c55180fefe28b5
2016-12-29 20:08:38 +00:00
Hemant Gupta
c519b8d83e Bluetooth: Add support for HID Device Role am: e88fd4b594 am: ee469c6fe9 am: 1ee22b7f70
am: a9c92c2442

Change-Id: I56625e00b1b6c2b7b11e4ce4dc3038072ef6c231
2016-12-29 20:07:51 +00:00
Ivan Podogov
91ab2e2f98 Rename the Bluetooth profile classes for HID Device role. am: 0afe190af5
am: 94e3d3f499

Change-Id: I97ff93fd2564bd76d90095f8086f79c6c6086aff
2016-12-29 19:46:55 +00:00
Hemant Gupta
1ee22b7f70 Bluetooth: Add support for HID Device Role am: e88fd4b594
am: ee469c6fe9

Change-Id: Ic48911d254671d402f5a6b8198109f28e6497036
2016-12-29 19:46:08 +00:00
Ivan Podogov
94e3d3f499 Rename the Bluetooth profile classes for HID Device role.
am: 0afe190af5

Change-Id: Ib5c9b904da57048d719df504142edd3dab0e6ec3
2016-12-29 19:38:41 +00:00
Hemant Gupta
ee469c6fe9 Bluetooth: Add support for HID Device Role
am: e88fd4b594

Change-Id: Ic2a82d5670ffbd3046766d73ed9b180546c59169
2016-12-29 19:37:58 +00:00
Marie Janssen
9cc7ebe7d9 Merge "Bluetooth: track enabling in dumpsys" 2016-12-29 19:32:36 +00:00
Marie Janssen
5980456040 Bluetooth: track enabling in dumpsys
Move basic state dumpsys to here from AdapterService.

Track which apps are enabling and disabling Bluetooth, including BLE
apps, and show the apps in the dumpsys logs.

Test: start phone and enable/disable, take bug report
Bug: 33692282
Change-Id: I6ea62ebdcfd7873d0be1bb5c5c520bbce3737a40
2016-12-29 19:22:14 +00:00
Ivan Podogov
0afe190af5 Rename the Bluetooth profile classes for HID Device role.
We already have BluetoothInputDevice class, so adding something
called BluetoothHidDevice seems confusing. On the other hand,
the new class is designed to connect to HID Host devices, so
naming it BluetoothInputHost makes sense and goes in line with
the existing BluetoothInputDevice.

The same goes for the new constant HID_DEVICE that is just as
confusing to have together with the INPUT_DEVICE one.

This CL also renames the "connection state changed" broadcast
(for the same reasons), declares it as an SDK constant, and also
adds some javadoc to it.

Note that BluetoothHidDeviceApp* classes remained unchanged, as
those correspond to the app that implements the Device (and
connects to the Host).

Test: make
Change-Id: I5075ca5b97db3c1dd403c2e9660eecc7380cffe2
2016-12-29 14:30:40 +00:00
Hemant Gupta
e88fd4b594 Bluetooth: Add support for HID Device Role
This patch adds the HID Device Role support in Bluetooth framework.
Also AIDL and callback related files for HID Device role are added
to provide interface for third party applications to communicate with
HID Device Service.

Change-Id: Id03a362b7bcfa2e76056fa0197eaac12ce49b5a2
2016-12-29 14:29:53 +00:00
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