aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothLeAudio.java
Commit message (Collapse)AuthorAgeFilesLines
* Align the LE audio context type value and naming with SIG assigned numberAlice Kuo2022-08-241-25/+27
| | | | | | | | | | | | | | | | | | The previous value and naming is dismatch with the publiched assigned number, and the stack definition as well. The patch includes the following modification 1. Correct the context type value 2. Align the naming and comment 3. Change the order based on the context type value Bug: 240145498 Test: PTS test case and check the context type picker is the same between bt stack and framework Change-Id: Ib18d07a64a323791786ad60aa00bcfc0af712552 Merged-In: Ib18d07a64a323791786ad60aa00bcfc0af712552 (cherry picked from commit 56069e28133b031bb5d0e6753490f11788c48b51)
* Reuse SynchronousResultReceivers instead of creating new.Etienne Ruffieux2022-06-221-19/+19
| | | | | | | | Bug: 217366135 Tag: #feature Test: manual Ignore-AOSP-First: to be chery-picked Change-Id: If8ae530a284151888a3f89a51d2c58f2a5cd3644
* BluetoothLeAudio: Improve handling lead device disconnectionŁukasz Rymanowski2022-04-271-1/+3
| | | | | | | | | | | | | | | | | To improve scenario when lead Le Audio device is disconnected for the streaming group, while there are still other devices streaming, LeAudioService will not notify audio framework or other users about Le Audio lead device disconnection. Instead we try to reconnect under the hood and keep using lead device as a audio device indetifier in the audio framework in order to not stop the stream. Bug: 150670922 Bug: 228809876 Test: atest BluetoothInstrumentationTests Sponsor: @jpawlowski Change-Id: I02b960c6a5a966b6650dc3485c5d3f6735e4566b Merged-In: I02b960c6a5a966b6650dc3485c5d3f6735e4566b (cherry picked from commit eaf4f412d8fa8000df3e7229eed0cd4f96f22249)
* Fix unregistering callbacksJakub Tyszkowski2022-04-011-1/+1
| | | | | | | | Bug: 150670922 Tag: #feature Test: atest CtsBluetoothTestCases Sponsor: jpawlowski@ Change-Id: Id0ee8eb31547c7b333619642717ee1d87c3c01fb
* Merge "[API Review] Add java doc for BluetoothLeCallback.registerCallback()"Treehugger Robot2022-03-291-0/+4
|\
| * [API Review] Add java doc for BluetoothLeCallback.registerCallback()Patty2022-03-291-0/+4
| | | | | | | | | | | | | | Bug: 219875113 Tag: #feature Test: atest BluetoothInstrumentationTests Change-Id: Ia1c4008f9f69a6de75cc1ded169a65adef49be04
* | BluetoothLeAudio: Remove not needed catchŁukasz Rymanowski2022-03-181-2/+1
|/ | | | | | | | | Since we throw IllegalStateException there is no need to catch it. Bug: 150670922 Test: compile/manual Sponsor: @jpawlowski Change-Id: Iaa719e727a4632f95ed681340b923de28f6aaacc
* Merge "BluetoothLeAudio: Replace Intents by callbacks"Treehugger Robot2022-03-181-108/+81
|\
| * BluetoothLeAudio: Replace Intents by callbacksŁukasz Rymanowski2022-03-171-108/+81
| | | | | | | | | | | | | | | | Bug: 218799288 Bug: 150670922 Test: atest BluetoothInstrumentationTest Change-Id: I6184bdf96b95c68bb6970d3658a9999b675a8b3d
* | Merge "BluetoothLeAudio: Fix API for codec preferences"Treehugger Robot2022-03-171-16/+18
|\ \
| * | BluetoothLeAudio: Fix API for codec preferencesŁukasz Rymanowski2022-03-171-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adjust codec preferences for the Le Audio usage. API is using group id now and allows to choose configuration for output and input. Note: Input and Output shall use same codec type (for now) but different codec parameters might be used. Bug: 219875113 Test: atest BluetoothInstrumentationTests Merged-In: Iee7a0c6d42dd029f9c24a27ec892eb7ef261263b Change-Id: Iee7a0c6d42dd029f9c24a27ec892eb7ef261263b
* | | Merge "BluetoothLeAudio: Fix method description"Jakub Pawłowski2022-03-171-4/+4
|\ \ \ | |_|/ |/| |
| * | BluetoothLeAudio: Fix method descriptionŁukasz Rymanowski2022-03-171-4/+4
| |/ | | | | | | | | | | | | | | Bug: 150670922 Bug: 216554592 Test: Compile Sponsor: @jpawlowski Change-Id: I41de9022bb09d6e87b3a78ae30b510cd62613953
* / Updated documentation for new Bluetooth SystemApisEtienne Ruffieux2022-03-161-3/+4
|/ | | | | | | Bug: 223356348 Test: build (only doc modified) Tag: #feature Change-Id: I89606d0905d44dd85ae57104da260ce51e8c1568
* Merge "Remove AUDIO_LOCATION_INVALID from the flags"Treehugger Robot2022-03-141-1/+0
|\
| * Remove AUDIO_LOCATION_INVALID from the flagsAlice Kuo2022-03-151-1/+0
| | | | | | | | | | | | | | | | | | The AUDIO_LOCATION_INVALID could not be in the flags. It would always get 0 as the following check flags & AUDIO_LOCATION_INVALID != 0 Bug: 224542167 Test: make build Change-Id: I44bbcaa1bb7f29c244be2fd960f024b7cc3eb79b
* | Add getAudioLocation implementationAlice Kuo2022-03-111-3/+8
|/ | | | | | | | | | | | The change contains 1. Update the sink audio location as it is obtained from the remote device's PACS record 2. Store the audio location in the deviceAudioLocationMap 3. Clear the audio location as device unbonded 4. Support getAudioLocation function to return the sink audio location Bug: 197199736 Test: build pass Change-Id: I565f52b3b26afcc4990b5bb89ccc550e7db3607a
* Add Audio Location bit mask IntDefAlice Kuo2022-03-111-2/+265
| | | | | | Bug: 197199736 Test: make build Change-Id: I40513322944db1758861a7731879f37eca3a25d0
* Merge "Change the intent string to callback method"Jack He2022-03-101-17/+192
|\
| * Change the intent string to callback methodPatty2022-03-101-17/+192
| | | | | | | | | | | | | | | | | | | | | | Change to use callback mechanism instead of using the intent string ACTION_LE_AUDIO_CODEC_CONFIG_CHANGED to notify the codec config changed information. Tag: #refactor Bug: 219875113 Test: atest BluetoothInstrumentationTests Change-Id: Ie7459d2886d92e050952d6e01bb58d7c3e3f9dbd
* | Rethrow the exception when there is a RemoteException or service is nullPatty2022-03-081-1/+7
|/ | | | | | | Tag: #refactor Bug: 219875113 Test: atest BluetoothInstrumentationTests Change-Id: Ia29cbd6252c0b652c324b23e1fd9c0332cf45e06
* Add implementation for unimplemented APIs and add description for return valuePatty2022-03-071-3/+26
| | | | | | | | | | 1. Add implementation for getCodecStatus(), setCodecConfigPreference() and isCodecConfigSelectable() 2. Add description for the return value of getCodecLocalCapabilities() and getCodecSelectableCapabilities() Tag: #refactor Bug: 219875113 Test: atest BluetoothInstrumentationTests Change-Id: Ida32ff52990d2c062ef9f5cc965e20af030896bd
* Removed getMaxCodecType from BluetoothLeAudioCodecConfig, rename functions ↵Patty2022-02-231-0/+3
| | | | | | | | | | | | | | in BluetoothLeAudioCodecStatus 1. Remove function getMaxCodecType() 2. Rename getCodecsLocalCapabilities() to getCodecLocalCapabilities() 3. Rename getCodecsSelectableCapabilities() to getCodecSelectableCapabilities() 4. Change BluetoothLeAudio.getCodecStatus() and BluetoothLeAudio.setCodecConfigPreference() to system API Tag: #refactor Bug: 219875113 Test: atest BluetoothInstrumentationTests Change-Id: If6fa69802c0210e77dd50303b4a286514f3cffb5
* API Changes needed for apex to buildWilliam Escande2022-02-141-2/+12
| | | | | | | | | | | internal cherry-pick Bug: 216476895 Test: Compile Tag: #refactor Change-Id: I09108622038b174104457ca18ac6ec7949978f66 Merged-In: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
* Merge "Change AUDIO_LOCATION_INVALID to be systemApi"Treehugger Robot2022-02-091-0/+1
|\
| * Change AUDIO_LOCATION_INVALID to be systemApiAlice Kuo2022-02-081-0/+1
| | | | | | | | | | | | | | Bug: 216554758 Test: make build Change-Id: If029eda8c4f447b52e68034d54bc2ac0e1df3ca2 Merged-In: If029eda8c4f447b52e68034d54bc2ac0e1df3ca2
* | EXTRA_LE_AUDIO_GROUP_STATUS should be a SystemApi for completeness.Roopa Sattiraju2022-02-081-0/+1
|/ | | | | | | | Telecom testing code uses it with other LE Audio system APIs. Bug: 218387295 Test: Compile/Presubmit pass Change-Id: I3deb3a002a50dad3c5a5c1c8404f5aec0102ec78
* LE Audio: Expose more system APIsJakub Tyszkowski2022-02-021-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | * Expose two intentss: * ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED * ACTION_LE_AUDIO_GROUP_NODE_STATUS_CHANGED * Settings and Telecom are interested in the group node status information, therefore lets expose the API as a SystemApi * Reduce scope of HAP connection state API to system API * Expose more system APIs for HAP client * To select different hearing presets * To get notified about changes in hearing presets * To get all available hearing presets * Expose more system APIs for CSIP * To make error codes more visible for the API caller * Expose GROUP_ID_INVALID to public API for getGroupId() Bug: 150670922 Test: atest BluetoothInstrumentationTests Tag: #feature Sponsor: siyuanh@ Ignore-AOSP-First: earlier change merged on internal Change-Id: If87e0863f23b989632603ac1253e4a77bfff028d Merged-In: If87e0863f23b989632603ac1253e4a77bfff028d (cherry picked from commit a89f2e1a02f986de04078ee399f39ad09d0c53f8)
* Add API to set the codec preference for specific devicePatty2022-02-021-0/+67
| | | | | | | | | | | | | | | | | Add the APIs that would use in developer optin for setting the codec config preference and getiting the codec status. Expose the APIs first, some of the implementations will be done later. Add equals function to BluetoothLeAudioCodecConfig for comparison usage Tag: #feature Bug: 216276721 Bug: 150670922 Test: atest BluetoothInstrumentationTests Change-Id: Iaa9b7b1278f06228b7a22a1c61668b879b6f3dc9 Merged-In: Iaa9b7b1278f06228b7a22a1c61668b879b6f3dc9 (cherry picked from commit 7cf686a443eb2a1d036ba89c874a328fa24bb425)
* Merge "leaudio: Add method to get device group lead"Treehugger Robot2022-01-211-0/+39
|\
| * leaudio: Add method to get device group leadŁukasz Rymanowski2022-01-191-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Le Audio group is active in the system, it is represented by one group member which becames Active Device. With this patch, we want to expose group lead device which will be used as an Active Device for connected group. This is needed e.g. by telecom so it knows, which devices should be presented in the Dialer for each Le Audio group. Bug: 150670922 Tag: #feature Test: build Sponsor: jpawlowski@ Change-Id: I401ef3ceaeb334b35697dd88e2c1a9b1d5d2eac9
* | Add getAudioLocation APIAlice Kuo2022-01-201-0/+41
|/ | | | | | | | | | The API provide the audio location to integrate with the battery information and show the audio location in UI Bug: 150670922 Bug: 197199736 Test: make build Change-Id: I686aa4f630592429f58282c631af2c1135318fd3
* Remove allowBlocking from all BluetoothProfilesWilliam Escande2021-12-161-128/+179
| | | | | | | | | | | | | Since Bluetooth is becoming a mainline module, it can no longer call the allowBlocking hidden api. Instead, all interface are moved to be oneway and use a synchronous data to handle the return value. Bug: 200200870 Test: Build + start Bt and play something on speaker Tag: #refactor Merged-In: I776a6322faadca1504bce24f2b6b041e756b6448 Change-Id: I776a6322faadca1504bce24f2b6b041e756b6448
* Copy attributable to BluetoothWilliam Escande2021-12-141-2/+0
| | | | | | | | | | Attributable is called by bluetooth and it's hidden. By copying into bluetooth we are now allowed to call it Bug: 210467788 Test: build Tag: #refactor Change-Id: I73ea07c9439988ab5477c82799f718c6d81513be
* leaudio: Add missing context typesGrzegorz Kołodziejczyk2021-10-131-0/+66
| | | | | | | | | BYPASS_INCLUSIVE_LANGUAGE_REASON=exact wording for constant from BT specification Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: compile Change-Id: If0e5861e882636afba6a29c0ae34362d179035ea
* leaudio: Add API to add/remove group nodeŁukasz Rymanowski2021-10-131-0/+66
| | | | | | | | | Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Ib385b24d6b10754d9cadea2363e81c78b4382a44
* leaudio: Remove not needed group statusŁukasz Rymanowski2021-10-081-5/+15
| | | | | | | | | Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Id9145e6e2631d0eae102bcc502ae4aa233b61d7b
* leaudio: Add set volume APIŁukasz Rymanowski2021-10-081-0/+24
| | | | | | | | | Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Icb2e7681e4b5e7ba2e796671ff6f4c59bbff29d7
* leaudio: Fix link to intentŁukasz Rymanowski2021-10-081-1/+1
| | | | | | | | | Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: I7782f95cca7478dcd585d435f585bba6a453f1ab
* le_audio: Introduce connection state handling for LE Audio groupGrzegorz Kołodziejczyk2021-09-021-0/+136
| | | | | | | | | | Patch implements connection state handling for LE Audio device group. Tag: #feature Test: Set LE audio device as active Sponsor: jpawlowski@ Bug: 150670922 Change-Id: I11222ca07e265ac8b6dc3c21650874ebeffa473c
* Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage.Alice Kuo2021-06-181-1/+0
| | | | | | | | | | | | | | This change contains two item, 1. public BluetoothProfile.LE_AUDIO that App can use BluetoothProfile.ServiceLister with LE Audio profile, such as HFP, A2DP and hearing aid profile. 2. public getGroupId API that App can use this api to identify which devices are in the same group Bug: 150670922 Test: Manual test Ignore-AOSP-First: prevent merge conflict Change-Id: I32865720a8195b7c5ae29411cd1f3de95e7fc9b5
* More Binder call AttributionSource assignment.Jeff Sharkey2021-06-031-3/+5
| | | | | | | | | | | | | | | Since developers can use a BluetoothDevice object can make remote calls, it needs to have an accurate AttributionSource. Previous CLs had updated many places where these BluetoothDevice instances were passed across Binder interfaces, but this change updates several remaining locations which had been missed. Introduces new "Attributable" marker interface to offer consistent tooling when applying AttributionSource updates. Bug: 187097694 Test: atest BluetoothInstrumentationTests Change-Id: Icad3b9726591f0fbad58a493cefa5a0af7648280
* Long-tail of AttributionSource plumbing.Jeff Sharkey2021-04-241-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Wires up AttributionSource across the remaining long-tail of Bluetooth AIDL interfaces, ensuring that developers can accurately make calls chained back to a specific Context. Moves "for data delivery" permission checks to happen in a single location on each interface to ensure they're performed consistently with the new AttributionSource arguments. Note that "for data delivery" isn't the best name; it's designed to represent that the requested action was performed and should result in the relevant appop being noted for the caller. This change has the positive side effect of ensuring that all interfaces are consistently enforcing the BLUETOOTH_CONNECT permission, even in the case where BLUETOOTH_PRIVILEGED is also required; this is what ensures that revoking the "Nearby devices" permission takes effect for all callers. Additionally, standardizing on enforcing permissions closer to the AIDL entry point reduces the need for @RequiresPermission annotations to be carried around inside the Bluetooth stack. Bug: 183626112 Test: atest BluetoothInstrumentationTests Change-Id: I8023dda654e325b8bfa2f0cdb994ad63a2b429d4
* More AttributionSource plumbing.Jeff Sharkey2021-04-231-5/+11
| | | | | | | | | | | | | | | | To prepare for future work which will plumb AttributionSource values through all remaining AIDLs, we need profiles to interact directly with the specific BluetoothAdapter they were created from. This is how we'll ensure that the relevant AttributionSource can be chained down from the original Context they're obtained from. This change also marks getDefaultAdapter() as deprecated to clearly communicate that BluetoothManager.getAdapter() is the best-practice path to obtaining a correctly scoped BluetoothAdapter instance. Bug: 183626112 Test: atest BluetoothInstrumentationTests Change-Id: I1e15170d7679019bbb6e396279d6e633e3dad4d6
* Add missing Bluetooth API permission enforcement.Jeff Sharkey2021-04-181-0/+4
| | | | | | | | | | | | | | | | Recent work has been using Error Prone rules and annotations to reflect the current state of permission enforcement across the Bluetooth stack, and we're now in a position were we can add new permission enforcement that had been missing. We've currently standardized on saying that APIs that return device or Bluetooth state information (without sharing details about any particular remote Bluetooth device) do not need to be permission protected. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I37a9e03ecdca6f7a6eb9d7f094e2f95a97036612
* More Bluetooth API annotation updates.Jeff Sharkey2021-04-161-0/+7
| | | | | | | | | | | | | | | | | | This change adds a "BluetoothPermissionChecker" that ensures that all Bluetooth permission annotations are consistent. In addition, it verifies that all Bluetooth public APIs have been audited to be permission protected where relevant. We've currently standardized on saying that APIs that return device or Bluetooth state information (without sharing details about any particular remote Bluetooth device) do not need to be permission protected. This change is only annotations and has no behavior changes. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: Ie80b15b058359bf1e9a6ee881b89cb3e5b584ca1
* Update Bluetooth API annotations.Jeff Sharkey2021-04-141-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work has introduced a new "Nearby devices" runtime permission which protects all existing Bluetooth APIs; we've done this by defining a <split-permission> to convert the old BLUETOOTH and BLUETOOTH_ADMIN permissions into one of three new permissions: * BLUETOOTH_ADVERTISE: Required to be able to advertise to nearby Bluetooth devices. * BLUETOOTH_CONNECT: Allows applications to connect to paired bluetooth devices. * BLUETOOTH_SCAN: Required to be able to discover and pair nearby Bluetooth devices. At its core, this change begins updating the Bluetooth APIs to have correct @RequiresPermission indicating which permission is actually enforced internally. To ensure alignment across Binder, the newly added "RequiresPermissionChecker" Error Prone checker was used to discover any inconsistencies, ensuring correctness from server-side enforcement up through to the public APIs. In addition, since developers will continue building apps for both modern and legacy platforms, this change introduces new auto-doc annotations which will emit helpful consistent documentation describing the behavior of older devices that are still using the old permission model. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I02aa127e8e07f239561f4f2a3bbdfc6fccb82f7f
* Add Bluetooth LE Audio Profile (3/3)Grzegorz Kołodziejczyk2020-12-011-0/+451
This is boilerplate code for Bluetooth LE Audio profile Bug: 150670922 Test: compilation Tag: #feature Change-Id: Iadc3af12fd8b2808db2f4e933a1906a819824ade