Commit Graph

1501 Commits

Author SHA1 Message Date
Treehugger Robot
20b82c3646 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: I3536f29c771b9233790e6852ab6dc4cb0b58b531
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 10:38:02 +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
Chaohui Wang
c1f06b5e28 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17 am: b1231c5f15 am: 6bceb29408
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I95132b6df6fe214a0bae54b9c7be69efa77292b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 11:28:16 +00:00
Chaohui Wang
6bceb29408 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17 am: b1231c5f15
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I936a6e4a4f24a7f8c238662ec09a02f7a3e985e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 10:45:36 +00:00
Chaohui Wang
b1231c5f15 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I9e87eec0995e9dde010a51e3a7ccbaf68839a696
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 09:56:38 +00:00
Chaohui Wang
85c1dea20a Update the OWNERS for bluetooth & connecteddevice
Bug: N/A
Test: N/A
Change-Id: I72b4b6f47586b2dd13cfcc4a642c817c93e4ded0
2023-06-19 07:35:20 +00:00
Chaohui Wang
c91d017080 [LE Broadcast] Fix crash when scan QR code
Crash happens when rotated screen.

QrCodeScanModeFragment should only have default constructor.

Remove unused params to fix.

To start this page,
adb shell am start \
    -a android.settings.BLUETOOTH_LE_AUDIO_QR_CODE_SCANNER

Fix: 287363885
Test: Manually
Change-Id: I3c4bcfdb8ae6ddf750e16d8e7565cb9d45d11788
2023-06-16 16:10:53 +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
TreeHugger Robot
9b68c3c9c1 Merge "[Settings] Fix crash when user enter bluetooth page quickly." into udc-dev am: 3e374cc7a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23601556

Change-Id: I5f9975f49ec0793eabf171c5dba0791683ab0d15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 13:03:22 +00:00
tom hsu
bf7865b27e [Settings] Fix crash when user enter bluetooth page quickly.
- When SliceManager try to pinSlice, process may not have the permssion
   yet, so in Androix lib it use try/catch to avoid Security exception.
   However, if SliceManger quickly unpinSlice after pinSlice, process
   may still not get the permission yet, then due to no security
   exception, it cause the settings crash.

Bug: 283065718
Test: atest passed
Test: Manual test passed
Change-Id: I2293fca73e65dfaa34237abe57e0c6a3fe0f62bb
2023-06-07 09:37:21 +00:00
SongFerng Wang
add7deceb2 Merge "Add the log and moving it into onResume" into udc-d1-dev 2023-06-07 02:45:20 +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
SongFerngWang
13cd052693 ForgetDeviceDialogFragment check whether device is null or not
Bug: 280687867
Test: build pass
Change-Id: I4134569854165f20f6287406d9ed627b2c15c05b
2023-06-06 09:53:36 +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
SongFerngWang
1872151b4f The BluetoothDevicePreference register the MetadataChanged
The bluetooth device preference needs to refresh UI after MetadataChanged
Fix: 282877247
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePreferenceTest

Change-Id: I02cb07a6b255242e4877089ce2f3b7559ce02362
2023-05-24 04:49:41 +00:00
Michał Narajowski
a0c24932ee Merge changes from topic "late-bonding" into udc-dev
* changes:
  bt: Show additional message when is late bond
  bt: Add late bonding confirmation mechanism
2023-05-19 07:34:50 +00: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
Michał Narajowski
01164fd414 bt: Show additional message when is late bond
Sometimes the cached bluetooth device is not found and we the
BluetoothPairingController does not know if this device is a member of a
set. But if this is a late bond then it is a set member so we still want
to display that additional message.

Bug: 282193044
Test: manual
Tag: #feature
Change-Id: I9e7da093b118a81097dc83460e9b93ce2e477482
2023-05-18 15:50:10 +00:00
Michał Narajowski
63d37a3d78 bt: Add late bonding confirmation mechanism
If a coordinated set member is bonding late the user will be notified and
asked for confirmation on pairing with this device. The dialog box will
display specific message for this case.

