summaryrefslogtreecommitdiff
path: root/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r35' of ↵George Zacharia2023-04-031-0/+15
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into t13.0 Android 13.0.0 release 35 Change-Id: I709958b2f015d1774b2ece25894467c3a279f93c
| * [Unicast] Won't show "active" when changing active from HS to LEHSSongFerngWang2022-12-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | if the 'active device' is in the member device list, then the main device is active and then updating the main device's state. Bug: 259892289 Test: build pass. make RunSettingsLibRoboTests -j40 ROBOTEST_FILTER=BluetoothEventManagerTest Change-Id: I60d7cb40cc29ea12e5d4f12c10d44eda3e2cf4fe
* | Merge tag 'android-13.0.0_r16' into t13.0George Zacharia2022-12-151-5/+14
|\| | | | | | | | | | | | | | | | | | | | | Android 13.0.0 Release 16 (TQ1A.221205.011) Also included the following reverts: 1. Revert "fw/b: Import Wi-Fi standard icon [1/2]" 2. Revert "Add preference for toggling the wallpaper zooming animation" Co-authored-by: Semavi Ulusoy <doc.divxm@gmail.com> Change-Id: I9a6b51e452c28d10411712c59778bb54da5783e9
| * [Bluetooth] Convert BluetoothController logs to log buffer so we'llCaitlin Shkuratov2022-09-151-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | always have them. We're mainly interested in the activeDeviceChanged log for b/243755182 but it'll be good to have all the logs. This is almost the same as Id1b12dbf802cae07120f1d6cc2c0b2e3967a1c75, but with these changes: - In BluetoothControllerImpl#onActiveDeviceChanged, check for null - Add @NonNull or @Nullable annotations to BluetoothCallback - Add a test case for #onActiveDeviceChanged with a null device Bug: 246876230 Bug: 243755182 Fixes: 234774643 Test: dumped log buffer from device after connecting + disconnecting bluetooth devices Test: BluetoothControllerImplTest Change-Id: I8643bd0061559c3cfc90f0741de12949be3f68f2
| * [BT LE unicast] clear the GroupId when user click 'Forget'SongFerngWang2022-08-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | - To clear the groupId after device unpaired. - switchMemberDeviceContent don't change the member list. Bug: 240103816 Test: build pass. [pass] make RunSettingsLibRoboTests -j40 ROBOTEST_FILTER=CachedBluetoothDeviceManagerTest [psss] make RunSettingsLibRoboTests -j40 ROBOTEST_FILTER=CachedBluetoothDeviceTest Change-Id: I65dc254f33236fa7fad08a07e56187962700e6c6
* | base: Bluetooth timeout feature (1/2)Oliver Scott2022-11-021-0/+27
|/ | | | | | | | SDB - adapt for A12 FLAG_MUTABLE Signed-off-by: SuperDroidBond <superdroidbond@yahoo.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Change-Id: I454451eea6f8b740f52e5fd5894bd7ff4c9558e0
* API Review: add `UNBOND` in `EXTRA_REASON` nameWilliam Escande2022-03-151-1/+1
| | | | | | | | | | | > 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 Change-Id: I684e56572d1882d02f6f782fa10f3db793fe182d
* Fix Broken test: Package: com.android.settingslib.bluetoothHugh Chen2022-01-241-12/+0
| | | | | | | | | Remove the test receiver since the robotest can register intent when assign Context.RECEIVER EXPORTED as parameter. Bug: 216048096 Test: make -j64 RunSettingsLibRoboTests Change-Id: Ic67c9e459c4f959d0121425790db4c7d4a85ade1
* Fix broken tests on LocalBluetoothProfileManagerTestHugh Chen2022-01-191-0/+6
| | | | | | Bug: 215308761 Test: make -j64 RunSettingsLibRoboTests Change-Id: Id2146dd4461ea848fc59f90c8caafcf6104647f8
* Update test case for RECEIVER_EXPORTEDHugh Chen2021-12-071-0/+6
| | | | | | Bug: 208875751 Test: make -j64 RunSettingsLibRoboTests Change-Id: Ie79354ca68338acc40f16812076f70909f546c6a
* Print anonymized address when new device foundChienyuan2021-11-231-1/+2
| | | | | | Bug: 206676415 Test: manual Change-Id: I2af0ed4645fbae621431ac709df3b1e6d540f271
* Fix settingLib couldn't receive the broadcast issue.Alice Kuo2021-11-221-2/+4
| | | | | | Bug: 207311784 Test: scan device normal Change-Id: I3bb628871b4921f87c92e03386bcb6f66d90ae9f
* Merge "settingslib/bluetooth: Add LeAudio support"Jakub Pawlowski2021-10-151-0/+6
|\
| * settingslib/bluetooth: Add LeAudio supportŁukasz Rymanowski2021-10-151-0/+6
| | | | | | | | | | | | | | | | | | Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Merged-In: I45402a6d315d8ccc2bc756bdc9937e81eea3c58a Change-Id: I45402a6d315d8ccc2bc756bdc9937e81eea3c58a
* | Move set member pair handle from settingLib to settingAlice Kuo2021-10-151-28/+0
|/ | | | | | | | | | | | | Remove createBond from settingLib. SystemUI and Setting have the individual settingLib instance. If we trigger pairing inside settingLib, the action would be called twice. Bug: 201758444 Bug: 150670922 Test: Pair the coordinated set devices, and check the set member pairing would be done automatically without the pairing dialog Change-Id: I289b8af857530f0fb207b777d09d94549cfdf553
* Merge "csip: seamless pair with the coordinated set" am: 90ba3faab4Treehugger Robot2021-09-231-0/+34
|\ | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829332 Change-Id: I17cb45059f03a550603e149eb071c1b410717d4c
| * csip: seamless pair with the coordinated setAlice Kuo2021-09-231-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | 1. Handle the set member avaiabler intent, check the group is existing and create bond automatically. 2. Accept the paring request for the ongoing set member Bug: 150670922 Bug: 178981521 Test: pair with one of the CSIP supported device,and get bonded with the whole coordinated set Change-Id: Ia95e1ba6dccde0a4e61a9eafdef746b1415704a4
| * Update CSIP base uuid devie set into a single device detail preferenceAlice Kuo2021-09-231-2/+5
| | | | | | | | | | | | | | | | | | | | Bug: 178981521 Bug: 150670922 Test: pair with two device which are a coordinated set, and make sure the UI only show one device Merged-In: I1a8d570da1af7fa4c8b3a99f8ce69d23b574e96c Change-Id: I1a8d570da1af7fa4c8b3a99f8ce69d23b574e96c
| * csip: Expose an extra data with intent and store in CachedBluetoothDeviceAlice Kuo2021-09-181-0/+3
| | | | | | | | | | | | | | | | | | | | Bug: 178981521 Bug: 150670922 Test: Discover and pair with the CSIP supported device, and check the pairing string in the dialog Merged-In: I3e99c59e0cb974409291e1b4c28393106784e133 Change-Id: I3e99c59e0cb974409291e1b4c28393106784e133
| * Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)Xin Li2020-08-311-3/+9
| |\ | | | | | | | | | | | | | | | Bug: 166295507 Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27 Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
* | | Update CSIP base uuid devie set into a single device detail preferenceAlice Kuo2021-09-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 178981521 Bug: 150670922 Test: pair with two device which are a coordinated set, and make sure the UI only show one device Change-Id: I1a8d570da1af7fa4c8b3a99f8ce69d23b574e96c
* | | csip: Expose an extra data with intent and store in CachedBluetoothDeviceAlice Kuo2021-09-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 178981521 Bug: 150670922 Test: Discover and pair with the CSIP supported device, and check the pairing string in the dialog Change-Id: I3e99c59e0cb974409291e1b4c28393106784e133
* | | Do not show error toast when received UNBOND_REASON_REMOVEDHugh Chen2021-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not show error toast when received UNBOND_REASON_REMOVED, because this reason is also received when devices unbond like forget devices. Bug: 181738217 Bug: 173165769 Test: make -j42 RunSettingsLibRoboTests Change-Id: I7c9675014bb642a28dcfb313fa5ce7283cb43d92
* | | Fix toasts message is not displayed when cancel BT pairing requestHugh Chen2020-11-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this CL, Bluetooth EventManager did not handle the error reason that was called UNBOND_REASON_REMOVED. If UNBOND_REASON_REMOVED is sended when cancel BT pairing, the error toast will not display. This CL will show error toast when received UNBOND_REASON_REMOVED. Bug: 173165769 Test: make -j42 RunSettingsLibRoboTests Change-Id: I5c75c17ebe204c8b9e5f1ff18c39ef8142e009eb
* | | Merge "Remove bluetooth address from logs in SettingsLib" am: 4ad4ca07bb am: ↵Treehugger Robot2020-08-131-7/+1
|\| | | |/ |/| | | | | | | | | | | 2918f0ef46 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1397949 Change-Id: I3ef3df5cb8c99c97770ced51a7c8e0dff5f629a7
| * Remove bluetooth address from logs in SettingsLibChienyuan2020-08-121-7/+1
| | | | | | | | | | | | | | Bug: 162912703 Bug: 163427379 Test: manual Change-Id: I25ad9363ff70ae175eb4c1a1b1d1209ff63dff23
| * Concurrent collections for Bluetooth callbacks.davidln2019-12-161-68/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows callback classes to remove themselves or add additional callbacks in response to state change dispatches. Bug: 129060225 Bug: 144357642 Test: build and deploy, pair multiple devices, switch users Change-Id: I8eed81bbc9c12321ec41b2491d006764e2e483d6 Merged-In: I8eed81bbc9c12321ec41b2491d006764e2e483d6
* | Fix deadlock in CachedBluetoothDeviceManagerhughchen2019-11-071-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following deadlock exist in previous code: 1. Main thread: Device.refresh() -> Device.dispatchCallback() -> Lock callback -> (handle callback in systemui) -> DeviceManager.getDevicesCopy() -> try lock deviceManager 2. Bg thread: DeviceManager.onActiveDeviceChanged() -> Lock deviceManager -> Device.dispatchCallback() -> try lock callback This CL remove sychnorized method in DeviceManager to unblock this deadlock. Fixes: 143373496 Test: Manual Change-Id: Ib17d99a8d797e4e514e965541a04a520f89edad5
* | Concurrent collections for Bluetooth callbacks.davidln2019-06-171-68/+41
|/ | | | | | | | | | | | This allows callback classes to remove themselves or add additional callbacks in response to state change dispatches. Bug: 129060225 Test: build and deploy, pair multiple devices (w/code path that hits problem case), RunSettingsLibRoboTests Change-Id: I8eed81bbc9c12321ec41b2491d006764e2e483d6
* Fix deadlock in LocalBluetoothManagerjackqdyulei2019-02-141-2/+8
| | | | | | | | | | | | | | | | | | | | Following deadlock exist in previous code: 1. Main thread Device.refresh()->Device.dispatchCallback()->Lock callback->(handle callback in systemui)->DeviceManager.getDevicesCopy()-> try lock deviceManager 2. Bg thread DeviceManager.onUuidChange()->Lock deviceManager->Device.refresh()->Device.dispatchCallback()-> try lock callback This CL remove sychnorized method in DeviceManager to unblock this deadlock. Since UuidChange can only happen in bg thread, we don't need this extra lock in DeviceManager. Fixes: 112483982 Test: Manual Change-Id: I1a8bb130cfff40358783f5f5da7e50e5f0a42e20
* Add null check for AclStateChangedHandlerChienyuan2018-12-281-0/+4
| | | | | | | | | | | When we receive ACL state change and can't find corresponding CachedBluetoothDevice, we will trigger onAclConnectStateChanged with null activeDevice and cause NullPointerException. Add a null check in AclStateChangedHandler to prevent it. Bug: 122049350 Test: RunSettingsLibRoboTests Change-Id: Iaabccc8c4ad60dbae14bbb0f6af655be06bc18ea
* Merge "Fix issue to avoid Hearing Aid show duplication device."TreeHugger Robot2018-12-201-0/+10
|\
| * Fix issue to avoid Hearing Aid show duplication device.wengsu2018-12-201-0/+10
| | | | | | | | | | | | Bug: 119536231 Test: make -j56 RunSettingsLibRoboTests Change-Id: I086b92570475f52ab2fe54ff9d4b26d207e5999c
* | Add bluetooth related log to improve debugChienyuan2018-12-191-0/+5
|/ | | | | | | | | | 1. add address log when CachedBluetoothDevice update profiles 2. add address log when CachedBluetoothDevice.onProfileStateChanged 3. add log for deviceFoundHandle when cachedDevice != null Bug: 114317168 Test: build pass Change-Id: I37ea5ce210542f4e9afc13f669cec6db88839a85
* Add ACL broadcast for bt devicesjackqdyulei2018-10-301-0/+39
| | | | | | | | | | | | | | When we receive profile state change, the device may still be physically connected(e.g. BluetoothDevice.isConnected() return true). In this case UI still show a device is connected. Add ACL broadcast listener which will be triggered when device is physically disconnected. In this callback we can refresh UI to make it show correct information. Bug: 79947085 Test: RunSettingsLibRoboTests Change-Id: I8370cc568fcb0d5995f164e7e62391a9525cbe19
* Merge "Makes LocalBluetoothManager multi-user aware."Jovana Knezevic2018-10-261-4/+41
|\
| * Makes LocalBluetoothManager multi-user aware.jovanak2018-10-251-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It enables LocalBluetoothManager to receive broadcasts for a specific UserHandle, not just the one that created it, by exposing an additional create method. To pass in UserHandle different from the one returned in context.getUser(), one must have INTERACT_ACROSS_USERS_FULL permission. Should be used by singletons with adequate permissions to be able to monitor bluetooth state across all users. For monitoring the state across all users, pass in UserHandle.ALL. Change-Id: Id89d73b05bfebc2f9e8673c5610b3ff8f70dba0c Fixes: 117517726 Test: working on them
* | Make HearingAid code more generictimhypeng2018-10-251-1/+0
|/ | | | | | | | | | -group hearingAid code into HearingAidDeviceManager -add subDevice in CachedBluetoothDevice to store second hearingAid device -add test case Bug: 112735753 Test: make -j42 RunSettingsLibRoboTests Change-Id: I6f554076b3e4e525959aba84e735b15f0e55d9d3
* Filter out the connected device in "Available devices" screen(2/2)Ash_Chen2018-10-121-2/+4
| | | | | | | | Don't add connected devices under "Available devices" Bug: 113568981 Test: Bluetooth Pairing Test with some devices and accessories Change-Id: If5596d0d77e4a470166b6ce269baf47f34d5e397
* Remove BluetoothEventManager#setReceiverHandlerAmin Shaikh2018-08-291-19/+5
| | | | | | | | | Make BluetoothEventManager fields final and remove the method to unregister receivers unnecessarily (introduced in b/35415158). Bug: 113122466 Test: runtest systemui && make RunSettingsLibRoboTests Change-Id: I8f34ab1a809638959ab4096a829c72b3d1ac3a23
* Merge "Sort imports"Fan Zhang2018-08-291-1/+0
|\
| * Sort importsFan Zhang2018-08-281-1/+0
| | | | | | | | | | | | | | | | Having consistent import order will reduce chance of merge conflict between internal and external master Test: rebuild Change-Id: I9acb311ec05f72f0a37f08b0d26785841fe91de5
* | Merge "Show bonded devices in "Pair new device"(1/2)"TreeHugger Robot2018-08-281-0/+3
|\ \ | |/ |/|
| * Show bonded devices in "Pair new device"(1/2)Ash_Chen2018-08-271-0/+3
| | | | | | | | | | | | | | | | | | | | Some users forgot they had paired devices and couldn't see their BT device when they search device in "Pair new device". (b/80382940, b/80133137). Need to change the behavior to let paired devices can be shown on "Available devices". Bug: 111738593 Test: Bluetooth Pairing Test Change-Id: Iff0b40e422230fca9a3287bba4a3c4c7c4ce9cc0
* | Remove BluetoothDevice.ACTION_DISAPPEARED from SettingLibstimhypeng2018-08-241-19/+0
| | | | | | | | | | | | | | | | - this was only for Android Ice Cream Sandwich Bug: 112115770 Test: make -j42 RunSettingsLibRoboTests Change-Id: I6c2b87529af7e6a7123cde8141fbdb9d1822ec9f
* | Merge "Revert "Remove useless broadcast registeration""TreeHugger Robot2018-08-231-0/+1
|\ \
| * | Revert "Remove useless broadcast registeration"Lei Yu2018-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f6bd36df7845068035afaad500ff6cb1f5a8de87. Reason for revert: This cause a crash in systemui Bug: 113095328 Change-Id: I5e6169f0e86e88d1b2d36d04c436e9990eaffcb0
* | | Merge "Remove the local cached BluetoothClass"TreeHugger Robot2018-08-221-2/+0
|\ \ \
| * | | Remove the local cached BluetoothClasshughchen2018-08-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use BluetoothDevice.getBluetoothClass() to get the cached Bluetooth class instead of use mBtClass that is local cached. Bug: 112517004 Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=CachedBluetoothDeviceTest Change-Id: I48b974e7ac4e813b498cea0257253f02b4c07dd2
* | | | Merge "Remove the local cached name"TreeHugger Robot2018-08-221-1/+0
|\| | |