Commit Graph

79 Commits

Author SHA1 Message Date
Haijie Hong
15a9f1437d Clean up legacy bluetooth setting flags
BUG: 359415806
Test: atest SettingsRoboTests
Flag: EXEMPT clean up
Change-Id: I7c47d80e61cfb0e3b473106e0784cc96ba639452
2024-08-20 15:38:32 +08:00
jasonwshsu
15c6533ef9 Connected devices page did not show correct summary when member device connect
Root Cause: CsipDeviceManager only refreshes UI when switching member device content.

Solution:
* CsipDeviceManager needs to call refresh() on main device when it's new
  member device added.
* UI widget Settings/BluetoothDevice also need to monitor it's member device status to refresh UI.

Bug: 344947362
Test: atest BluetoothDevicePreferenceTest
Flag: EXEMPT bugfix
Change-Id: I58f9e2fc209d4e87631784d0538b1647228f4c1a
2024-08-09 09:49:35 +08:00
Angela Wang
e92627e26d Merge "Rename CachedBluetoothDevice.getConnectableProfiles()" into main 2024-08-07 09:52:32 +00:00
Angela Wang
3146a9a08a Merge "Fix LE Audio toggle missing issue for dual mode hearing device" into main 2024-08-06 09:31:28 +00:00
Angela Wang
711d0b269c Rename CachedBluetoothDevice.getConnectableProfiles()
The original method name implied that the returned profiles were guaranteed to be connectable. However, it actually filters profiles based on user can access the profile in the UI and initiate the connection. Change the method name to getUiAccessibleProfiles() aligns the name with the actual behavior.

Flag: EXEMPT simple renaming
Bug: 356530795
Test: m
Change-Id: Ib7d29a4bf9c213ddcecc567864583165ab97a099
2024-08-05 07:14:15 +00:00
Haijie Hong
8e7b62c887 Remove duplicate "lifecycle.addObserver(this)"
It's already been added in superclass BluetoothDetailsController.

BUG: 343317785
FLAG: EXEMPT simple fix
Test: atest BluetoothDetailsProfilesControllerTest
Test: atest BluetoothDetailsPairOtherControllerTest
Change-Id: I7a9255cea5bb18b29562fa72898356c7a01cd31c
2024-08-05 13:38:00 +08:00
Angela Wang
a8297a313b Fix LE Audio toggle missing issue for dual mode hearing device
After the code change of ag/28283226, they hide the LE Audio toggle for
LE Audio only device since turning off the profile may cause this device
no functioning. But the dual mode hearing devices(LE Audio + Asha) are
wrongly recognized as LE Audio only devices since
HearingAidProfile.accessProfileEnabled() return false. This make the
users lost the ability to switch between profiles they preferred.

Make HearingAidProfile.accessProfileEnabled() return true and hide the
Hearing Aid toggle by default since it's also meaningless to turn off
the Asha profile for Asha-only devices.

Flag: com.android.settingslib.flags.asha_profile_access_profile_enabled_true
Bug: 356530795
Test: manual checking the UI
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ica350b4c16c1b07945399bfee1038f7b0824baed
2024-08-02 07:11:25 +00:00
Haijie Hong
24bf20f033 Don't add profiles to device details page if it's null
Change-Id: Ia79fa600c87905a6a2cbf8459910d67ffb9d22dd
BUG: 341293298
Test: manually test in tablet
Flag: EXEMPT minor bug fix
2024-07-24 09:11:46 +00:00
Haijie Hong
7a40ecd953 Determine LeAudio toggle visibility after mIsLeAudioOnlyDevice is initialized
Bug: 352431349
Test: atest BluetoothDetailsProfilesControllerTest
Flag: com.android.settings.flags.hide_le_audio_toggle_for_le_audio_only_device
Change-Id: Ic6a8327f7c8e680a29dfd82407ac8304fc25cf89
2024-07-16 14:14:52 +08:00
Haijie Hong
bfcd25edca Check all member devices to determine whether it's LeAudio-only device
Bug: 352431349
Test: atest BluetoothDetailsProfilesControllerTest
Flag: com.android.settings.flags.hide_le_audio_toggle_for_le_audio_only_device
Change-Id: I3697b4f3abf5f789100b63f0b7a01c3b78d70a7f
2024-07-12 13:09:36 +08:00
Haijie Hong
0307bbfb1f Hide LeAudio toggle for LeAudio-only device
Bug: 333827147
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ie446d8866fb51972795b66aac2db84703ef51b84
2024-04-17 16:12:42 +08:00
Haijie Hong
82688cc1d3 Add bluetooth profile toggle visibility checker
Bug: 321178209
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ic6c040a5a500d51945893061623526271eba94c7
2024-01-22 17:32:09 +08:00
Rongxuan Liu
d153a82f20 Merge "Control broadcast assistant profile connection with le toggle" into main 2023-11-20 18:32:06 +00:00
Rongxuan Liu
54c2f4dd4b Control broadcast assistant profile connection with le toggle
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsProfilesControllerTest
Test: manual test with le toggle and check bass profile is
enabled/disabled
Bug: 300227308

