summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothLeAudio.java
AgeCommit message (Collapse)Author
2022-07-26Merge TP1A.220624.020Deyao Ren
Change-Id: I357db3da652d8ce93bb26a00d0f123fae1b7c64c
2022-06-30Revert "Revert "Reuse SynchronousResultReceivers instead of creating new.""Neha Jain
This reverts commit dd85e91cea26c7f706af36c852e79d5b4ca1f173. Bug: 217366135 Reason for revert: Need this to fix a crash bug in tm-dev Change-Id: I2a94c278edc0681c5b8af6ea0a0171b71d72c650 (cherry picked from commit dbaf406ccb0ed887d4e93057c9ec0d3457f14457) Merged-In: I2a94c278edc0681c5b8af6ea0a0171b71d72c650
2022-06-29Revert "Reuse SynchronousResultReceivers instead of creating new."Neha Jain
This reverts commit 02dcbe72b3564559eaa9c2e2714824e4aac6f18c. Reason for revert: Causing builds to fail b/237471430 Change-Id: I6165d838abf312085050359377f67a68a5f8b51a (cherry picked from commit f5dd42bbd05e68f7763ccaa9fae5642acc4ceba1) Merged-In: I6165d838abf312085050359377f67a68a5f8b51a
2022-06-29Reuse SynchronousResultReceivers instead of creating new.Etienne Ruffieux
Bug: 217366135 Tag: #feature Test: manual Ignore-AOSP-First: to be chery-picked Change-Id: If8ae530a284151888a3f89a51d2c58f2a5cd3644 (cherry picked from commit 02dcbe72b3564559eaa9c2e2714824e4aac6f18c) Merged-In: If8ae530a284151888a3f89a51d2c58f2a5cd3644
2022-05-15Merge TP1A.220507.001Brian Orr
Change-Id: I0474d4c5321a9bca5e519669c5e7f8eb3aee821d
2022-05-10BT: Adding CS params and new entires in BT framework.Satheesh Kumar Pallemoni
- Adding CS params and new entires in BT framework - Enabled framework logs for Le Audio. CRs-Fixed: 3187056 Change-Id: I3cbd67961f331cd47969e0b281af81cf6cd8de2e
2022-04-27BluetoothLeAudio: Improve handling lead device disconnectionŁukasz Rymanowski
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)
2022-04-01Fix unregistering callbacksJakub Tyszkowski
Bug: 150670922 Tag: #feature Test: atest CtsBluetoothTestCases Sponsor: jpawlowski@ Change-Id: Id0ee8eb31547c7b333619642717ee1d87c3c01fb
2022-03-29Merge "[API Review] Add java doc for BluetoothLeCallback.registerCallback()"Treehugger Robot
2022-03-29[API Review] Add java doc for BluetoothLeCallback.registerCallback()Patty
Bug: 219875113 Tag: #feature Test: atest BluetoothInstrumentationTests Change-Id: Ia1c4008f9f69a6de75cc1ded169a65adef49be04
2022-03-18BluetoothLeAudio: Remove not needed catchŁukasz Rymanowski
Since we throw IllegalStateException there is no need to catch it. Bug: 150670922 Test: compile/manual Sponsor: @jpawlowski Change-Id: Iaa719e727a4632f95ed681340b923de28f6aaacc
2022-03-18Merge "BluetoothLeAudio: Replace Intents by callbacks"Treehugger Robot
2022-03-17Merge "BluetoothLeAudio: Fix API for codec preferences"Treehugger Robot
2022-03-17Merge "BluetoothLeAudio: Fix method description"Jakub Pawłowski
2022-03-17BluetoothLeAudio: Replace Intents by callbacksŁukasz Rymanowski
Bug: 218799288 Bug: 150670922 Test: atest BluetoothInstrumentationTest Change-Id: I6184bdf96b95c68bb6970d3658a9999b675a8b3d
2022-03-17BluetoothLeAudio: Fix API for codec preferencesŁukasz Rymanowski
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
2022-03-17BluetoothLeAudio: Fix method descriptionŁukasz Rymanowski
Bug: 150670922 Bug: 216554592 Test: Compile Sponsor: @jpawlowski Change-Id: I41de9022bb09d6e87b3a78ae30b510cd62613953
2022-03-16Updated documentation for new Bluetooth SystemApisEtienne Ruffieux
Bug: 223356348 Test: build (only doc modified) Tag: #feature Change-Id: I89606d0905d44dd85ae57104da260ce51e8c1568
2022-03-14Merge "Remove AUDIO_LOCATION_INVALID from the flags"Treehugger Robot
2022-03-15Remove AUDIO_LOCATION_INVALID from the flagsAlice Kuo
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
2022-03-11Add getAudioLocation implementationAlice Kuo
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
2022-03-11Add Audio Location bit mask IntDefAlice Kuo
Bug: 197199736 Test: make build Change-Id: I40513322944db1758861a7731879f37eca3a25d0
2022-03-10Merge "Change the intent string to callback method"Jack He
2022-03-10Change the intent string to callback methodPatty
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
2022-03-08Rethrow the exception when there is a RemoteException or service is nullPatty
Tag: #refactor Bug: 219875113 Test: atest BluetoothInstrumentationTests Change-Id: Ia29cbd6252c0b652c324b23e1fd9c0332cf45e06
2022-03-07Add implementation for unimplemented APIs and add description for return valuePatty
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
2022-02-23Removed getMaxCodecType from BluetoothLeAudioCodecConfig, rename functions ↵Patty
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
2022-02-14API Changes needed for apex to buildWilliam Escande
internal cherry-pick Bug: 216476895 Test: Compile Tag: #refactor Change-Id: I09108622038b174104457ca18ac6ec7949978f66 Merged-In: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
2022-02-09Merge "Change AUDIO_LOCATION_INVALID to be systemApi"Treehugger Robot
2022-02-08Change AUDIO_LOCATION_INVALID to be systemApiAlice Kuo
Bug: 216554758 Test: make build Change-Id: If029eda8c4f447b52e68034d54bc2ac0e1df3ca2 Merged-In: If029eda8c4f447b52e68034d54bc2ac0e1df3ca2
2022-02-08EXTRA_LE_AUDIO_GROUP_STATUS should be a SystemApi for completeness.Roopa Sattiraju
Telecom testing code uses it with other LE Audio system APIs. Bug: 218387295 Test: Compile/Presubmit pass Change-Id: I3deb3a002a50dad3c5a5c1c8404f5aec0102ec78
2022-02-02LE Audio: Expose more system APIsJakub Tyszkowski
* 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)
2022-02-02Add API to set the codec preference for specific devicePatty
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)
2022-01-21Merge "leaudio: Add method to get device group lead"Treehugger Robot
2022-01-20Add getAudioLocation APIAlice Kuo
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
2022-01-19leaudio: Add method to get device group leadŁukasz Rymanowski
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
2021-12-16Remove allowBlocking from all BluetoothProfilesWilliam Escande
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
2021-12-14Copy attributable to BluetoothWilliam Escande
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
2021-10-13leaudio: Add missing context typesGrzegorz Kołodziejczyk
BYPASS_INCLUSIVE_LANGUAGE_REASON=exact wording for constant from BT specification Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: compile Change-Id: If0e5861e882636afba6a29c0ae34362d179035ea
2021-10-13leaudio: Add API to add/remove group nodeŁukasz Rymanowski
Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Ib385b24d6b10754d9cadea2363e81c78b4382a44
2021-10-08leaudio: Remove not needed group statusŁukasz Rymanowski
Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Id9145e6e2631d0eae102bcc502ae4aa233b61d7b
2021-10-08leaudio: Add set volume APIŁukasz Rymanowski
Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: Icb2e7681e4b5e7ba2e796671ff6f4c59bbff29d7
2021-10-08leaudio: Fix link to intentŁukasz Rymanowski
Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: I7782f95cca7478dcd585d435f585bba6a453f1ab
2021-09-02le_audio: Introduce connection state handling for LE Audio groupGrzegorz Kołodziejczyk
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
2021-06-18Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage.Alice Kuo
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
2021-06-03More Binder call AttributionSource assignment.Jeff Sharkey
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
2021-04-24Long-tail of AttributionSource plumbing.Jeff Sharkey
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
2021-04-23More AttributionSource plumbing.Jeff Sharkey
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
2021-04-18Add missing Bluetooth API permission enforcement.Jeff Sharkey
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
2021-04-16More Bluetooth API annotation updates.Jeff Sharkey
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