Bug: 282193044
Test: manual
Tag: #feature
Change-Id: Ie9d79282dd432a542ea02ef477019be6dfbce997
2023-05-18 10:47:12 +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
Jason Hsu
181cfa3aa5 Merge "Move 'Audio Output' to Accessibility hearing device page" into udc-dev 2023-05-12 14:20:23 +00:00
SongFerng Wang
2821342259 Merge "The UI does not remove the preference" into udc-dev 2023-05-12 13:39:40 +00:00
SongFerngWang
0faf38eadd The UI does not remove the preference
The LE audio structure have two or more devices, it use CSIP to combine
them with the groupId. It breaks the UI structure, since the UI use the
map to save relationship between the bluetoothDevice and preference.
There are two or more devices using the same UI, it causes UI show the
wrong preference when CSIP do switching of device.
Remove the unuse device when UI refreshing.

Bug: 281697186
Test: Build pass
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest
Change-Id: I798cf9edb590c4a25273913d2f2faf0ed4364ba9
2023-05-12 17:18:37 +08:00
jasonwshsu
212470d0a6 Move 'Audio Output' to Accessibility hearing device page
* Extract the common part into HearingAidHelper.
* Remove abstract getHearingDevice(). Change to get the hearing device when needed.
* Move several classes from Bluetooth into Accessibility

Bug: 281783079
Test: make RunSettingsRoboTests ROBOTEST_FILTER="(HearingDeviceAudioRoutingBasePreferenceControllerTest|AccessibilityHearingAidPreferenceControllerTest|HearingAidHelperTest|HearingAidAudioRoutingPreferenceControllerTest|HearingDeviceCallRoutingPreferenceControllerTest)"
Change-Id: I79049107409b7086c6dcc8d48a6323e171ed1535
2023-05-12 13:46:53 +08:00
tom hsu
75b24e421e [Settings] Remove redundant code.
Bug: 280236099
Test: make passed
Change-Id: I34e0632887ac38658761abd7d6a7e9f1e0f84bf1
2023-05-11 21:12:29 +08:00
Treehugger Robot
59fa9de0cf Merge "Fix non-hearing devices show in pair new hearing devices page" into udc-dev 2023-05-11 09:42:23 +00:00
Angela Wang
fb0d23955d Fix non-hearing devices show in pair new hearing devices page
Non-hearing devices are listed in "pair new hearing devices page" if we click the "See more devices" button and go back from "general pair new devices page".

Root cause:
Two types of Bluetooth scanning happen simultaneously and the scanning results of different scanning methods are handled in the same place. Currently the BLE scanning callback “onScanResult()” directly calls “onDeviceAdded()” method to handle the new scanned devices. This method is mainly called when receiving a broadcast of a new device found in Bluetooth classic scanning. The general pair new devices page uses Bluetooth classic scanning and the pair new hearing devices page uses Bluetooth LE scanning. The life cycle ordering when going back from general pair new devices page to pair new hearing devices page will be "pair new hearing devices page".onStart() -> "general pair new devices page".onStop(). It means the classic scanning is not stopped while the BLE scanning starts and this causes the scanning results from classic scanning unexpectedly added to the list which should only show the scanning results from BLE scanning.

Solution:
Separates the handling part of two scanning methods. Leaves "onDeviceAdded" handling Bluetooth classic scanning results only, and handles BLE scanning results in the “onScanResult” callback directly.

Bug: 279374435
Test: checks the result by switching back from "general pair new devices page" to "pair new hearing devices page"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DeviceListPreferenceFragmentTest
Change-Id: Iebdde401ffb3dc0569478730a140a5dd7add115b
2023-05-11 08:28:12 +00:00
SongFerng Wang
c487d5a10c Merge "Update the wording for LE Audio" into udc-dev 2023-05-11 07:11:11 +00: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
Tom Hsu
5576947555 Merge "[Settings] Avoid NPE if BT device is changed by framework." into udc-dev 2023-05-11 04:30:19 +00:00
tom hsu
0617631408 [Settings] Avoid NPE if BT device is changed by framework.
- Do not register only one BT device for primary to avoid primary
   BT devcie change to another.
 - Register and unregister all BT devices

Bug: 280236099
Test: atest passed
Change-Id: I610144c7f8f649e40d99cf1dc7f50d1f3b80f109
2023-05-11 02:53:19 +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
Jack He
d55e645795 Merge "Remove CSIP/VCP enable/disable from Setting" into udc-dev 2023-05-09 02:43:13 +00:00
Jack He
2605ccbcfa Merge changes from topic "LeAudioBeta" into udc-dev
* changes:
  Hide the LE audio toggle by flag
  Add toggle to show/hide the Per Device Enable LE Audio Toggle in Device details