Change-Id: If61b1edadb24b53661bb74173c243826f31956ae
2023-11-17 23:59:43 +00:00
Alice Kuo
24ef70212d Show LE audio toggle summary as default connection is classic
Bug: 310092817
Test: manual test
Change-Id: I733650a129dcbc9ab3acbb758c5a619359e25e4e
2023-11-13 18:11:31 +08:00
Chaohui Wang
cfdb3b1f1b Migrate new() to SwitchPreferenceCompat
Bug: 306658427
Test: manual - on Settings pages
Change-Id: I258a8c63d5c46403c6d333a9d2f34c33cb35e27f
2023-10-24 14:05:34 +08:00
Chelsea Hao
ad3dede7c7 Merge "Show toggle summary for LE audio toggle only when the device is not in the allowlist." into main 2023-10-16 10:05:22 +00:00
Alice Kuo
ddec75bb39 Config LE audio connection by default
Use LE audio connection by default, and allow to have the differenct
configuration per project (system property). As using LE audio connection by
default, the toggle, "Show LE audio toggle in Device Details", would be
useless, hide this toggle based on the project configuration

Bug: 300012501
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeDeviceDetailsPreferenceControllerTest
Change-Id: Ia4df48d6a71b5b9f11bd91a69971c8393412da13
2023-10-13 01:22:36 +08:00
chelseahao
74b85e4247 Show toggle summary for LE audio toggle only when the device is not in the allowlist.
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsProfilesControllerTest
Change-Id: I68040e7e92630f6efac0e1fb0f35a39ebca3cfad
2023-10-12 09:39:08 +00:00
Treehugger Robot
d7d8184bb7 Merge "Use system properties for the le audio toggle ui config instead" into udc-qpr-dev am: 2d7a469264 am: b15719119e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24768698

Change-Id: I88024462c4587db39a5e6671223504a5b7938c49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 08:00:32 +00:00
Alice Kuo
aa734eb52a Use system properties for the le audio toggle ui config instead
Config LE audio UI per devices. Change to use system properties instead

Bug: 300807171
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest
Change-Id: Id0d624f516b9fdbe2380e5f10da5c69b08eea6a4
2023-09-18 03:05:59 +00:00
Haijie Hong
21b075770e Improve Bluetooth pairing dialog & contact sharing toggle
Before change: https://screenshot.googleplex.com/Agr29KTvgptbsag
After change: https://screenshot.googleplex.com/ArjiavkFAFiuCTR

Bug: 274521434
Test: RunSettingsRoboTests
Change-Id: Ib896b70bc219de128b733b75249bf80e3389f221
2023-08-08 13:15:38 +08:00
Yuyang Huang
b40e5c2228 Merge "Enable/Disable ASHA profile with LE audio toggle" into udc-qpr-dev 2023-08-03 22:20:35 +00:00
SongFerng Wang
f15c4c2fe5 Merge "Fix testcase failed" into udc-qpr-dev am: b2c60799af am: b93774ab40
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24196278

