summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
AgeCommit message (Collapse)Author
2022-07-26Merge TP1A.220624.020Deyao Ren
Change-Id: I357db3da652d8ce93bb26a00d0f123fae1b7c64c
2022-07-14Revert "Fixes a bug in the BluetoothDevice#getIdentityAddress API where it"Bart Sears
This reverts commit 448c2830336794d350b1c7c4f62c3e406b172e32. Reason for revert: b/238847789 Test: Clean revert of CL Change-Id: I30941e8b9344e9dbaacaec5ca2c2046d149ed839 (cherry picked from commit bf9246b080ee80380d3fc5f20258294a69f81391) Merged-In: I30941e8b9344e9dbaacaec5ca2c2046d149ed839
2022-07-13Fixes a bug in the BluetoothDevice#getIdentityAddress API where itRahul Sabnis
returns the mAddress field of the device instead of null when the identity address is not known. Tag: #feature Bug: 238353063 Test: atest AdapterServiceTest#testAddressConsolidate Ignore-AOSP-First: Change needs to land in TM release Change-Id: I577843c9e2cc279915d0632ff25bde66aa949e94 (cherry picked from commit 448c2830336794d350b1c7c4f62c3e406b172e32) Merged-In: I577843c9e2cc279915d0632ff25bde66aa949e94
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-06-16Merge TP1A.220611.001Jose Galmes
Change-Id: I5bff987f996d599e6bdb0f22d1eec680b5d7d6c1
2022-06-09BluetoothDevice#getUuids() returns null again when no UuidsEtienne Ruffieux
getUuids was wrongly returning an empty array of Uuids when fetchUuidsWithSdp had not been called. It now returns null again. Test: atest CtsBluetoothTestCases Bug: 235456437 Tag: #feature Ignore-AOSP-First: will be cherry-picked Change-Id: If8aafc1b0ab4e253fdacc827726d76825b3bd1e4
2022-05-15Merge TP1A.220507.001Brian Orr
Change-Id: I0474d4c5321a9bca5e519669c5e7f8eb3aee821d
2022-05-03Merge TP1A.220422.001Deyao Ren
Change-Id: I413ca31daa6902265a5a4fd83b646b3f049e5fd5
2022-04-29Add caching for {Map,Sap}.getConnectionStateWilliam Escande
BluetoothMap and BluetoothSap are heavily using their getConnectionState method. By caching the value I intend to reduce drastically the number of binder calls generated. While performing a discovery, the caching is working on 80% of binder calls. This value should be bigger when we kepp asking the value for the same device. (currently everytime you ask the connection state of a new device, you refresh the cache, there is no caching for multiples devices). I don't have any Map/Sap setup to test it, asking to test team if they hit some issues Fixing cache on BluetoothDevice by passing the device as parameter Doing a refactoring of all cached method in bluetooth to keep code consistency: AKA we try to do the most of check outside of the cache query Bug: 217366135 Test: Put some log to see the value being cached sometimes - need more testing Ignore-AOSP-First: No caching api on AOSP Change-Id: Iababf9f9068a181e277b400e786a4a67d4447dc8
2022-04-15Restore devices volume after bluetooth restartWilliam Escande
At AvrcpVolumeManager startup, we tried to read the sharedPref and to save it in the memory. A clean is performed on this list to remove non-bonded devices. The issue here is that the getBondState was returning BOND_NONE for all devices due to check perform on the adapter State. We don't know why the adapter is not reported as STATE_ON at this point but this check was added on all method to sanitize the shutdown process. Because this is a cached value there is no risk from a crash at shutdown Fix: 228415780 Ignore-AOSP-First: No caching done on AOSP Test: Manual testing Change-Id: I52362c3b511054abcb88e0cb83df95ba74c62ef4
2022-04-08Merge TP1A.220404.001Scott Lobdell
Change-Id: Ie978b3464b876dfaba2bf22ab195875f4fb4856a
2022-04-02Merge TP1A.220328.001Rob Seymour
Change-Id: I5f07094ba2fb3991da03673f97d2957b1f68018b
2022-03-25Add Bluetooth state check as service null isn't sufficient.Etienne Ruffieux
When verifying if Bluetooth is up in some APIs, BluetoothDevice was only checking if the service is null. When the adapter turns off, getState can return STATE_OFF before the callback to inform the Adapter of the new state is received, so the service isn't null but the state is off for a brief period of time. Adding the state checks along with the service checks prevents being able to call an API when Bluetooth is off. Bug: 214056525 Tag: #feature Test: atest BluetoothDeviceTest Ignore-AOSP-First: Merge conflict Change-Id: Ic387a19402ec6cd3e06677f554da8a8de695b4fc
2022-03-25Merge TP1A.220321.002Scott Lobdell
Change-Id: Ie8206e8b9c11c3fd55b7adddac5c782ad92c9da4
2022-03-23Merge "More metadata for spatial audio and fast pair" am: 81a78d9f3e am: ↵Treehugger Robot
20756a9aa9 am: 2f52d18c6a Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1998179 Change-Id: Ied125d9dd48e9eb1c99ccef6075ef0bd9657438b
2022-03-23Merge "More metadata for spatial audio and fast pair"Treehugger Robot
2022-03-23More metadata for spatial audio and fast pairUgo Yu
Bug: 221369251 Test: atest BluetoothInstrumentationTests Tag: #feature Change-Id: I304f6b6656138859628b7397f682df997a3a3e0f
2022-03-19Merge "API Review: add `UNBOND` in `EXTRA_REASON` name" into tm-devTreeHugger Robot
2022-03-18API Review: add `UNBOND` in `EXTRA_REASON` nameWilliam Escande
> Can you make EXTRA_REASON an 'unsupported app usage' alias for > EXTRA_UNBOUND_REASON (which is in the public API)? > And add a max target SDK to the @UnsupportedAppUsage annotation. Bug: 221851154 Test: Build + TH Tag: #refactor Ignore-AOSP-First: Merge conflict Change-Id: I7aa94fc5cf78f275e8e3da665e1ec8b6f1611dcc
2022-03-17Merge TP1A.220310.002Daniel Norman
Change-Id: If2f3a2a6833c45ec4c0cba7c7e668a487938cb92
2022-03-17Merge "Updated documentation for new Bluetooth SystemApis" am: 372da145de ↵Etienne Ruffieux
am: 1775d3764c am: 4e3e368fde Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2018895 Change-Id: Id2da0e0ff098aca837ee9e30323eab0faff2a2b4
2022-03-17Merge "Updated documentation for new Bluetooth SystemApis"Etienne Ruffieux
2022-03-16Merge "Updating docs for BluetoothDevice#disconnect as-per API council ↵TreeHugger Robot
feedback" into tm-dev
2022-03-16Updated documentation for new Bluetooth SystemApisEtienne Ruffieux
Bug: 223356348 Test: build (only doc modified) Tag: #feature Change-Id: I89606d0905d44dd85ae57104da260ce51e8c1568
2022-03-15Updating docs for BluetoothDevice#disconnect as-per API council feedbackRahul Sabnis
Tag: #feature Bug: 202102309 Test: Manual Ignore-AOSP-First: Original change is only in internal branches Change-Id: I9afe1e4701690bed0f27fba912abd5e696030878
2022-03-15Merge "API Review: Add prepareToEnterProcess javadoc" am: 17f869d80e am: ↵William Escande
14ce8d3779 am: ba29d7e073 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2026503 Change-Id: Ia669f5dea0fd419ea8a0b275e3845cd16a14ac31
2022-03-15API Review: Add prepareToEnterProcess javadocWilliam Escande
Bug: 221851154 Test: No Tag: #refactor Change-Id: I8df00bd0a73207117b05a89dc916707f74e970e3
2022-03-11Merge TP1A.220225.003Scott Lobdell
Change-Id: Id71ac466dbfe3707fe2e544ce22b1da8f474ec2b
2022-03-11Merge "SpatialAudio: Add comment to the intent API per API council's ↵Treehugger Robot
instruction" am: acdd96105e am: 41093d3f10 am: c06c8e68bc Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1973344 Change-Id: Ia7f5cf6416da2a67774d2d24f07cfe536236af70
2022-03-11Merge "SpatialAudio: Add comment to the intent API per API council's ↵Treehugger Robot
instruction"
2022-03-10SpatialAudio: Add comment to the intent API per API council's instructionChen Chen
Bug: 216832331 Test: Build Change-Id: I7bd3caf13521d9a1f3c9c05d0f154544af097911
2022-03-08Fix after API_reviewWilliam Escande
* isMandatoryCodec is now public * SCAN_FAILED_OUT_OF_HARDWARE/SCANNING_TOO_FREQUENTLY is now public with a IntDef (method using the value are changed accordingly) * Update doc for EXTRA_BATTERY_LEVEL and EXTRA_PAIRING_INITIATOR and ACTION_CONNECTION_STATE_CHANGED * Add Autoclosable to BluetoothSap to remove the NotCloseable * BluetoothClass.Device.PERI* are now public Bug: 222725037 Fix: 221851154 Test: Build + TH Tag: #refactor CTS-Coverage-Bug: 222539659 Merged-In: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0 Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
2022-03-08Fix after API_reviewWilliam Escande
* isMandatoryCodec is now public * SCAN_FAILED_OUT_OF_HARDWARE/SCANNING_TOO_FREQUENTLY is now public with a IntDef (method using the value are changed accordingly) * Update doc for EXTRA_BATTERY_LEVEL and EXTRA_PAIRING_INITIATOR and ACTION_CONNECTION_STATE_CHANGED * Add Autoclosable to BluetoothSap to remove the NotCloseable * BluetoothClass.Device.PERI* are now public Bug: 222725037 Fix: 221851154 Test: Build + TH Tag: #refactor CTS-Coverage-Bug: 222539659 Ignore-AOSP-First: merge conflict resolution Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
2022-03-07Merge TP1A.220209.001Deyao Ren
Change-Id: Id0e2895d3220831d2c617a243047e8229af8acc9
2022-03-04Convert the Bluetooth module to os/IpcDataCacheLee Shombert
Bug: 214455273 Tag: #refactor Convert all references to PropertyInvalidatedCache into references to os/IpcDataCache. IpcDataCache has the necessary system APIs for mainline modules. Any system APIs in PropertyInvalidatedCache will be deleted. Manual testing was done by pairing a phone with a headset and verifying that the caches were in use via 'dumpsys cacheinfo'. Test: presubmit Change-Id: Ia9ebc89ba6fc8d1c3757dcb141b37a59a0b3f713
2022-03-03Merge "BT LE broadcast assistant implementation" am: 4024c5ee49 am: ↵Jack He
627c75137f am: 43c9825758 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1952637 Change-Id: I537e81d8bb6c9fd8306e367f9f599412d047ed40
2022-03-02BT LE broadcast assistant implementationxiaowang
BT LE broadcast assistant implementation Test: compile Tag: #feature sponsor: siyuanh@ Change-Id: Ia183608f3551319f79f8e2aa933445346c42c028 Signed-off-by: Myles Watson <mylesgw@google.com>
2022-02-18Revert "Revert "Enable binder caches in Bluetooth module""William Escande
This reverts commit b13a1a0131e2b831f313409c70dd73b4fecdb100. Reason for revert: Fixing original CL Some code was left commented in original CL Change-Id: Ib834ebbec25d502ecab6bc78987f56fc6ff23b44 Fix: 214455273 Tag: #refactor Test: Manual testing Ignore-AOSP-First: No such api in aosp
2022-02-15Revert "Enable binder caches in Bluetooth module"Lee Shombert
This reverts commit 3e8fdcf3a141216196c27c15eed57cb7d0913877. Reason for revert: Bug: 219424192 Test: No test. Change-Id: Ibe7e246a85d048d55904f2a2f61ec5ac1f97a449
2022-02-15Revert "Enable binder caches in Bluetooth module"Lee Shombert
This reverts commit 3e8fdcf3a141216196c27c15eed57cb7d0913877. Reason for revert: Bug: 219424192 Test: No test. Change-Id: Ibe7e246a85d048d55904f2a2f61ec5ac1f97a449 (cherry picked from commit 8deea4b181821016dc637a5ae7e391fd00ba58eb) Merged-In:Ibe7e246a85d048d55904f2a2f61ec5ac1f97a449
2022-02-14Remove duplicate method exposureWilliam Escande
Bug: 217352944 Test: Build Tag: #refactor Merged-In: I92007320df801df53e797873048b654cf376ed31 Change-Id: I92007320df801df53e797873048b654cf376ed31
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-11Enable binder caches in Bluetooth moduleLee Shombert
Bug: 214455273 Tag: #refactor Re-enabled binder caches in the Bluetooth mainline module. Manual testing was done by pairing a phone with a headset and verifying that the caches were in use via 'dumpsys cacheinfo'. Test: presubmit Change-Id: I1948f22d2b0ca43152468cebf5395b786fd68ab0
2022-02-09Merge TP1A.220126.001Haamed Gheibi
Change-Id: Ibe4916c42b096976ac917991cf0c73f02512f3d4
2022-02-08Remove duplicate method exposureWilliam Escande
This partially revert ag/16736843 as there is already the cancelBondProces exposed as systemAPI Bug: 217352944 Test: Build Tag: #refactor Ignore-AOSP-First: api is not expose on aosp Change-Id: I92007320df801df53e797873048b654cf376ed31
2022-02-04Merge TP1A.220120.003Haamed Gheibi
Change-Id: I202f5093bbd13b381ea11f969fee6154ba91fa11
2022-02-02Introduce LE audio broadcast system APIsJack He
* Rename BluetoothLeBroadcastSourceInfo to BluetoothLeBroadcastReceiveState so that it matches the name in the Bluetooth specification * Added callbacks to BluetoothLeBroadcast so that caller that wait for asynchronouze operations with reason code in the hope to reduce potential race conditions * Allow multiple broadcast to be set up on the same deivce if the device supports it * Added ScanFilter to searchForSources() method and removed selectSources() method for BluetoothLeBroadcastAssistant so that the Bluetooth stack can automatically handle periodic sync after a Broadcast source is found and only do this for a limited number of devices * Added structural APIs to store Broadcast Source and Group information * Added unknown address type in BluetoothDevice Bug: 208222281 Test: make Tag: #feature Ignore-AOSP-First: Merge conflict in master Change-Id: If4c3af658b5bc1283d76e5d1899485a487ab7626 Merged-In: If4c3af658b5bc1283d76e5d1899485a487ab7626 (cherry picked from commit 4f9d902028fbe271167547884c33fb9ec7601080)
2022-02-02Add API to get identity addressChienyuan
Bug: 197044261 Bug: 216305555 Test: build pass Tag: #feature Change-Id: Ia62e9e3ee8934b3afc5e98d41caf40ddb5e47fc5 Merged-In: Ia62e9e3ee8934b3afc5e98d41caf40ddb5e47fc5 (cherry picked from commit 139b970aa9e9c91e52524b2354895e58467d3554)