aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
* Add missing lock on getSupportedProfileWilliam Escande2023-03-201-0/+3
| | | | | | | | Bug: 274037299 Test: presubmit tests (cherry picked from https://android-review.googlesource.com/q/commit:6e179238dc3b3eaa5f8e26c9eff0d891decae5ea) Merged-In: I993505cd6656d67362eeefd6bd3abd411e8f59ff Change-Id: I993505cd6656d67362eeefd6bd3abd411e8f59ff
* Fix a deadlock bug in Bluetooth FrameworkHui Peng2022-09-091-4/+8
| | | | | | | | | | | | | | | | | | | | | | | Both BluetoothDevice and BluetoothAdapter maintain a reference to a IBluetooth proxy object (sService) and each class uses a lock object to serialize access to their own reference. These references are updated by BluetoothManagerService with registered callbacks (IBlueoothManagerCallback). In the current implentaion, when an app thread uses BluetoothDevice#getService to access its reference to service proxy, with the BluetoothManager updating it at the same time, as the order of taking the locks is different, deadlock is possible under certain circumstances (triggered in bug 241212710). This patch fixes the deadlock issue by removing the reference to service proxy object in BluetoothDevice class, and accesses are via the reference in BluetoothAdapter class instead. Test: existing unit tests Bug: 241212710 Tag: #stability Change-Id: I15cd2707acf5caa04d97c6ede3bd5bedd6475c65 (cherry picked from commit 83c6281b616f597ceacdcf84e20d14368e190875) Merged-In: I15cd2707acf5caa04d97c6ede3bd5bedd6475c65
* Reuse SynchronousResultReceivers instead of creating new.Etienne Ruffieux2022-06-221-50/+50
| | | | | | | | Bug: 217366135 Tag: #feature Test: manual Ignore-AOSP-First: to be chery-picked Change-Id: If8ae530a284151888a3f89a51d2c58f2a5cd3644
* Modify incorrect API documentationEtienne Ruffieux2022-06-061-1/+1
| | | | | | | | | | | | | | | | BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord description was stating user should call BluetoothDevice#createRfcommSocketToServiceRecord to connect, but user should use BluetoothDevice#createInsecureRfcommSocketToServiceRecord instead. Tag: #feature Test: build Bug: 235047894 Ignore-AOSP-First: cherry-pick Change-Id: I6469862134d398bba8e9c738eaba081dc3ee6d65 Merged-In: I770a00dd99abab967590d100607a8b1292dc0492
* Update API docs to indicate that BT addresses are to be provided in bigRahul Sabnis2022-05-261-4/+4
| | | | | | | | | | endian. Tag: #feature Bug: 233217148 Test: Manual (docs change) Ignore-AOSP-First: Android T docs change Change-Id: Iee36345088c886d5b43120bb10d8ddf52133de07
* Add caching for {Map,Sap}.getConnectionStateWilliam Escande2022-04-291-97/+121
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Fix write lock locking mechanisme" am: c7ceab19a8 am: aa1288c9d2 am: ↵William Escande2022-04-141-3/+16
|\ | | | | | | | | | | | | | | | | f836ba2d0c Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2063178 Change-Id: Ib39bdd60a716eb373f2f2c59861b2cdc50682728 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Fix write lock locking mechanismeWilliam Escande2022-04-141-3/+16
| | | | | | | | | | | | | | | | | | Using synchronized on a instance of a writeLock is not something that can work with read/write lock Fix: 227963093 Test: build - Don't know how to reproduce such async behavior Change-Id: I9f2be339a97e83f4f3a6034e71a40f632062fb09
* | Merge "Add LE_AUDIO_BROADCAST_ASSISTANT support in BluetoothAdapter" am: ↵Jack He2022-03-311-0/+9
|\| | | | | | | | | | | | | | | | | c8c9eb5b57 am: d0a491ce3e am: a458114060 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2049903 Change-Id: Ia9ed3fda9fc3484b344e738b7a1468db68c4fa0c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Merge "Add LE_AUDIO_BROADCAST_ASSISTANT support in BluetoothAdapter"Jack He2022-03-311-0/+9
| |\
| | * Add LE_AUDIO_BROADCAST_ASSISTANT support in BluetoothAdapterHyundo Moon2022-03-311-0/+9
| | | | | | | | | | | | | | | Test: atest BluetoothInstrumentationTests Change-Id: I95400a2512f348c5df56fc8d5c21afd1e9bcc159
* | | Merge "Removed "default" for onBluetoothActivityEnergyInfoError" am: ↵Etienne Ruffieux2022-03-301-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | ae099dc69c am: a83745e97c am: caf10d1959 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2049287 Change-Id: Id8a98d6f59bd696d73ee9c02cdb52b67e8ebe806 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Merge "Removed "default" for onBluetoothActivityEnergyInfoError"Etienne Ruffieux2022-03-301-2/+2
| |\ \
| | * | Removed "default" for onBluetoothActivityEnergyInfoErrorEtienne Ruffieux2022-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 223344084 Tag: #feature Test: manual Change-Id: Iadbe3eddecc839ec3200a9f7e3a8720818a5eca3
* | | | Merge "Update BluetoothAdapter#setScanMode to throw an ↵Rahul Sabnis2022-03-301-0/+5
|\ \ \ \ | | | | | | | | | | | | | | | IllegalArgumentException when the the input is invalid" into tm-dev
| * | | | Update BluetoothAdapter#setScanMode to throw an IllegalArgumentExceptionRahul Sabnis2022-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when the the input is invalid Tag: #feature Bug: 202310885 Test: atest BluetoothHostTest#testSetScanMode Ignore-AOSP-First: Fixing GTS test Change-Id: I4cd64903de7c4b413f551ac6fd4703035e32c7b9
* | | | | Merge "Store Binder.clearCallingIdentity value as final var" am: e2f11e80d1 ↵Etienne Ruffieux2022-03-301-12/+38
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / | | | | | | | | | | | | | | | | | | | | am: 45b30f756a am: 1bd612d1df Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2049285 Change-Id: I56966db0baa98929d4cbd62fe99ede6491e4dce8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * / / Store Binder.clearCallingIdentity value as final varEtienne Ruffieux2022-03-301-12/+38
| |/ / | | | | | | | | | | | | | | | | | | Bug: 227412240 Test: manual Tag: #feature Change-Id: I91d6b0dd0d21767a9abad7e196e8f54eeb818217
* | | Merge changes from topic "api-review-result-receiver" am: 4016e3d909 am: ↵Etienne Ruffieux2022-03-291-23/+56
|\| | | | | | | | | | | | | | | | | | | | | | | | | | 96b794c2e1 am: 3ad78e8243 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2038805 Change-Id: Ied13579dc8b462e8843c1817b6711d44aa0c3411 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | [API Review] Added error method to interface Bluetooth statsEtienne Ruffieux2022-03-251-23/+56
| | | | | | | | | | | | | | | | | | | | | Bug: 223344084 Test: atest BluetoothAdapterTest Tag: #feature Change-Id: Ib5b2196539294e8024ab182ac1b624b7b38bfa26
| * | [API Review] BluetoothActivityenergyInfo doc + renameEtienne Ruffieux2022-03-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added missing documentation on new parameters for requestControllerActivityEnergyInfo and renamed onBluetoothActivityEnergyInfo Bug: 223344084 Tag: #feature Test: build Merged-In: Ie364bfb2708af953fd19cd186f37a4e2b2782167 Change-Id: Ie364bfb2708af953fd19cd186f37a4e2b2782167
| * | [API Review] Replace ResultReceiver by ExecutorEtienne Ruffieux2022-03-231-9/+57
| |/ | | | | | | | | | | | | | | Bug: 223344084 Test: build Tag: #feature Merged-In: I9fc420a49a24315e85ad49ce398d8088991b3a4a Change-Id: I9fc420a49a24315e85ad49ce398d8088991b3a4a
* | Merge "API Review: factoryReset->clearBluetooth" am: 85d45e8ee6 am: ↵William Escande2022-03-211-1/+17
|\| | | | | | | | | | | | | | | d10df2dcf7 am: 01a5b80bc3 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2028171 Change-Id: I15f7ac124b1d09fcd73c6b046b75c02de7db290c
| * Merge "API Review: factoryReset->clearBluetooth"William Escande2022-03-211-1/+17
| |\
| | * API Review: factoryReset->clearBluetoothWilliam Escande2022-03-191-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | > Consider renaming the factoryReset method to “clearBluetooth”. Bug: 222725037 Test: TH Tag; #refactor Change-Id: Idb86dc5b57b2482401f563daf71eef37610d3f0a
* | | [API Review] BluetoothActivityenergyInfo doc + renameEtienne Ruffieux2022-03-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added missing documentation on new parameters for requestControllerActivityEnergyInfo and renamed onBluetoothActivityEnergyInfo Bug: 223344084 Tag: #feature Test: build Ignore-AOSP-First: Changes only in internal Change-Id: Ie364bfb2708af953fd19cd186f37a4e2b2782167
* | | Merge "GetUuids refactor to call in correct order" am: f8e9375339 am: ↵William Escande2022-03-181-20/+18
|\| | | | | | | | | | | | | | | | | | | | | | | 716ee1cb1c am: c319521441 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2030105 Change-Id: I1f44ec4e58f8a93f6eb159c089b221e6ea625b2f
| * | GetUuids refactor to call in correct orderWilliam Escande2022-03-171-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getUuidsList was calling getUuids (return an Array[]) but the getUuids is already calling a method that return a List By inversing their call we are no longer creating a temporary array Bug: 222434921 Tag: #refactor Test: pre-submit Change-Id: I202d1923d21b795f191e1570cd489e01e78654bd
* | | Merge "API Review: Add ConnectionState Intdef" into tm-devWilliam Escande2022-03-181-9/+14
|\ \ \
| * | | API Review: Add ConnectionState IntdefWilliam Escande2022-03-161-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > getConnectionState Please add @intdef for the return value. Bug: 222434921 Test: TH Tag: #refactor Ignore-AOSP-First: merge conflict Change-Id: Idab42db60cff7a1bc346f29685acffee1764a3d3
* | | | Merge "[API Review] Replace ResultReceiver by Executor" into tm-devEtienne Ruffieux2022-03-171-9/+57
|\ \ \ \
| * | | | [API Review] Replace ResultReceiver by ExecutorEtienne Ruffieux2022-03-101-9/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 223344084 Test: build Tag: #feature Ignore-AOSP-First: merge conflict Change-Id: I9fc420a49a24315e85ad49ce398d8088991b3a4a
* | | | | Merge "[API Review] Add new GetUuidsList method" am: 0bf8d23c0f am: ↵Etienne Ruffieux2022-03-171-2/+13
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | 0593fda6e7 am: 411e45b8ed Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2020197 Change-Id: I21059b871d0c1a5f466e7e44c78d7295fb4ce2b2
| * | | | Merge "[API Review] Add new GetUuidsList method"Etienne Ruffieux2022-03-171-2/+13
| |\ \ \ \
| | * | | | [API Review] Add new GetUuidsList methodEtienne Ruffieux2022-03-101-2/+13
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per API review, created nex GetUuids method that returns a list instead of an array so we don't have to suppressLint Bug: 223253153 Test: build Tag: #feature Change-Id: I3d0036f323ba35f9182edb0c843caa0e32bec42a
| * / | | [API REVIEW] Remove BLE state from AdapterStateWilliam Escande2022-03-151-8/+15
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 221851154 Test: How do you test interface ? Tag: #refactor Merged-In: Ib9622962f4effa4b53b982275a53bbc239701bf3 Change-Id: Ib9622962f4effa4b53b982275a53bbc239701bf3
* | | | Merge "[API REVIEW] Remove BLE state from AdapterState" into tm-devWilliam Escande2022-03-151-10/+16
|\ \ \ \
| * | | | [API REVIEW] Remove BLE state from AdapterStateWilliam Escande2022-03-151-10/+16
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 221851154 Test: How do you test interface ? Tag: #refactor Ignore-AOSP-First: merge merge merge merge conflict Change-Id: Ib9622962f4effa4b53b982275a53bbc239701bf3
* | | | Merge "[API Review] Removed unnecessary SystemApi annotations" into tm-devEtienne Ruffieux2022-03-151-3/+0
|\ \ \ \
| * | | | [API Review] Removed unnecessary SystemApi annotationsEtienne Ruffieux2022-03-101-3/+0
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 223345163 Test: build Tag: #feature Ignore-AOSP-First: merge conflict Change-Id: I478d6d6d93620d3843270a7f8da95876e1fe7544
* | | | Rename API: DisconnectReasonToStringWilliam Escande2022-03-141-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | Bug: 221851154 Test: Build + TH Tag: #refactor Ignore-AOSP-First: Merge conflict Change-Id: Ib6c1c013f453ab60a3833938fa6625ab11b87ab7
* | | Merge "Always return nonNull in BluetoothAdapter.getUuids" am: 714973f307 ↵Treehugger Robot2022-03-091-3/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | am: 5d90d6db01 am: 38d965c280 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2011075 Change-Id: If56b6952060b08afdc73e9b08e196f265dab236f
| * | Merge "Always return nonNull in BluetoothAdapter.getUuids"Treehugger Robot2022-03-071-3/+3
| |\ \
| | * | Always return nonNull in BluetoothAdapter.getUuidsWilliam Escande2022-03-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: atest CtsBluetoothTestCases Fix: 221850407 Tag: #refactor Change-Id: Iaf312835ca0731b5b8ae0b9f6ea86ed67dc78321
* | | | Handle RemoteException when getstate exceptionjonerlin2022-03-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tag: #feature Bug: 218313435 Bug: 221094658 Test: Let Bluetooth enable fail to check system status Ignore-AOSP-First: aosp already included this patch Change-Id: I136944f5b5a6e05ec302abde3425e358c9822b00
* | | | Merge "Convert the Bluetooth module to os/IpcDataCache" into tm-devLee Shombert2022-03-071-18/+18
|\ \ \ \ | |_|_|/ |/| | |
| * | | Convert the Bluetooth module to os/IpcDataCacheLee Shombert2022-03-041-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "le_broadcast: Initial alignment of service with the API" am: ↵Jack He2022-03-041-0/+7
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | da47f8d985 am: 51ec356fa1 am: 66f381d91f Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1988850 Change-Id: I2cb557629d8dbccc375bae3198e71092002529a1
| * | Merge "le_broadcast: Initial alignment of service with the API"Jack He2022-03-041-0/+7
| |\ \ | | |/ | |/|
| | * le_broadcast: Initial alignment of service with the APIJakub Tyszkowski2022-03-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This aligns the .aidl interfaces, adds the callback registration mechanism, exposes profile in the Bluetooth Adapter and stitches together basic API calls with the service implementation. It does not bring the BluetoothLeBroadcastMetadata support yet. Bug: 150670922 Bug: 210985995 Tag: #feature Test: atest BluetoothInstrumentationTests Sponsor: jpawlowski@ Change-Id: Ia454badc4f95a4b9953e57709a680f178ebfea45