Change-Id: If190cc993cf44254658d234289ad7b57dd8445dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 12:20:38 +00:00
SongFerng Wang
b2c60799af Merge "Fix testcase failed" into udc-qpr-dev 2023-08-01 10:55:39 +00:00
SongFerngWang
7cbfe4a10e Fix testcase failed
Bug: 292979979
Test: [Pass]make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDeviceDetailsFragmentTest
Change-Id: If09f4d8ad9c974c2a7f72932d544490655b92cf7
2023-07-26 17:54:20 +08:00
Treehugger Robot
56a76c7038 Merge "Show LE audio toggle in Device Detail by default" into udc-qpr-dev am: 2fdc9c943b am: f07e5f7520
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24002323

Change-Id: I642988621d5e208cf5acbab6e88ecd3fdae45e41
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 22:18:35 +00:00
Treehugger Robot
2fdc9c943b Merge "Show LE audio toggle in Device Detail by default" into udc-qpr-dev 2023-07-17 03:34:51 +00:00
SongFerng Wang
5da5fb57cc Merge "Revert "Revert "Update the wording for LE Audio""" into udc-qpr-dev am: 997ef1e5b3 am: 340d592bbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24018266

Change-Id: Ia48ceb51044166be7c09f3b241e181331c77d2ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 14:43:40 +00:00
SongFerng Wang
997ef1e5b3 Merge "Revert "Revert "Update the wording for LE Audio""" into udc-qpr-dev 2023-07-11 13:33:14 +00:00
SongFerng Wang
513f38cb17 Revert "Revert "Update the wording for LE Audio""
This reverts commit c123b2e5a8.

Reason for revert: Since the phase 2 launch plan was moved to next timeline at b/289884263.

Change-Id: I54ff20c0d9599da7f47e2254f721be6007a9204a
2023-07-11 08:20:23 +00:00
Patty Huang
698ce52a17 Show LE audio toggle in Device Detail by default
Bug: 289884263
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest
Test: Checks the LE Audio toggle is shown in Device Detail by default
Change-Id: I3affeebd9b2c59d24f4eaa76a1a22a714e968976
2023-07-10 11:05:35 +08:00
Treehugger Robot
89889d73d4 Merge "Do not show LE audio toggle in Device Detail by default" into udc-d1-dev am: 1f9f114495 am: 20b82c3646 am: 07678daaf7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23898723

Change-Id: I8d284b59c2d74a91e58d1e47eddc86f16ea5ed49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 12:05:39 +00:00
Treehugger Robot
07678daaf7 Merge "Do not show LE audio toggle in Device Detail by default" into udc-d1-dev am: 1f9f114495 am: 20b82c3646
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23898723

Change-Id: I302b91cd8502cca57a28e74cbbf72cf962d6468f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 11:21:28 +00:00
Treehugger Robot
5da1b03545 Merge "Do not show LE audio toggle in Device Detail by default" into udc-d1-dev am: 1f9f114495
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23898723

Change-Id: I2398f07f2f4936ab26a59a2df285ea3dae05bb94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 10:42:29 +00:00
Yuyang Huang
83e5cd004f Enable/Disable ASHA profile with LE audio toggle
LE audio has more capability and better quality than ASHA has. When LE audio turned on, ASHA should be off to avoid media streaming profile conflict.

Bug: 287525854
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f79e084bd0a3f9cd332d8218ac040d8c6c60f658)
Merged-In: I3c5c9012c167b920e484b39374fe8174191b094d
Change-Id: I3c5c9012c167b920e484b39374fe8174191b094d
2023-07-06 17:43:20 +00:00
Patty Huang
627a584f39 Do not show LE audio toggle in Device Detail by default
Bug: 289884263
Bug: 289957406

Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest
Test: Checks the LE Audio toggle is not shown in Device Detail by default
Change-Id: I2c6430c791dd852d238d7122a72f218f395c4a0b
2023-07-05 11:51:50 +08:00
Yuyang Huang
de771725c4 Merge "Enable/Disable ASHA profile with LE audio toggle" 2023-06-30 18:16:28 +00:00
SongFerng Wang
c123b2e5a8 Revert "Update the wording for LE Audio"
This reverts commit f4c5c8ef5e.