2023-05-06 00:42:40 +00:00
Alice Kuo
345889b5e2 Remove CSIP/VCP enable/disable from Setting
We moved this part to Bluetooth Framework, so remove these from Setting

Bug: 280626194
Test: NA
Change-Id: Ia84d0d68d8d77fde7479b6d4e49743dfeb821eae
2023-05-06 05:31:34 +08:00
Chaohui Wang
39bf7dd530 Fix dialog leak in RequestPermissionActivity
Dialog still show when activity destroyed will cause leak.

Dismiss dialog when activity onDestroy to fix this issue.

Fix: 279522922
Test: Manually with "Don't keep activities"
Test: Robolectric Test
Change-Id: I445f4b160020823a6f6e2883055218c1224e2c48
2023-05-05 17:30:02 +08:00
SongFerng Wang
197eb39cde Merge "Shows main_battery information for not untethered device" into udc-dev 2023-05-04 05:47:59 +00:00
SongFerngWang
706257c57a Hide the LE audio toggle by flag
Bug: 280021500
Test: build pass.
Change-Id: I3f4a821c50dfb9d2de73919945334b42c59b3309
2023-05-04 03:43:28 +08:00
SongFerngWang
0d36d37590 Shows main_battery information for not untethered device
The metadata have main_battery and device is not untethered device,
then UI show battery by metadata.

Bug: 273907230
Test: atest AdvancedBluetoothDetailsHeaderControllerTest
Change-Id: I73d8a69c81fe234a5c576ca3769c1b079ac0ceb4
2023-05-03 04:23:50 +00:00
Edgar Wang
cd74f76a43 Remove restricted icon in SettingsMainSwitchBar
- display disable status directly
- click disabled MainSwitchBar will show devicepolicy dialog
- make sure BT and location use MainSwitchBar correctly

Bug: 260406688
Test: manual
Change-Id: I8bb57213eec6dd5e991af580e1a06ebf8a867c28
2023-04-26 14:06:22 +08:00
SongFerngWang
c054498357 Replace the SlicePreference with Preference am: 794fc58235
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22755956

Change-Id: I5e9032624347b27acb02eafd28002744d92b5f2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 06:23:25 +00:00
Presubmit Automerger Backend
56c8b39d51 [automerge] Replace the SlicePreference with Preference 2p: 794fc58235
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22755956

Bug: 270544054
Change-Id: I88bb34649b2a1da21e6a3a36d90bd32c17ffb5ae
2023-04-21 15:08:44 +00:00
SongFerngWang
794fc58235 Replace the SlicePreference with Preference
The Settings' 2 panel did not support SlicePreference, since it
always open activity with NEW_TASK and it casues the settings can't
set new page at right side.

Bug: 270544054
Test: build pass. local test: the phone pair the buds with fastpair, and
then check the slice preferences.
atest BlockingPrefWithSliceControllerTest (pass)

Change-Id: I0e8abfd284492f04ab322a5bed13741fc6b25b34
2023-04-21 23:08:06 +08:00
Jason Hsu
80016ad92a Merge "Fix pair another dialog doesn't show up after pairing in all bluetooth device page." into udc-dev 2023-04-18 08:47:37 +00:00
jasonwshsu
c8a53a9391 Fix pair another dialog doesn't show up after pairing in all bluetooth device page.
Solution: Finish the page immediately to back to previous page when already BONDED the device in
all bluetooth device page.

Bug: 270096758
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ViewAllBluetoothDevicesPreferenceControllerTest
Change-Id: I13a88c3fbe0c6851f9446a9f574a1c18f934cd2e
2023-04-14 18:25:28 +08:00
Chaohui Wang
e13d644f2c Fix create bluetooth dialog repeatedly
When the screen rotates, currently the startActivityForResult() within
RequestPermissionActivity could be called multiple times, so the
multiple RequestPermissionHelperActivity will be created, which caused
the issue.

Replace RequestPermissionHelperActivity with AlertDialog (as an
unfinished TODO of RequestPermissionHelperActivity) can fix this issue.

Fix: 243601277
Test: Manually with adb shell commands
Test: Unit test
Change-Id: If1e2b2807b69a87bbcfffa543ee0da134d4c4312
2023-04-12 18:34:52 +08:00
SongFerngWang
62cc96ac05 UI add more log
Bug: 260535339
Bug: 275754566
Test: build pass
Change-Id: I15c26d5b13f93e5a425c16174d6fbc2780c4e0a6
2023-03-31 17:33:12 +08:00