Reason for revert: at stage3, removing this summary.
Bug: 289184862
Change-Id: I6b18a7e2dee9d8fcfb331e53d7a57cc43574da54
2023-06-28 10:06:59 +00:00
Yuyang Huang
f79e084bd0 Enable/Disable ASHA profile with LE audio toggle
LE audio has more capability and better quality than ASHA has. When LE audio turned on, ASHA should be off to avoid media streaming profile conflict.

Bug: 287525854
Change-Id: I3c5c9012c167b920e484b39374fe8174191b094d
Test: manual
2023-06-27 23:32:06 +00:00
SongFerngWang
7dc3cf0b32 When config is changed, update the profile's visibility
Bug: 286328464
Test: build pass
Change-Id: I2beef587a71f9fdc1b1e8a97b9b5656dbb52a9f3
2023-06-08 10:40:54 +00:00
SongFerngWang
ea85e3b2fa Add the log and moving it into onResume
Since user can open two settings app(one is via settings app button and other one is via quick settings) and user can switch them to foreground by the recent page. If user can goto the deviceDetails at Settings_A and then changes the config value at settings_B, then the user goes back Settings_A to check the UI. If config is in the init, the UI can't refresh the UI.
Bug: 285086232
Test: build pass.
Change-Id: I2284940eddcd02c543522b60f951c0d8d25775fd
2023-06-07 01:45:31 +00:00
Patty Huang
3e980c7c8f Default show LE audio toggle in Device Detail
Bug: 284790607
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest
Test: Checks the LE Audio toggle is shown in Device Detail by default
Change-Id: Id301815513e8066941d3e4c44ab2e7b4d5ed011b
2023-06-01 20:36:34 +08:00
David Duarte
2920cad66f Merge "Revert "Revert "Remove CSIP/VCP enable/disable from Setting""" into udc-dev 2023-05-18 21:58:59 +00:00
SongFerngWang
ef7a75c394 To refresh/register/unregister all of the devices with same groupId
Since the LE audio have two or more devices in the same group and
the UI show their status at one preference, the UI need to register
callback for each of the devices, and also refresh the deviceList.

Bug: 278155752
Test: local test to pairing the device and check the battery part
Change-Id: I2fcde92a1f68b8437465b234820f7bad13dfc444
2023-05-18 16:28:52 +08:00
Rahul Sabnis
7840717139 LEA developer option is enabled if the BT LEA flag is enabled
Bug: 281568856
Test: Manual
Change-Id: If59afff53c304e38074d7a9999329dc039d4cffb
2023-05-15 17:53:26 -07:00
SongFerngWang
f4c5c8ef5e Update the wording for LE Audio
Add the summary for LE Audio toggle
Bug: 280000165
Test: build pass

Change-Id: Ic1eee71d6ff70d01e9a37ab0ec06cfaf639fe963
2023-05-11 12:30:59 +08:00
Alice Kuo
560abbcc49 Revert "Revert "Remove CSIP/VCP enable/disable from Setting""
This reverts commit 6edb515a9f.

Reason for revert: we need this change and need to merge together with prebuilt

Bug: 280626194
Change-Id: Id883c6c7c778154038c249f7be8e9fabf52299c3
2023-05-09 08:01:50 +00:00
Treehugger Robot
83cc6a64c6 Merge "Revert "Remove CSIP/VCP enable/disable from Setting"" into udc-dev 2023-05-09 05:33:40 +00:00
Jack He
6edb515a9f Revert "Remove CSIP/VCP enable/disable from Setting"
This reverts commit 345889b5e2.

Reason for revert: Accidental merge, should merge together with prebuilt

Bug: 280626194
Change-Id: I93f66f22b55eb906f8e079de35f2db00b102c788
2023-05-09 02:44:45 +00:00